Toggle velocity for each midi note individually
Hi. For the controlling of the LEDs of my APCmini Midi Controller i need to toggle the velocity of each midi note individually between 0 and 1.
I got it working now with routepass but I think it can be done better with less nodes.
Can anyone help? Thanks!
If the notes you receive are the same you have to send, you can just use [> 0]:
Thanks LSKA. But i guess that is not working. As I incoming midi notes are going from 0 to 89. Incoming Velocity is always 127 (note on). But I need to send the same note number back to the controller with velocity 1 and 0 in alternation so the corresponding LED turns on / off.
for example i press one button
INCOMING: 37 127 -> OUTGOING 37 1
then i press the same button again
INCOMING: 37 127 -> OUTGOING 37 0
insert sel 127 and toggle between incoming and outgoing velocity.
this should work:
Thanks Source Audio.
This is my first day with MAX so you have to be easy on me.
But if I just put this between the incoming and outgoing velocity then the problem is that when I click another button the toggle switches already back. This will only work with one button, no?
for example
I press button 1 -> toggle sets it to 1 -> button 1 turns green (intended)
i press button 2 -> toggle sets it to 0 -> button 2 does not turn on (not intended - it should turn green))
i press button 1 -> toggle sets it to 1 -> button 1 stays green (not intended - it should turn off)
The toggle would have to store the value for each button individually
I might be wrong though...
(are you from source audio the company by the way? i got some of your products :) )
to recreate the [toggle] object but without a GUI you can use [counter 0 0 1]
yes, you might need one per button.
Thanks Roman. Yeah... definitely have to check out counter! And i found "listfunnel" which seem to be capable of a lot too...
if anyone has a good tutorial on that matter, it's most welcome.
I would like to re-use some sub-patches too.
In this kind of problems you have to keep a *state* in the patcher. You can do it using multiple toggle buttons (each of them remembers its state), you can keep those values (states) in array-like structure (and table is the best bet imho - see second Lska's solution), or you can use single integer number as a bit field (which is very efficient, but for a small number of values – for 64-bit apps you can keep up to 64 on/off states):
Seeing KLSDIZ's patch and its use of the matrixctrl object for visualization purposes, made me think about using it but for storing and reporting the actual values.
Wow! Thanks Guys. You are just amazing. So many helpful people and ideas!
And special sorry to LSKA. I overlooked your comment yesterday - was writing my own comment at that moment and so I didn't see yours.
I will check out all your suggestions today! Already fell in love with MAX on the first date. :)
You are right about inserting > 127 for each note separately.
I thought it was obvious.
There was a thread here some time ago, dealing with MPC Mini
and missing documentation, midi mappings etc
I don't have the patches anymore cause I don't have that unit,
but from memory :
Solid red or green buttons:
send button note number with velocity :
0 = off
1 = on
2 = blink
for red/green/yellow buttons :
0 = off
1 = green
2 = green blink
3 = red
4 = red blink
5 = yellow
6 = yellow blink
google a bit, I am sure one can find midi specs for all controls.
I think the reason for lack of published specs was some strange deal
with Ableton - trying to bound it to Live.
------------
I find it wrong to just light the Leds reacting to incoming midi
- one should rather reflect the function that it executes.
One example :
If button 1 should control recording of quantised loop :
blink red in pre record idle time, solid red while recording, blink yellow
in finish recording idle time, solid yellow when recording done and playing,
green when stoped, start / stop blink green in idle time.
When loop gets deleted - off.
You get what I mean.
--------
And I have no relation to Source Audio pedal making company,
I used that nickname long before it was founded.
"And I have no relation to Source Audio pedal making company, I used that nickname long before it was founded."
let me add that the same is true for users "floating point", "loadbang", "242" and "110".
we are the originals - everything else are cheap copies from hong kong.
(not sure about "broc" now. was he first or the vegetable?)
-110
ha, ha I am sure one could detect more originals
scrubbing through the forum archives