Hi there ,
Excuses if it is too simple an issue but I am a bit short in time and I would really like to use Sonic Pi in my next performance a few days from now.
The issue is with MDI IN settings . How do I get the MIDI CC value to keep constant?
If I use it within the loop like so :
in_thread(name: :key_0) do
live_loop :midi_piano do
chan, ampCC = sync "/midi/reloop_keypad/9/1/control_change"
with_fx :compressor, amp: 0.5 do
use_real_time
use_synth_defaults release: 2, cutoff: 1, attack: 1, amp: ampCC/127.0
##| use_synth :saw
note, velocity = sync "/midi/reloop_keypad/9/1/note_on"
synth :saw, note: note,
amp: velocity / 127.0
play note
play note + 50
sleep 0.125
end
end
end
The amp value from my Midi controller updates only when I touch it and seems to reset to 0 if I don’t
If I place it outside the loop like so :
in_thread(name: :key_0) do
chan, ampCC = sync “/midi/reloop_keypad/9/1/control_change”
live_loop :midi_piano do
with_fx :compressor, amp: 0.5 do
use_real_time
use_synth_defaults release: 2, cutoff: 1, attack: 1, amp: ampCC/127.0
##| use_synth :saw
note, velocity = sync "/midi/reloop_keypad/9/1/note_on"
synth :saw, note: note,
amp: velocity / 127.0
play note
play note + 50
sleep 0.125
end
end
end
it updates only if I run the code again
Any alternatives to this ?
I should be able to control in real time the level of ampCC without having to rerun the code every time or touch the volume fader every note I strike.
Any suggestions welcome
Thanks in advance
Seb