Routing Midi from Bitwig into a controller script

Post Reply New Topic
RELATED
PRODUCTS

Post

Hi folks,
I have just built my first controller script (for the Midi Fighter Twister, see here in this forum). This script offers different modes and now I would like to be able to switch the remote from within Bitwig. I see the use case of automating mode switches, just like automating switching between instruments in Bitwig.

For that I would need to be able to receive midi notes from Bitwig (and not the midi controller). I would think that I could set up a track with a Bitwig HW INSTRUMENT and route Midi to the controller. But how do I receive Midi messages in the controller script from this source?
Thanks for a short hint...
Martin

Post

I use the following to send data to the twister.

midiOutPort0 = host.getMidiOutPort(0)
midiOutPort0.sendMidi(int status, int data1, int data2)

Post

… thanks arsc… Yet, this is not exactly what I need. Let me put it in other words: I need to register a callback function that is called from Bitwig as a result of midi messages coming from Bitwig (but not from the controller). In this callback I will make some calls to the midiOutPort as you have mentioned, but I first need to get notified by Bitwig about the message. It‘s the direction that is important.

Post

markram71 wrote: Thu Dec 28, 2023 9:21 am … thanks arsc… Yet, this is not exactly what I need. Let me put it in other words: I need to register a callback function that is called from Bitwig as a result of midi messages coming from Bitwig (but not from the controller). In this callback I will make some calls to the midiOutPort as you have mentioned, but I first need to get notified by Bitwig about the message. It‘s the direction that is important.
Fold space and time and Use a midi loopback :)
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Kirkwood West wrote: Sat Dec 30, 2023 10:38 am Fold space and time and Use a midi loopback :)
Oh yeah, that might actually work, got it :) ...But there must be a better way (... while staying insight the controller script). :wink:

Post

You cannot intercept MIDI messages sent from Bitwig to a MIDI port. But there might be other solutions to what you want to achieve. E.g. you can monitor the start of a clip.

Post

… thanks, Moss, much appreciated.

FYI, I was thinking about the following use case: You want to remote control a midi controller from the DAW. For instance, think about a live performance, you a using the Push controller to start clips and mix your performance. Then, at a certain point in your performance you might want to play live drums on a certain track with the notes mode of the Push. This would be similar to what Anomalie is doing in his live performances when he let‘s the DAW switch the instruments for him.

I could imagine a similar thing in Bitwig: The controller script monitors the track names and finds one that has a special name or cue, something like „#MFT“ or „#Push-Actions“. Then you could create a few clips on this track (also in the arrange timeline?) with names like „#Switch to track 2“ or „#Change to mode 4“. These clips don‘t contain anything, they are just action command for your controller script.

Basically the overarching idea is to let the DAW control itself (or a controller) with actions that are placed on the timeline.

Post

markram71 wrote: Tue Jan 02, 2024 8:36 am … thanks, Moss, much appreciated.

FYI, I was thinking about the following use case: You want to remote control a midi controller from the DAW. For instance, think about a live performance, you a using the Push controller to start clips and mix your performance. Then, at a certain point in your performance you might want to play live drums on a certain track with the notes mode of the Push. This would be similar to what Anomalie is doing in his live performances when he let‘s the DAW switch the instruments for him.

I could imagine a similar thing in Bitwig: The controller script monitors the track names and finds one that has a special name or cue, something like „#MFT“ or „#Push-Actions“. Then you could create a few clips on this track (also in the arrange timeline?) with names like „#Switch to track 2“ or „#Change to mode 4“. These clips don‘t contain anything, they are just action command for your controller script.

Basically the overarching idea is to let the DAW control itself (or a controller) with actions that are placed on the timeline.
Interesting.

Changing sounds is the easy part: you can still use the old Ableton trick to use automation to switch the selected layer of an instrument selector.

Switching modes is the tricky part. Monitoring clip names is a bit tricky and does currently only work in the clip launcher. I am afraid I have no real idea for an easy solution.

The more complicated one would be the following:
- create a track for the drum layout sounds. Select the drum layout for it.
- create a track for the play layout sounds. Select the play layout for it.
- install a virtual MIDI port driver
- send specific notes to a virtual MIDI port
- register a Generic Flexi instance which listens to this port
- create a mapping to select these 2 tracks with specific MIDI notes

Post

edit: woops , wrong forum
I built a Looper for Bitwig! :) https://www.youtube.com/watch?v=-z5ywDo2bU0

Post

Hey Moss, thanks again for your thoughts. You helped to save me a lot of time. I might put this idea off until somebody would really need it... Thanks again, since I just developed a Java extension for the Midi Fighter Twister with quite some features (similar to your FaderFox EC4 srcipt) and I could not have done it without your great coding videos.

May I ask you another question: Since the Midi Fighter Twister (MFT) does not have any screen (like the Faderfox has), I thought about a (hopefully) little extension to the script: How about using additionally OSC to allow something like an IPad with TouchOSC to sit just behind the MFT and display the current status (and maybe add some action buttons, as well). What do you think about this? Would it make sense for me to look into your OSC implementation??? I would not need a full blown remote control (I am using your Push 2 skript for that), just something that reminds me of what I could control...

Thanks and cheers from Berlin
Martin

Post

markram71 wrote: Tue Jan 02, 2024 8:39 pm Hey Moss, thanks again for your thoughts. You helped to save me a lot of time. I might put this idea off until somebody would really need it... Thanks again, since I just developed a Java extension for the Midi Fighter Twister with quite some features (similar to your FaderFox EC4 srcipt) and I could not have done it without your great coding videos.

May I ask you another question: Since the Midi Fighter Twister (MFT) does not have any screen (like the Faderfox has), I thought about a (hopefully) little extension to the script: How about using additionally OSC to allow something like an IPad with TouchOSC to sit just behind the MFT and display the current status (and maybe add some action buttons, as well). What do you think about this? Would it make sense for me to look into your OSC implementation??? I would not need a full blown remote control (I am using your Push 2 skript for that), just something that reminds me of what I could control...

Thanks and cheers from Berlin
Martin
Sure, give it a go.

Post

Hi @Moss, 
I finally got it done. The Midi Fighter Twister has now a companion, an Ipad which runs TouchOSC (btw, it improved quite a bit over the last monts/years). The OSC surface shows the function of each knob, it shows the mode of the script on the left and also the state of the fader. While the last is rather a nice to have (since the Twister already has LEDs to show the status) the functionality of each knob was missing for me.  

Image

The script is available here


Cheers
Martin 



 

Post Reply

Return to “Controller Scripting”