Heya!
First of all, thanks for creating this amazing piece of software!
Currently I'm using [AbletonOSC](https://github.com/ideoforms/AbletonOSC)
to control Ableton via OSC which works great.
AbletonOSC also has addresses to query information from Ableton. For example the state of the metronome:
/live/song/get/metronome
This gave me the idea to call this address in the onCreate
script of my metronome Button widget, so it gets the state of the metronome from Ableton when starting up O-S-C.
I've created the following script and noticed that the send()
function doesn't return the value of the call:
const HOST = 'localhost'
const PORT = 11000
const QUERY_METRONOME_URI = '/live/song/get/metronome'
const isMetronomeOn = send(HOST, PORT, QUERY_METRONOME_URI)
console.log('isMetronomeOn', isMetronomeOn)
// isMetronomeOn seems to be undefined since send() doesn't seem to return anything.
if (isMetronomeOn) {
set('this', true)
}
This raises a couple of questions:
- What's the reason why
send()
doesn't return anything? - Is it possible to change the send function so it does return the result? Right now it only seems valuable to set values but not to receive values. I did see there's a
receive
function but that's not available in the Widget scripts and also doesn't return anything. - Is there another workaround available?
Keep in mind that the setting of the metronome uses a different address:
/live/song/set/metronome
.
Hereby a screenshot of the Widget. You can also see that there's no result in the Console:
Thanks a lot for your help!
Kind Regards,
Ron