How do I send 'noteOff' messages from UI Button?
-
Pretty much what the title says.
-
-
@Chazrox said in How do I send 'noteOff' messages from UI Button?:
found this...see if it works...
Synth.noteOffFromUI(int channel, int noteNumber)
I haven't use that one, but this is the one I use and it works for me:
Synth.addNoteOff(int channel, int noteNumber, int timeStampSamples)
-
@VirtualVirgin Thanks! What do you recommend for timeStampSamples? How is that applied here? This is my first time doing something like this.
-
@Chazrox use timeStampSamples = 0
There is also another method depending on how you need to handle noteOn and noteOff.
If you use
Synth.addNoteOn(int channel, int noteNumber, int velocity, int timeStampSamples)
to add your notes I believe it returns the eventId.
With that you can use
Synth.noteOffByEventId(int eventId)
to match notes you made with the first method.
So for example:
local eventId = Synth.addNoteOn(1, 60, 127,0);
Then you can supply that eventId to make the matching noteOff.
-
@VirtualVirgin Thank you
This looks promising. I'm gonna try this out now!
-
@VirtualVirgin This worked best for me! Thank You! I got it working with my chord script perfectly.
Bingo:
The script:
for (i = 0; i < chord1.length; i++) { Engine.setKeyColour(i, NoKeyColour); Synth.addNoteOff(1, chord1[i] + 60 + Octave1 + Chord1Choice - 1, 0); } //THANK YOU!
-
C Chazrox marked this topic as a question
-
C Chazrox has marked this topic as solved