How can I get information about the actual light status of MIDI controller?For example, I have 64 buttons some of them has green, yellow or red light and some are "off". I know all the MIDI codes four lights, but now I want to get all the picture of the pads. Is it possible to "get" or "unpack" actual MIDI controller status (that is the status of lights) or it is absolutely necessary to create some mediate state where all the information is stored before sending light feedback to MIDI out? And if. . . then how?
Information about MIDI pad light status
@Transcend Depends whether the Midi controller accepts requests for a midi dump.
If it does then it will be possible to unpack it if you can unravel sysex.
If you cannot interpret sysex in your version of Pd (I think [sysexin] was only ever available for Linux but I could be mistaken) then you should be able to save it as a file through a program like MidiOX, and then read it into Pd through a [text] object...... and then interpret it.
You might though be able to initiate the dump on the controller if it has no request midi dump function.
What is the Midi controller.... make model etc.?
OSC messaging might be easier if the controller does that.
Ou . . sounds complicated. I'm on Mac or Windows, but not Linux. The MIDI controller is AKAI APC mini.
@Transcend Ah...... it looks like it was designed especially for Ableton, and that Akai never wrote any kind of editor or a useful manual.
Does it have any built in memory? ...... I mean does it light up or do anything at all if Ableton is not running?
Have a look at Ableton's midi information (maybe you have done that already).
Get a copy of MidiOx if you don't have one........http://www.midiox.com/ ............. (it's free) and see if you can see the APC Mini, and if you can see it then what sort of data it is sending.
Does it look like what might be found in a data sheet for Ableton.
That will be a start.
The Ableton Midi data spec will tell you how to proceed I hope (if one exists).
Ableton's midi information
I don't think it does anything without Ableton. I found that lights are controlled by velocity messages. But this is only one way direction, sending not receiving information.
MIDIOx recognize APCmini, and shows Note On/Off messages
Here someone has made visual info
@Transcend Does it have memory? If you un-power it and then power it up again minutes later does it light up as you left it last time even when Ableton is not running? If it powers up with all lights off then you have no "state" to get.
If you zero everything on the apc (all lights off) before you start with your patch the same is true.
As it is available to MidiOX it should also show up in Pd. You might need something like loopMIDI for windows..... https://www.tobias-erichsen.de/software/loopmidi.html ..... if not.
@whale-av Ok, it's clear now. There is no memory, it always starts with all pads off. This is a really cheap controller
So there must be another option to store all the values in Array, Tab, list or. . [?] so I can recall them later. Have you any suggestions or maybe examples to look at or learn from?
@Transcend Well, that solves your problem.... Happy Days! Lucky it is so minimal (cheap). That makes for an easy solution.
Your next task is to check that Pd can see it on its Midi Input and Output...... and if not then find a solution.
Arrays in Pd are two dimensional. That is however a simple solution as the buttons are not grouped in rows. It looks like a new message will cancel the last as well...... send "green" then send "red blink" and green will be gone....... Deep Joy if that is true.
Another solution will be to use the [text] object to save the data in Pd. I will chew on what makes sense.
Do you want to create a copy of the APC in Pd visually?...... I imagine that you do.
This is a job for abstractions. One for each type of control, so 5 I think, + the mother patch containing them. It will be easy.
What do you want to do with the data that comes back when you push buttons and move faders...... have you built that bit already?
When buttons are pushed does it cycle through the colours on its own, or do the buttons not light up...... what I mean is...... does it only light buttons when it receives midi messages, or does it do it on its own (without Ableton)?
- It looks like a new message will cancel the last as well......
Yes, it is!
- Do you want to create a copy of the APC in Pd visually?
Visually in the text file would be nice, so I can easily check for errors. Virtual pads, buttons with colors are not necessary, cause in pd I want to create mainly functions
- What do you want to do with the data that comes back when you push buttons and move faders
Most important I don't want to use the faders because they are sh*tty (don't want to argue here). So I have made two parts: one was actually playing samples are visible and another were volume level of columns are visible and controllable (upper row pads rise volume, lower row decrease volume). It is necessary to update pads after switch from sample playing layout [?] to volume. It is easy to reset pads and get volume level, but I don't know how to get back. Some samples are blinking some are constant and some off.
- does it only light buttons when it receives midi messages
Yes, David, I'm pretty sure, the lights of the APCmini are totally silent unless midi-out messages are sent. I have never seen any lights if Ableton not present.
@Transcend Well, that's a good start. [but_rect] will not be useful probably for your patch, but it can easily be changed to do what you eventually want, and at least we know that the Midi messages are correct. I imagine that the button colour changes will eventually depend on the rest of your patch so as to be meaningful.
At the moment it sends and receives to every midi channel (I think) so beware if you connect other midi devices to Pd at the same time. A single midi channel will need to be nailed down if that is your intention.
This is how I want to play the files. I added a sampler (and comments) to your patch sampler.zip
And this is the Volume Control part (65 button means volume up 0 means volume down)
I imagine that the button color changes will eventually depend on the rest of your patch so as to be meaningful.
Yes, meaningful in terms of functionality, no aesthetically meaningful
Midi messages are correct
All the colors was correct, except your patch doesn't send 0 or "off"
@Transcend Just played around with it.
Each rectangular button should play a file with the same number.
For example Button 40 plays 40.wav etc.etc.
The button should turn green when pressed and the file is then played. It is not possible to play the file again until it is finished and the button is flashing.
I might not have understood, but anything is easy to change.
And the Master fader (56) should control the volume I hope.
Thanks, I will try to find a solution.