Add a `/renoise/trigger/note` OSC endpoint

OK, maybe this is a bit of a niche feature, but I’m going for it anyway.

Renoise is a crazy cool sound engine, and lately I’ve been trying to use it a backend to Tidal Cycles.

It kind of works, but I faced one major block. In renoise, like in MIDI, there is one event to trigger a note (note_on), and one event to release a note (note_off). From the point of view of a keyboard player, it makes sense: when you press a key to play a note, you don’t necessarily know for how long you will play it.

Things are a bit different in Tidal (and maybe other live coding environments). There, the note’s length is known from the start, so the event triggering the note contains the note’s duration, so the note_off event is moot. It may look like a minor difference, but it has quite a few implications (for example in Tidal each note is independant and “stateless”, which is not the case with note_on/off).

Anyway, here is the idea:

/renoise/trigger/note(instrument, track, note, velocity, duration)

That OSC endpoint would trigger a note like note_on, and attach a scheduled note_off event to that specific note.

I’ve tried to do it in lua, but I had some ugly lags. I guess there is a reason for /renoise/trigger/note_(on|off) to be hardcoded in renoise …


Let me elaborate on the subject.

The Tidal sequencer is built with polyphony in mind: you can trigger as many notes in parallel - you can even layer the same note multiple times if you want. As the length of the note is defined when triggered, the sequencer has full control over when each note stops.

Renoise is perfectly fine with polyphony - in fact you can also trigger the same note from the same instrument multiple times. But the API exposing note_on and note_off (either MIDI or OSC) is less expressive because a note_off event is not attached to a note_on event, but to a track+instrument+note.

It makes sense to do it this way because that’s how it is done with MIDI, but I think the interest of OSC is to go beyond MIDI limitations and build more expressive APIs.

OK I’ll stop ranting now, thanks for your time, and thanks for this wonderful piece of software! :wink: