I am trying to send an array via OSC into Sonic Pi and am having trouble storing it into a variable and accessing the values within the array.
This is the array I am trying to send:
[62, 50, 62, 61, 54, 57, 50, 57, 54, 51, 48, 53, 52, 53, 54, 60, 54, 52, 52, 48, 48, 51, 53, 48, 45, 45, 50, 49, 48, 59, 60, 45, 61, 39, 45, 44, 41, 41]
I tried using set and get but had no luck.
# a = [] # -> initializing 'a' as an array didn't help
live_loop :foo do
use_real_time
a = sync "/osc/wek/outputs"
set :notes, a
end
live_loop :magenta do
use_real_time
puts get[:notes] # prints out '[]'
puts get[:notes[0]] # prints out 'nil'
sleep 1
end
Any help is appreciated. If I can get this to work, my next step would be to send multiple arrays, so if there would be more then just repeating the same process, any insight would also be appreciated.