General
Scripting - Pads Being Held After Pressed
Started by GV1 on .
Sign in or create an account to join the conversation.
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:
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
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:
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
Uhmmmmm.....where's the attachement?
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.
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.
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.
How do I get around 3? This is the part that is confusing me.
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?
ChordGrid-customMidiOut.jzml
So, is there a particular reason, you didnt use custom midi outs, like so?
ChordGrid-customMidiOut.jzml
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.
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.
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.
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.
Have never tried such an approach and I cant currently test it.....but maybe you can test it...... 
ChordGrid-looped.jzml
ChordGrid-looped.jzml
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.
ChordGrid-simplesolution.jzml
ChordGrid-simplesolution.jzml
Can I put multiple custom midi messages for each set of pads? Although a little long winded, it would work. I tried adding multiple and only the 1 worked.
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.
How do I get around 3? This is the part that is confusing me.