Scripting - Pads Being Held After Pressed

Discuss Lemur and share techniques.
GV1
Newbie
Posts: 38
Joined: 03 Jan 2012 19:33

Scripting - Pads Being Held After Pressed

Post 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
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post by Softcore »

Uhmmmmm.....where's the attachement?
GV1
Newbie
Posts: 38
Joined: 03 Jan 2012 19:33

Re: Scripting - Pads Being Held After Pressed

Post by GV1 »

Ooops sorry here it is.
Attachments
ChordGrid.jzml
(7.07 KiB) Downloaded 60 times
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post 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.
GV1
Newbie
Posts: 38
Joined: 03 Jan 2012 19:33

Re: Scripting - Pads Being Held After Pressed

Post 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.
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post 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?
Attachments
ChordGrid-customMidiOut.jzml
(6.97 KiB) Downloaded 70 times
GV1
Newbie
Posts: 38
Joined: 03 Jan 2012 19:33

Re: Scripting - Pads Being Held After Pressed

Post 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.
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post 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.
Last edited by Softcore on 23 Jul 2014 16:19, edited 1 time in total.
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post by Softcore »

Have never tried such an approach and I cant currently test it.....but maybe you can test it...... ;)
Attachments
ChordGrid-looped.jzml
(7.09 KiB) Downloaded 56 times
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post 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.
Attachments
ChordGrid-simplesolution.jzml
(7.41 KiB) Downloaded 62 times
Post Reply