Apologies if this is a dumb question, but I’m not finding an answer (or not recognizing one) after searching the tutorial, the Lang tab and of course Google.
As I mentioned in my introductory post one of the things I want to do with SPi is use it as a synth I can play my Linnstrument through. The tutorial is clear about how to capture note_on events and pass them to a synth, i.e, the following is working in the sense that I can press a pad and hear a note played.
live_loop :midi_piano_on do
use_real_time
note, velocity = sync "/midi/ls-mapped-mode/*/*/note_on"
synth :piano, note: note, amp: velocity / 127.0
end
The problem is that I want the note to stop when I release the pad, not before or after. Instead the note plays for whatever duration is the default for the synth (I’ve tried :piano, :tb303 and :tri)
I can see the note_off messages in the cue log, so they’re definitely coming through. So far I’ve tried creating a second live_loop to match “note_off”. I tried 3 different methods. See the comments for the results of each one.
live_loop :note_on_event do
use_real_time
note, velocity = sync "/midi/ls-mapped-mode/*/*/note_on"
synth :tri, note: note, amp: velocity / 127.0
end
live_loop :note_off_event do
use_real_time
note, velocity = sync "/midi/ls-mapped-mode/*/*/note_off"
#Re-attacks the note on key up.
#synth :tri, note: note, amp: velocity / 127.0
#No effect. Same result as not having this loop.
#synth :tri, note: note, amp: 0, on: nil
#No effect. Same result as not having this loop.
#midi_note_off note: note
end
What’s right way to handle the note_off event?
Thanks!