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 » 21 Jul 2014 18:56

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:1639
Joined:04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post by Softcore » 22 Jul 2014 07:42

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 » 22 Jul 2014 10:51

Ooops sorry here it is.
Attachments
ChordGrid.jzml
(7.07KiB)Downloaded 67 times

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post by Softcore » 22 Jul 2014 11:46

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 » 22 Jul 2014 19:51

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:1639
Joined:04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post by Softcore » 23 Jul 2014 06:12

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.97KiB)Downloaded 75 times

GV1
Newbie
Posts:38
Joined:03 Jan 2012 19:33

Re: Scripting - Pads Being Held After Pressed

Post by GV1 » 23 Jul 2014 08:47

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:1639
Joined:04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post by Softcore » 23 Jul 2014 15:00

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:1639
Joined:04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post by Softcore » 23 Jul 2014 16:11

Have never tried such an approach and I cant currently test it.....but maybe you can test it...... ;)
Attachments
ChordGrid-looped.jzml
(7.09KiB)Downloaded 62 times

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Scripting - Pads Being Held After Pressed

Post by Softcore » 23 Jul 2014 16:17

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.41KiB)Downloaded 67 times

Post Reply