Hi Steve,
Thanks again.
I didn’t want to get into much detail, because I thought it would muddy the waters, but I see that you need more information.
Here goes… some of this is obvious, I’m sure, but some is not, so I’ll go ahead with a plodding description of my system and my needs.
Inputs come from six APC Mini’s. We need only to deal with one Mini to explain the system.
— The Mini has 64 oblong buttons arranged in an 8×8 matrix. These send
the Midi “Note On” messages to MT (Note numbers 0 through 63).
— Each of these messages launch a clip (sample) in Ableton Live.
— Each button can light up
— Additionally, there is a row of 8 round buttons below the 8th row and
a column of round buttons to the right of the 8th column.
— These can also light up.
— There are also 9 faders arranged in a horizontal row below the buttons.
I’ll leave it at that, though there are some irrelevant details about the button functionality as well as some faders.
Now for the functionality I’m after in Ableton Live.
— Live is also arranged in rows and columns, where each “cell” in the
matrix represents a clip (sample) that can be played.
— In Live, only 1 clip in a column can be playing at the same time.
— In essence, this means that if a clip is playing and another button is
pressed in the same column , The first clip stops and the second clip
starts.
—This functionality is part of Live, not something I do in MT.
— If a clip is launched by pressing a button in the controller, Live sends a
midi message back to the Mini, which is used to light the button that
launched the clip.
So much for how the APC and Live interact.
— MT lies between the APC and Live, so:
— MT receives messages from the Mini, manipulates them, and
sends the results to Live.
— MT also receives messages from Live, does manipulations and sends
the results to Live.
Since the buttons light up to convey whether a clip is playing or not, one might think I would have no problem in knowing which clip is playing, but I use the lights to convey other information, so I throw away this data from Live, and light the buttons to display whether any effects have been applied to any sample in a column.
I still want to know which clips are playing, so I use the round buttons by lighting up the one below the column in which a clip is playing, as well as the round button to the right of the row of that clip.
Note that there are 24 clips in each of Live’s columns. Each column is called a Track.
Since I only have 8 buttons in a column in the Mini, I use 3 columns of 8 buttons to represent the 24 clips in an Live track.
Now for my problem:
— When I press a button to launch a clip in Live, I want to light one of the
round buttons.
— Since a Track contains 24 clips, the clip that’s playing could be in any one
if the three columns representing the Track (in the Mini).
— Since only one clip can be playing in a track, if a clip is playing in one of
the three columns, and a clip is then launched in one of the other two
columns, the first round button should no longer be lit up, and the round
button under the new clip should be lit.
That can be achieved easily in MT, but there’s another functionality.
—One of the three faders under a track controls the amplitude of the clip
that’s playing.
— When this fader value is zero, the clip that’s playing in the column is
turned off (no longer playing).
— When the fader value is greater than 0, the clip starts playing again.
— This means that the LED in the round button for this clip will be turned off
when the fader goes to 0, and the same round button will light up again when the fader goes above 0.
— Keeping track of the vertical round buttons corresponding to the row in
which a clip is playing is no problem, so I don’t need help with that.
I could keep track of the identity of the round buttons which need to be lit or
not lit pretty easily if I had enough global variables to remember which of the three round buttons in a track are lit up, but I’ve used almost all the globals (ga, through z9), and simply don’t have enough to keep track of the lights in all 6 of my Mini’s. This would require 16 globals. I will need some of these for other purposes, so I decided to utilize a two 30 bit words (each word handles 3 Mini’s. So, to keep things simple:
— Each grouping of 3 bits represents the three columns in a track.
— Binary 1 is used to represent a button that’s lit. Binary 0 means it’s not lit.
— Only one of the three buttons can be lit at any one time since only one of
the 24 samples in a track can be playing at one time.
— If I change one of the bits representing a track (three columns) this action cannot affect any of the other 27 bits in the 30 bit word. This is because
the state of the other buttons (lit or not lit) remains the same. One track
has no interaction with any other track.
I think that explains my predicament pretty well. Maybe this accounting is overweening and confused. I hope not.
Thanks,
Gabriel