Sending osc messages from a drum rack

Hi all,

I have a very specific question.

I want to be able to send osc messages by using a drum rack. The messages are being sent to resolume via ableset.

So i want to trigger a scene in resolume every time i play a kick for example. But, it should only work during a specific time in the set. So i can’t midi map the notes from the launchpad in ableset to send osc. Except if it is possible to disable this script on the fly.

Is there a solution to my problem, and if so, what would be the best way to do it?

Thanks for any help!

Hey @FAster77,

This reminded me of a related thread, with a similar fail-safe approach.

You could achieve this trying to gate the OSC sends with a flag that you can toggle from Live’s timeline. That way the launchpad notes only forward to Resolume during the section(s) you want.

Here are two approaches, depending on how flexible you need it.


Option 1 — Toggle a shared variable from the timeline (most flexible)

1. Add an OSC track in Live to act as the on/off switch.
Create a MIDI track named Drum Gate +OSC for e.g. Place two short clips on it:

  • At the start of the section where you want triggers active, a clip named:
    /shared/drumsActive true
    
  • At the end of that section, a clip named:
    /shared/drumsActive false
    

You can have as many on/off pairs as you want across the set.

2. MIDI-map your launchpad drum notes in AbleSet using Custom Script as the action (Settings → MIDI Mapping, OSC & Scripting → Edit MIDI Mapping → add a mapping for each drum note → set action to Custom Script).

For each note, the script just checks the flag before sending:

// only fire if we're inside a "drum-active" zone
if (shared("drumsActive")) {
   // your Resolume OSC command goes here
}

If you’ve set up an OSC Connection named Resolume (Settings → OSC Settings → Add New Connection), the :Resolume/... prefix will route it there.


Option 2 — Check the active section name directly

If your trigger zone matches a specific section in your AbleSet timeline, you can skip the OSC track entirely and just check the section name in the script:

const section = osc("/setlist/activeSectionName");
if (section === "Drum Solo" || section === "Bridge") {
  // your Resolume OSC command goes here;
}

This is going to be tied to section names. The first approach is better if you want to enable/disable mid-section or across multiple songs.


A couple of notes:

  • The Custom Script in MIDI mapping also gives you access to the incoming velocity, so you can layer extra conditions (e.g. only trigger Resolume if velocity > 100).
  • Make sure your launchpad’s MIDI port is selected as an input in AbleSet (Edit MIDI Mapping → port settings) so the notes actually reach the script.

Would that work for your use case?

Hi Augustin,

Thanks for your quick help! The idea with the flag is pretty cool, I think that would work.

However, I have already another script running that is listening for midi signals from my connected devices. There I have currentli the problem, that the individual devices trigger the script nearly at the same time, canceling each other out sometimes. So when I have your lines included in the script and trigger the launchpad, the script would notice that it is the correct channel, but at the same time there is a midi signal coming from the keys, restarting the script and canceling the osc message being sent.

As far as I know, it is not possible to have multiple scripts running.

Hey @FAster77,

Quick clarification on that point: multiple scripts can run in parallel in AbleSet. The constraint is per script: a single script can only run one instance at a time, but separate mappings each run independently.

So the cleanest approach would be to keep your existing script untouched and add a separate MIDI mapping (Custom Script action) just for the launchpad drum notes. That second script will run on its own thread and won’t interrupt or get interrupted by the first one.

The gating logic stays the same:

if (shared("drumsActive")) {
  // your Resolume OSC command goes here
}

Let me know how that goes!

Hi @agustinvolpe ,

how can i run 2 scripts? the + button is greyed out because i already have a script. Am I missing something?

Maybe it’s important to add: I run all my external controllers thru this panda midiBeam. So there are actually 4 instruments (2 keyboards, 1 launchpad, 1 DrumPad) coming thru, but each on a separate midi channel. So Panda Audio channel 1 would be Keys 1 and channel 2 would be keys 2 etc. As far as I see it, i can only have one script per connected device. And in this setup, all my controllers are registered as only one device, the Panda midi Beam.

damn I just realised I need to click the dots and then I can select another script haha. Well that’s awesome. This would also eliminate my other Problem I had. So I could have many small scripts instead of one large one. I’ll give it a try and report back to you.

ok now i have already hit a wall. It seems to only support 5 scripts. After the 5th, when i press the dots to add a new script, nothing is happening.

Hey @FAster77,

There’s no practical limit to the number of scripts you can map.

To add a new script, make sure your MIDI device is connected. Otherwise, you can always add a new mapping under “Any MIDI Input”.

If this still doesn’t work on your end, could you please share a short screen recording of the issue?

hey @agustinvolpe

It works now. Somehow Ableset lost connection? I’m working on one macbook, not over an ethernet connection or something. But when I closed the ableset window and tried opening it again, it showed the waiting animation, as if it was waiting for my ableton session to open. Closed it again and opened it and now every thing seems to work normal again, and i was able to add more scripts.

It seems like a bug, and i was able to replicate it. I tried adding many empty scripts in quick succession. After the 6th one it would not let me add another one and ableset seemed to freeze shortly.

Also my mapping now looks like this:

is there a way to name the scripts? Would be awesome to see which script does what instead of clicking though all and hoping to not forget one, as ableset always jumst back to the top after you click to close a script.

Hey @FAster77,

As of AbleSet 3.1.0 Beta 11, you can name your scripts. There’s a new “Script Name” field in MIDI mappings for exactly this.

Let me know how it goes!

you guys are so awesome!

I’ll wait for the full release, I have a show on the weekend and don’t want to risk it. but nice to know it’s coming.

And: I just wrote a test script with your description and the osc track, it works like a charm. Really cool. Thanks again for the quick support!

1 Like

Hey @FAster77,

Glad to hear that worked, and thanks for the kind words!

Let me know if anything else comes up :slightly_smiling_face:

Hey @agustinvolpe ,

I’m coming back to you after I had time to test the scripts. My problem still exists unforunately, even tho I have multiple scripts. The problem is, that all scripts are reacting to signal from the Panda-Audio midiBeam. Since all my controllers come trough there, every script gets triggered each time a not is hit. The scripts can’t know if the message is for them or not, since the if statements are part of the script. So having only one script or having many scripts does not change anything in my situation (apart from nice organisation). Is there a way around it?

Thanks in advance!

hey @agustinvolpe , friendly reminder about this message above. :slight_smile: Do you think there is a solution to this?

Hey @FAster77,

Thank you for your patience and for reporting back!

One thing worth clarifying: each MIDI mapping in AbleSet has its own trigger (Channel + Note/CC + Trigger type), and AbleSet only runs a script when an incoming message matches that mapping’s trigger. The if inside the script isn’t what filters by note, as the mapping itself should already do that, before the script runs.

So if every script is reacting to every note, it usually points to how the mappings are configured. For example, multiple scripts sharing the same channel/note, or a trigger that’s broader than expected.

To dig into this, two things would help:

  1. A screenshot of your MIDI mappings (Settings → MIDI Mapping, OSC & Scripting → Edit MIDI Mapping), so we can see the Channel and Note/CC assigned to each script.
  2. The output from a MIDI monitor while you hit a few pads/keys. This tells us exactly what channel and note each controller is actually sending through the midiBeam.

I’m looking forward to your reply!

Hey @agustinvolpe , thank you for your reply, i think this already helped a lot. I would always use the dots right to the + sign to add a script, which then runs everytime a signal is sent from said device. I did not realise, that i can choose a note or channel, and then afterwards select the script option from the drop down menu.

so right now it looks like this:

but it should look like this:

only one other problem remains: In this second option, i can select which channel and which note. But there does not seem to be an option to just select “any note” under the note tab. So i would ned to have one script for every note separate, when i want all notes of channel 1 to trigger the script?

thanks again!

Hey @FAster77,

In the per-note mapping there’s currently no “any note” option (unlike CC mappings, which do have an “any value” equivalent). So mapping all 127 notes individually isn’t the way to go.

The better fit for your case is actually the port-level script — the one you add via the three dots (⋯) next to “Add New Mapping”. That script runs on every incoming MIDI message from the device, and inside it you get access to the midi object, which tells you the channel, note, velocity, etc. of each message. So you can do all your filtering in code.

For a Note On event, the midi object looks like this:

{
  type: "note-on",
  channel: 1,
  note: 60,
  velocity: 100,
  raw: [144, 60, 100],
  input: "Panda-Audio midiBeam" //your device's exact name here
}

So a single port-level script can handle all of channel 1 like this:

// only reacts to notes on channel 1
if (midi.type === "note-on" && midi.channel === 1) {
  if (shared("drumsActive")) {
    // your Resolume OSC command goes here
  }
}

That should give you one script reacting to any note on channel 1, with no need to map each note separately. You can branch on midi.channel inside the same script to route your different controllers (keys 1, keys 2, launchpad, drumpad) however you like.

The “any note” option in the per-note dropdown is a nice idea though, I’ll pass it along as a feature request.

Would that work for your use case?

hey @agustinvolpe ,

your suggestion is the way I do it now. The problem is, that every controller triggers the script and restarts it this way, canceling the previous script.

the any note option would be the perfect solution for this. If @leolabs has capacity to implement it, that would be awesome.

Thank you very much.