Page 1 of 2

Scripting - Pads Being Held After Pressed

Posted: 21 Jul 2014 18:56
by GV1
I have an issue with my current template.

Basically I have a small script to handle NOTEON and NOTEOFF on my pads. It's working, except the pad seems to be held and the note continues to play even though I have removed my finger from the pad. I have tried using the following in my NOTEOFF script:

Code: Select all

decl t = firstof(x);
Monitor.value = octave[t];
noteout(0,octave[t],0,1);
It's being fired because the Monitor is displaying the correct value. I have attached my jazz file below if anyone can help.

Note: I've had to set the midi channel to none on the actual pads, because I don't want it to send out it's default notes. My NOTEON and NOTEOFF script will do that.

Thanks

Re: Scripting - Pads Being Held After Pressed

Posted: 22 Jul 2014 07:42
by Softcore
Uhmmmmm.....where's the attachement?

Re: Scripting - Pads Being Held After Pressed

Posted: 22 Jul 2014 10:51
by GV1
Ooops sorry here it is.

Re: Scripting - Pads Being Held After Pressed

Posted: 22 Jul 2014 11:46
by Softcore
Ok...some things which I dont quite understand.

1. Your noteOFF script is set to execute when x rises from 0 (up arrow) so in fact your noteOFF happens when you PRESS a pad.

2. Your noteON script is set to execute when x DROPS to 0 (down arrow) so in fact your noteON happens when you RELEASE a pad.

3. While x drops to 0 (a pad is released) and NO other pad is released, the firstof(x) will NOT return anything meaningful to you - certainly NOT which pad was pressed, just the x count. (when all pads are NOT pressed firstof(x)= count of pads = 12

4. Your velocities in both scripts are 0 - still not sure how you get Note ons in the first place - you shouldnt since all your velocities are 0 in your scripts.

Re: Scripting - Pads Being Held After Pressed

Posted: 22 Jul 2014 19:51
by GV1
Fixed 1. and 2. and 4. No idea why it was doing that because I did set it up correctly. I think I was testing to see if a pad triggers when NOTEON sends a note with a 0 velocity. Anyway, those are done.

How do I get around 3? This is the part that is confusing me.

Re: Scripting - Pads Being Held After Pressed

Posted: 23 Jul 2014 06:12
by Softcore
There is also another problem with firstof(x) - you can't press more than one pad and expect both to have a note out......firstof(x) will ONLY return the FIRST pad that is pressed.

So, is there a particular reason, you didnt use custom midi outs, like so?

Re: Scripting - Pads Being Held After Pressed

Posted: 23 Jul 2014 08:47
by GV1
I wasn't aware custom midi messages could be used that way. I did try to create one but wasn't sure how it hooked up with the object.

Out of interest, the pitch is set to 'octave' how does it know what note was pressed?

Also, I remember why I didn't use a custom midi message, because I wasn't sure how to send a chord.

Re: Scripting - Pads Being Held After Pressed

Posted: 23 Jul 2014 15:00
by Softcore
How its hooked up:

Notice that octave = octave.c4

this means pitch = {60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71}
and the trigger x = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

Now the "handy" way these are tied together is that WHENEVER one of the pads (or more are pressed) - which means whenever one of the above zeros goes 1, it "triggers" the associated pitch....So if for example you press the 3rd pad, this means x[2]=1 or x={0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0} and so, the pitch 62 will be triggered as note on.

;)

For chords however indeed, you will have to resort to scripts or multiple custom midi outs, possibly with conjuction of some smart switched enable-disable
- or simply press more than one pad. It all depends on what you are after. Assuming you do need scripted outputs and not custom midi outs, yet still there's a better way than using first of. I'll be right back with an example.

Re: Scripting - Pads Being Held After Pressed

Posted: 23 Jul 2014 16:11
by Softcore
Have never tried such an approach and I cant currently test it.....but maybe you can test it...... ;)

Re: Scripting - Pads Being Held After Pressed

Posted: 23 Jul 2014 16:17
by Softcore
OR here's the solution to your initial design, although STILL since it uses firstof(x) you cant use more than one pad at a time.