Implementing logic inside Drambo to read MIDI notes and send out CC strings
Hi all,
I know this can be done in either Mozaic or Streambyter - just wondering if it can be done entirely inside Drambo to minimise the dependency on other iOS tools.
I want to send MIDI notes from my Linnstrument to Drambo, then implement some logic inside Drambo so it can send a set of MIDI CC messages to my Linnstrument to set different light combinations. The bit I don't know about is whether the logic part can be implemented inside Drambo.
So for example, I might play a Cmaj chord on my Linnstrument, then I want Drambo to read those CEG notes, process them and send a whole string of MIDI CCs back to the Linnstrument to set the colors of various lights. It's not going to be a simple 1:1-type mapping between notes coming in and lights going out - there's going to be some quite complicated logic used, including tracking the state of the lights before the notes are received and working out which of those need to change after the notes are received.
The incoming MIDI notes will be pre-generated in something like Atom2, so they'll be "perfect" in terms of timing - I won't have to deal with odd corner cases like "if there's 50ms between successive notes, do they constitute part of this chord or the next one?" to deal with. Just listen for notes, look up which colors the lights are currently set to, then send MIDI CCs out to change the colors of those that need to change.
Is this doable entirely inside Drambo? If so, are there any pointers about how to go about it? - ideally a link to some project that's already done something vaguely like this, or even a list of the modules inside Drambo that I should start digging into.
Thanks in advance
Comments
Probably. The main question is if Drambo can receive and send all message types that you need.
From my first glance I see no reason why it shouldn't work!
A few hints to get you started:
Have a look at this thread.
It might assist.
https://forum.beepstreet.com/discussion/1652/apc-40-clip-pad-lighting#latest
Thanks @gravitas but that solution requires Streambyter. I'm trying to stick to only Drambo if at all possible
Thanks @rs2000 I'll start reading about those modules
@monch1962
It was more for the concept of lighting a midi controller rather than Streambyter itself.
I’ve been doing a similar sort of project that uses the pads on an LP X and
dRambo modules to change the LED colours on the LP X.
One of the things that came in handy for me was this
https://www.inspiredacoustics.com/en/MIDI_note_numbers_and_center_frequencies
and I used both CC messages and midi notes.
@monch1962 . I don't know why you want to avoid StreamByter for this. Remembering the current state of the leds will be difficult in Drambo, but easy in StreamByter. There are several SB projects related to managing a controller to enhance its capabilities. StreamByter is free, and you can include it as an AUv3 MIDI effect in stand-alone Drambo, or route it in AUM.
If you want to stay in Drambo, you can do arithmetic on the Note value (add 0.5, multiply by 96, quantize) to get a floating number corresponding to the MIDI note number, range 0..127. Unlike modular hardware, Drambo does not care how large the CV values are. This might be useful if you need to do arithmetic on the notes. Handling a chord may be tricky though, since Drambo assigns each note to a different voice.
Thanks @gravitas ah got it, thanks. Setting lights on the Linnstrument is really simple and well documented at https://github.com/rogerlinndesign/linnstrument-firmware/blob/master/midi.txt Essentially you set CC 20 to the pad column (0-24), CC21 to the pad row (0-7) and CC22 to a value corresponding to the color (described near the bottom of that link). If only everything was as easy...
@uncleDave there's a few reasons I'd like to remain completely inside Drambo:
I want to give this away to anyone who wants to use it. To maximise the number of people who might find it useful, I'd like it to run on both iOS and Mac from the same codebase. While the iOS version of StreamByter is free, the Mac version costs $A30 here in Australia. I work in the software industry and get that the Streambyter author has to feed him/herself, but that price could potentially be a blocker for someone else who might want to try out this tool on Mac in the future.
Drambo is rock solid and very light on CPU. I haven't tested it, but I suspect adding Streambyter (or Mozaic) to Drambo could make it less reliable and/or slower.
Drambo runs as both an AU host and client on iOS. As soon as I run Streambyter inside Drambo, I'm forced to use Drambo only as an AU host due to iOS' limitations. Happy to hear about any workarounds to this if they exist...
I also want something that's as easy as possible for someone else to install, and it's hard to get much simpler than a single Drambo module with no external dependencies. That said, I'm not completely averse to using something like Streambyter in Drambo if it's just too painful in Drambo alone, and right now that's looking to be the case.
"Drambo is rock solid and very light on CPU. I haven't tested it, but I suspect adding Streambyter (or Mozaic) to Drambo could make it less reliable and/or slower."
Nope, it doesn't make it less reliable.
Tried, tested, burnt in, washed out.
"I also want something that's as easy as possible for someone else to install, and it's hard to get much simpler than a single Drambo module with no external dependencies. That said, I'm not completely averse to using something like Streambyter in Drambo if it's just too painful in Drambo alone, and right now that's looking to be the case."
It is possible, it merely requires thinking about.
The basic premis that I'm getting is that with one note you need
to be able to send three CC's to the LinnInstrument?
X/Y position and colour?
The only caveat with using dRambo which was shown in the video I posted earlier
is that dRambo cannot read the state that the midi controller was in.
That normally requires sysex.
@monch1962
Try it!
Yes, it might take some time to get it working but in your case I think it's worth the effort to keep everything inside Drambo.
You'd have the benefit of having better realtime access and more options regarding modulations, configurations and parameters and if you get stuck somewhere, just post your specific question here and somebody might be able to help.
Good luck!
@monch1962
Here’s a starting point.
The Buttons module in this screenshot sends a simple on/off for all three CC’s.
there's going to be some quite complicated logic used, including tracking the state of the lights before the notes are received and working out which of those need to change after the notes are received.
This will be the most challenging part for sure. Tracking the state of the lights to me means holding all LED states in the Drambo patch to have a clean basis to start from.
One can afford a $1,500 LinnStrument and a Mac, yet would balk at spending $30 for Streambyter? A convoluted combination of modules and clever hacks to track light states, etc. is going to be more stable and efficient than a single, very light plugin such as Streambyter that is designed for this kind of thing?
I'm really struggling to follow the reasoning here. 🤷🏼♂️
(But, sounds like a fun intellectual challenge if you can get past that, I guess.)
@monch1962
Does the Linninstrument need feedback to switch the LED's on and off and change their colour?
Thanks to @gravitas @number37 @rs2000 @uncleDave for your help to date
I'm making progress (all inside Drambo...). This is where I'm at so far:
Remaining steps:
I've never tried to do any complex MIDI stuff inside Drambo before, and as a programmer I find it pretty brilliant. Sure it takes loads of different "library units" to do all the maths required, but it's all logical. I'm probably somewhere over 200 "library units" in the module so far, but it's lots of little logical blocks copy/pasted and quite understandable. A few module changes I'd like:
@monch1962
You've pretty much discovered what I discovered when mapping the pads of the LP X.
We need patience and a lot of the dRambo modules to get them performing the way we need to.
A couple of tips.
Use the Section module for collapsing and opening up the modules and the Text module for notes.
We can now input numerical values into the Buttons module which simplifies a lot of things
and we also have the new the Many 2 Poly module as a multi signal patchbay loom.
Agreed.
The Graphic Shaper has recently received an update that lets you divide the X grid into up to 64 divisions, letting you draw up to 64 bars with unquantized height. I would use it for building a color index.
By feeding it the value under adjustment and sending color messages frequently (only for adjustment), you could monitor the color live while adjusting a bar, without even messing with numbers.
+1 for MIDI monitor fixes like a wider module to show most messages without line breaks, scrolling and a clear function.