Send list of midi notes to controller

midi

#1

I want to send a list of midi noteOn to my controller on loading a patch from the patch bank. This way I can configure the LEDs on my Launch Control XL so that they correspond to the loaded axopatch. The best way to do this right now is a whole lot of controller objects (midi/out/note). and then sending a trigger out after loading the patch.

But as this is different for every patch 56 extra objects need to be placed in a patch. I was wondering if I could do this with a "script" object, where I just type the list of notes and hit "send"

-K


#2

Have a look at the launch control xl objects I posted here, could be useful. Any questions, let me know.


#3

They are useful, but I don't fully understand.

Although I cannot figure out how to get a "state" from a table and then change it with a trigger.
is it possible to edit the "embedded" code to store my data points?
I tried playing with it.. but no luck so far...

seems pretty close to what I need though


#4

What exactly do you want the lights to do?
Let me know and I'll see if I can work it out


#5

When I load a preset from a bank, I want the launchpad to color lights according to the controller mapping.
example:
this bank has 14 presets, whever I load a new patch using my controller, I want to update the LEDs on the controller totreflect this, like


so top left and the one next to it should be red so 1-1 and 1-2 (Row-Column)
1-3 and 1-4 yellow
2-3 and 2-4 yellow
3-3 and 3-4 yellow

etc

I know the sliders don't have LEDs but the rest does!
this way, using some consistency in the mapping, I know an orange LED will change the envelope, etc...

so procedure would be:
on patchload > send list of midi notes to controller. I want to easily adapt this list to match different presets and synths...
they are all different...
https://github.com/kaosbeat/axo-patches/blob/master/bank/page2.png


#6

Ah, I see what you mean...

The objects won't be much help - the matrix display object works in 'reading order'. So to light up the last four leds the same colour in a horizontal row you could set the length to 4, the start to 4, and use the colour off attribute to determine colour.

Or to light the first two rows of leds the same colour you'd set length to 16, start to 0...

But this won't work for a vertical row, it's just the way the objects work.

The table values only come into play when you want to have the lights change colour to reflect a setting being on, or whatever. It's binary - if the corresponding element of a table has no data it uses the off colour, if there is data present it uses the on colour.

I think it could be done, but I'm not sure how to adapt the objects to do what you want. I'm no coder, I just like fiddling... The code you highlighted in the pic above is the map of note numbers for the knob leds. The bit of code that actually sends the midi to the controller is in the k rate section, line beginning 'midisend' (I think, I'm not at the laptop).

If I ever think of a way to do it I'll let you know, would be useful for me too!


#7

Alright, I'll try fiddling myself meanwhile :wink:


#8

I got to thinking how it would be useful, and had some time to kill this morning...

I think I've sussed it, I made an object that sends up to 8 notes as 1 colour. So you use 1 object per colour and set it to the midi notes you're using.
And I made another object that clears all the leds (or light them all up 1 colour).

Here's a patch set up to light the leds like your picture above when the patch loads:

launch control xl lights.axp (26.0 KB)

Here's the objects:

light send lcxl.axo (4.2 KB)

all leds lcxl.axo (2.9 KB)

Hope it works!


#9

it works! thanks a lot, also fiddling with it I learned a lot :slight_smile:

I quickly made a table to have the overview so I can quickly type in the correct numbers


#10

it works, but I get a

"usb host midi output ringbuffer overflow"

so far this does not give me serious problems, but just saying it happens...
may I can try a delay in between each object sending midi....


#11

I might be able to sort that out, it was happening before but I thought i'd fixed it. I have an idea what it is, will have a look


#12

I must add than that I fiddled with the object to have it send 10 values at once...


#13

I had a look and I think it was happening because they were triggering too close together...

I've re done the objects with outputs that send a pulse when the object is done, so you can chain them together and they'll trigger one after the other. If you get the overflow message again you can put delayed pulse objects between them to space them out more. But it seems like it works fine chaining them directly.

launch control xl lights done.axp (25.6 KB)
light send lcxl done.axo (4.2 KB)
all leds lcxl done.axo (2.8 KB)


#14

Yeah also happened for a sequencer that I made, where I had to send data to a Launch Pad Midi to update the LED's. It seems to be a common issue when trying to send a bunch of data out of Axoloti.

I a doing the same with Pure data and sending a lot more data, at a lot faster rate with out any issues. So it is an Axo issue.


#15

what may help against the 'ring buffer overflow' is something like the the following code:

int doit = (!MidiGetOutputBufferPending(MIDI_DEVICE_USB_HOST));
if (doit) {...your code here...};

'MidiGetOutputBufferPending(MIDI_DEVICE_USB_HOST)' actually reports if
the output buffer of the attached midi-device is busy (or,not).

cheers,R


#16

Cheers Robert, that's really useful to know!

And thanks for all your objects, I use them a lot.

Matt