Hey there. I'm currently having fun working on something I called "redirt" - the idea is to expose as much of renoise's OSC API to tidal. I have a few OSC endpoints working, but I'm scratching my head about this one:
:{
let renoise = Target {
oName="renoise",
oAddress="127.0.0.1",
oPort=8000,
oLatency=0.2,
oSchedule=Live,
oWindow=Nothing
}
formats = [
OSC "/renoise/trigger/note_on" $ ArgList [
("sound", Just $ VI (-1)),
("track", Just $ VI (-1)),
("on", Nothing),
("velocity", Just $ VI 127)
],
OSC "/renoise/trigger/note_off" $ ArgList [
("sound", Just $ VI (-1)),
("track", Just $ VI (-1)),
("off", Nothing)
]
]
sound = pI "sound"
track = pI "track"
noteOn = pI "on"
noteOff = pI "off"
velocity = pI "velocity"
vel = velocity
oscmap = [(renoise, formats)]
:}
renoise has two different endpoints for note_on
and note_off
. Here, I'm differenciating them with noteOn
and noteOff
.
d1 $ noteOn "23 42" -- sends note_on events
d2 $ noteOff "23 42" -- sends note_off events
But I don't find it very convenient, I'd rather decouple the note informations and the type of message (on or off). So I tried this:
formats = [
OSC "/renoise/trigger/note_{trigger}" $ ArgList [
("sound", Just $ VI (-1)),
("track", Just $ VI (-1)),
("note", Nothing),
("velocity", Just $ VI 127)
]
]
trigger = pS "trigger"
sound = pI "sound"
track = pI "track"
trigger = pS "trigger"
velocity = pI "velocity"
Now I can decouple, but ...
d1 $ note "23 42" # trigger "on" -- it works, yay!
d2 $ note "23 42" # trigger "off" -- won't work because of velocity
Here, renoise is rather strict about the endpoint arguments - if note_off receives a velocity, it discards the message.
What are your thoughts? Do you think it is a good idea to decouple "note" and "trigger"? How would you do it considering the constraints?