Midi (notes) to colour objects
Hi there.
I am looking for a way to colour shapes (grid shape like sphere, torus etc) by incoming midi signal.....
Every note I play on my piano (midi) should paint the objects in different colours....
Thanks in advance for help.
Tim
This is most likely a very basic task, yet too vaguely described in your post. What did you tried already? Where are you stuck at, precisely?
For this kind of request you should provide an example patch, as there is many ways to interpret your request, and at least as many possible solutions.
if it is only notes (pitches), make a coll with note numbers as index,
destination object to target and string of wished colours .
example :
48, 1 255 0 0;
note 48 paints object 1 red (using RGB)
Hi Everyone and thanks for responses......yes I should make myself more clear:
I have a hardware keyboard...61 keys....
What I want to achieve: each single key should correspond to a colour (RGB). I like to use the objects from jit.gl.mesh - e.g. the torus, sphere etc should change their colours when I press keys on my midi-keyboard......
The video shows what I want......however I did it with an incoming audio signal rather than midi in.....
the effect is ok but I want more........saturation.....choose colours myself independently for each key.....
Thanks in advance...have a nice day....
Tim
you have a number of notes and velocities too.
What prevents you to assign note-velocity to trigger something ?
Or even group notes like chords to trigger something else ?
Is there a mod wheel, aftertouch etc on that keyboard ?
All possible sources to trigger or modulate something.
[midiparse], maybe ?
I read abt midiparse. This I guess is something I need in my patch….I will check. However I am a novice and not sure how to set up properly.
/ [midiselect] ?
You may have a look at corresponding help pages in MAX : from what I understand, they should provide appropriate answers to your "questions".
It will be easy to assign note number, but single velocity 0 - 127 not easy to hit.
maybe you need to split usable range... to use it as trigger.
but if you for example use note 44 to trigger red colour but velocity 0-127 sets intensity in some % percentage...
in any case you will have to use some scaling or similar.
I don't care much about that visual stuff, here is simple example
to set the swatch, using notes 36 & 37 to start with.
If you need further help just post what midi message(s) you want to convert into what value.
Looks good...I see the 2 values for pitch and vel. in the message box coming from my keyboard....
however...no change for the colors now....the swatch remains unchanged....
what do I miss ?
maybe that only notes 36 & 37 are routed
here is more developed example, you can add note numbers and corresponding colors into coll.
ooohhhhh....I see.....this is exactly it ! Insane.....
thank you so much....unfortunately no time now...will explore deeply and hopefully can show my result later tonight.....
AGAIN: Thanks. Can I buy you a beer or coffee ?
Cheers. Tim
You are welcome, and I will drink a beer at your virtual
expense.
Just enjoy your work, as soon as you get more
familiar with midi, other options like poly keypressure
(if your keyboard can send them), or aftertouch etc
will give you much more expression....
I had a beer on your health on my real expense. Cheers.
I checked your patch in detail and following questions raised:
$1 = Key value 36, 37 38 etc
$2 = velocity
$3 = ????
$4 = Saturation
which midi parameters do effect $3 / $4 ??
what is the number 144 used for in the first message box: 144 $1,$2. ??
Here a small demo from what I achieved.....
I also had a beer, it does well indeed.
That example I posted was just an example,
let's sort this out a bit :
the message into swatch is composed of 3 color values
$1 $2 $3 and $4 saturation.
3 color values are linked to note numbers in coll:

when existing note in coll gets received, it outputs list with 3 colors,
and joins it with velocitiy value.
message part $1 $2 $3 sets swatch colors.
, (comma) in a message breaks it into itered parts,
in this example sets saturation.
$1 $2 $3, saturation $4
so this line gets sent as 2 messages.
........
In max timing of received and sent messages is dependent
on few factors, to decompose a list, modify it and then
join together for exampe. or to collect values from different
source and force correct order when combining them into usable
messages and functions is imprtant.
.........
Let's put another example:
you link note numbers with fixed 2 of 3 color values,
use velocity to scale 3rd color in some range
and set saturation using modwheel.
now that saturation has nothing to do with notes,
you route CC#1 directly to scaler and message
saturation $1
here wheel value 0 -127 gets scaled to saturation 0.4 ~ 1.

.........
notes in coll would look like this:

one or more color values get replaced by $1 (changeable argument)
when coll outputs the list, velocity input sets $1 value(s).
you can also set all 3 to $1, or to fixed values,
which would then ignore velocity.
But now we have a timing problem to solve :
when midi note-velocity list gets unpacked, order of output is right to left
which is standard for most max objects.
means velocity outputs before note number,
but we need it AFTER, because note number has to recall
coll index first, in order for velocity to pass through it.
There are several ways to deal with this,
I'll use the simplest.
it is important to send saturtion value after color change for swatch.
It is maybe not necessary for objects that you use...
..............
midi gets sent as raw bytes, starts with status byte
which tells which kind of midi message on which midi channel.
following bytes depend on message kind,
like for note pitch and velocity,
for aftertouch just value,
for midi controller it is controller number and value etc.
144,$1,$2 is creating this raw message for midiparse,
same as now 176,1, $1 (CC#1 on midi channel 1)
I put this only for testing without real midi input ...
.................
at the end, this are simple examples, one can do much more
using automation, oscillators, ramps ... whatever
You deserve a PhD on your knowledge about all that....and if I continue I am on my way to get one soon.
1st part...understood (I guess)..
One thing I struggle: The Hammond organ features a multi-contact keyboard and shows no relation between the velocity of the key-stroke and the loudness of the produced sound.
i.e. from where is the velocity taken in your first example ? I see the values are changing all the time when I press keys...best would be to set a fixed value or control via some modulationwheel or expression pedal.
--
I'll check your pact soon....
if your Hammond is :

then it sends velocity, unless you disabled it somewhere ...
or you mimic original hammond organ which had no velocity
and only way to control level was volume pedal.
midiparse note outlet outputs list of
pitch - velocity,
note On velocity 1-127, note Off = velocity 0.
If you want to disable velocity as part of color manipulation,
then simply ignore it, and use only note numbers.
which make my 2nd example useless, or better say , one can
simplify it a lot.
here is modified 1st patch, no velocity used.
notes only change 3 set colors.
......
I added note-color assigner for coll, to make
it a bit easier to fill.
When you save the patch, coll items get embedded.
correct. that's the model.
The manual says: "“Off” is standard organ touch - the notes play at a fixed velocity (“100”) regardless of a light or heavy key pressure."
However I believe it's just for the digital simulation of the clone wheel but channel messages like note on/off (note number) and velocity is transmitted regardless. You are absolut right.
I wanted to make my expression pedal control the velocity...and ignore the messages sent from the keyboard...but it seems I I am too. stupid.....it's on CC11 but it's not working with your patch..the modulation wheel on cc1 works perfectly....
in my midi monitor I can see that my expression pedal uses cc11.......
The store function for colours assigned to individual notes makes life much more convenient...luxurious.
--
did you add 11 to route object ?

aha......no I didn't.
my poor knowledge....... :-(
however I found some turnaround shown in the tutorial of midi parsing...(see my adapted patch which is based on trial and error).
I am pretty happy with the result it is a start but more work to be done....it does what it should do....but something is missing..not sure what.....need to think about it..
Maybe it would be funny to have the torus object start turning when the Leslie speaker effect is turned on....the torus could start slowly turning and pick up speed like the Leslie horns......any idea ? :-)))
your CC parser passes ALL controllers.
better use what I posted instead...
I still think velocity is most intuitive way to control some
parameters, using note off or not.
to make effects smooher, you could slide from list to list,
or blackout etc ....
ok. I will change accordingly.
yes....it would be very cool to change the effect between note on and off.
e.g. on note off the colour always turns to black and note on it will be coloured.
that was so in my first patches, before you disqualified velocity.
Can you post simple request what shoud be controlled
by what midi source ?
my ex patch 2 had velocity assigned to any color set with $1.
On key relese (velocity 0) that coor was set to 0.
One could for example use note On velociy 1 -127 to set the color(s)
but note Off (velocity 0) to blackout.
P.S.
does your hammond ouput aftertouch or poly pressure ?
Yes…😳🫣. Right
I need to find out myself what midi controls what. For sure note on is colour, note off is black/white/grey, expression pedal is saturation and I guess Leslie fast/slow let the object spin/turn from slow to fast and back to slow 😱🤯🤪🤩
I will fix it accordingly 🫡 as per patch ver 1/2
Found nothing on poly pressure but
Since the upper manual is channel one and lower on channel 2 I have still more possibilities since right hand plays melody on upper while left hand bass on lower manual





midi chart tells that it does not send aftertouch or polypressure.
Would you want to target multiple objects or only 1 ?
You have not only option to split the manuals,
but also each note could target specific destination.
For example:
48, 1 0.8 0.2 $1;
note 48 sends colors to Object with ID 1
0.8 0.2 and velocity dependent 3rd value on Note On,
turns it black (0 0 0) on Note Off.
...........
one could also split pitch range, 1 Oct per 1 target or 2 Octaves ?
More of a questin is how to deal with expression CC
when mutiple objects get targeted.
Maybe in a simpe way - it controlls all targets ...
The best part is: while checking all this midi parameters I noticed a strange behavior on the lower manual of my organ: the CC note value/velocity of lowest C and C# (36,37) is not transmitted and the sound is somehow cutoff…..:-( all other keys work fine. As soon as I unplug the USB cable for midi transfer…sound is ok …but no midi messages….
Fortunately still warranty…..filed a complained with hammond…I guess they will pick it up or send some updates for mainboard….mysterious bug
Simple way…..control all targets……that‘s best !!!
I‘ll let u know about my progress as soon as time allows…..thanks for so much help and patience. Buy some more beers on my virtual account please.
Wait a bit with declaring Hammond broken.
Maybe you have some midi loopback that cuts the notes Off ?
suspect to me that it is notes 36 & 37 that I used in 1st patch.
Quit ALL software that can route midi, plug USB cable and test if the keyboard works ok.
If it does, then I'd test midi input in max, but stay away from any midi monitor paches and similar.
yes...it seems not the patch but Ableton DAW. I removed my Max Midi plugin and it remained same problem. After quitting Ableton everything returned normal.
not sure...what this tells me
this tells you that maybe in Live you have
some sort of midi loop going back to hammond.
is problem still there if you remove all midi tracks in live ?
and free hammond from any mappings and whatever else might be interracting with it.
I am sure your familiar with automatisation.
I was looking for a message/object that modulates the rotation speed of my torus over a period of time.
At this point I managed to start the rotation of the torus by controlling it from my Leslie Footswitch (on/off) ....so it starts /stops, mod wheel for speed. It would be cool if the speeding up can be automated so I have both hands free for playing
yes it's somewhere in life.....I made a fresh set with a single audio and midi track. all works as expected.....bugless.
No problem. Solved.
I am more concerned about other stuff...
can you tell it in plain midi words ?
you want leslie sw, midi CC# 6 right?
to start rotation, and at same time speed up from value 1 to value 2 over which time ?
then when leslie sw turns off it slows rotation down and stops after time ?
just post wished speeds, time and what leslie switch sends exactly
when on or off.
I am soon off to beer ...
here is maybe working leslie automation, to keep you bussy till tomorrow
lovely...works like a charm...I'll send you the demo video later on....
I am off to cooking.......cheers. No more beer....need to buy.

Quick recording I wonder how’s the market for selling this stuff
🤣💥🙏🙏🙏🤩🤩
looks great, maybe add sliding between color lists to smooth changes a bit ?
yes....really cool. I love it.
You deserve applause, you developed it. you are the product owner.
There are many things to add/change.....sliding between colour to smooth changes ? Yes, please !
My problem: for me all heavy stuff.....my lack of knowledge in max.
e.g. the values in the scale field (500 2000) what unit are those ?...can I convert this somehow in seconds ? I'd love to use the exact same parameters Hammond uses: fast / slow speed (rpm) and rise/fall time in sec.....(as per photo posted y'day)
any idea ?
I also see potential in having the keyboard split into 2 manuals (upper=ch1/lower=ch2). I did find that the last output of Midiparse is for the channel...but again lack of knowledge.....
I want to have the upper manual for a set of 61 colours and the lower for another set of 61 colours....
that should be very easy...but not for me :-(
Otherwise I thought the drawbars (9 per manual + 2 pedal ) should be useful to control something.....not sure what...scale, position, texture.....
I read abt borax which reports note on/off information….can this possibly be helpful in any way ? Chords or arpeggios, trillers or quick repetition of notes
It is easy to route your 2 manuals and pedal to different controls.
I have no idea if drawbars send any midi infos ???
I will set speed as you posted for leslie, you want Horn values, or ?
rise time 2.2 sec / speed 420
fall time 4 sec / slow speed 40
4 sec after slow speed gets reached STOP rotation ?
Is that exactly what you want ?
It became a bit complex, because one has to calculate acceleration time
not only from min/max speeds,
but also anywhere in between if one switches direction before min/max got reached.
..........................
This here was just an idea to control leslie accerelation time using modwheel,
but now that is obsolete.

.........
I want to know what do you want with note velocities ?
Control something, like in 2nd patch I posted or not ?
I need final decision, otherwise I just loose time.
That will affect addition of 2nd manual and pedal.
That leads to another question - do you want each of them to have own coll ?
and do they control same object ?
If you want (as you stated allready) that note off turns object black,
then we need to count all held notes and only when no note is sounding,
turn object black.
......
This becomes complex, and you need to make some decisions ...
Another thing - don't add stuff to the patch if you don't know what exactly you are doing.
you added this here

and feed it parallel with coll output into gl_color values ?
puuuhhhh. I am getting in trouble now.
Still I'd love to do the work myself and I read a lot of references and looked at the examples...but still everything is only black and white like the keys on my hammond which do nice colours now :-)
--
routing 2 manuals:
I am sure this is easy but I do not find where the Channel is set...In midi parse it should be output 7. can I use this and have to outputs - one for CH1 and CH2 ? That's my logical understanding.
--
Drawbar events are sent Upper: 12-20 / Lower 21-29 / Pedal 33, 35
- I did not decide yet, how to use them and what they might control (maybe postpone for now but I keep it optional) . Maybe control some parameters of a visual fractal....I'll send a demo on that later..
--
Leslie Rise/Fall/Speed
yes. just the values for the Horn should be fine. (that's what is most dominant in the sound)
It became a bit complex, because one has to calculate acceleration time
not only from min/max speeds,
but also anywhere in between if one switches direction before min/max got reached.
Yes...really...a bit complex. Usually I do not with the direction before it reaches min/max....but I am newbie on the hammond as well....maybe it's something professionals do....very likely I guess.
When I tested the device yesterday my feel was pretty much ok with the timings I set just by experimenting. How are the values calculated ?
--
I do not know what I want to do with the velocity values....as per my understanding organs do not have velocity sensitive keys. It's note on or off. One exception is the Percussion effect of the upper manual, which can be more or less velocity sensitive. Real organs have what is called a 'swell' pedal, which is basically a volume pedal. That's the Expression CC11. Good organists will ride this and color their phrases subtly with changes of the volume this way. Use subtle automation to achieve the same thing and you'll be good to go!
At this moment the expression pedal controls overall volume/overdrive on the hammond and colour saturation on the patch. - not spectacular...
o course I. want to use them...I see that values are received.....any suggestions from your side ?
That leads to another question - do you want each of them to have own coll ?
and do they control same object ?
I think each manual controls one object ? Is there another possibility ?
They could use the same Coll or have their own...I'd prefer to have 1 Coll for each.
Note off = black object: no worries - we can skip if too complicated....I need to find out myself (for better learning curve :-) )
--
adding stuff I don't know.
yes. I am sorry. I just needed a bigger colour panel to see the result of my actions...the other swatch is too small.....I found this "stuff" in one off max examples patches and I borrowed it.
The "parallel " feed is a mistake....should not be...it happened because I wanted to keep both options as they do different things. This one I like for testing because the colours are with fixed saturation.
However I prefer your way for future, because it will be great to colour specific keys in certain colours....depending on what you play...classical, rock, jazz
That should help me with setting up the midi ch2 for lower manual
Midiselect.
there are ways and ways to route midi channels.
and best pick depends on the situation.
in you case , you have 3 channels for notes, but all controllers
are on channel 1. is that so ?

here midi channel outlet of midiparse switches gate for notes outlet
to 3 destinations (gate outlets)
other midiparse outlets, like CC, PB etc are routed disregarding midi channel.
if you need to channelise more than notes,
there are also other options, like midiselect
This example routes only all notes and CC numbers on set midi channel

in other cases one can use notein, ctlin etc objects too.
****** leslie ******
**** I still need confirmation on my control proposal ****
Midi Implementation shows CC# 98 for leslie fast, you posted CC#6,
can you post EXACTLY what leslie switch sends for:
1 start fast
2 start slow
3 stop
or is the logic different ?
.........
patch I'm posting today has only 1 switch :
On = go to speed 420 over 2.2 sec ( if started from 40)
if started from higher speed, calculation is remaining steps * time per step.
in case of fast speed 420 - 40 = 380 steps, 2200 ms/380 = 5.789 ms = time per step
Off = go to speed 40 over 4 sec, or calc as 4000/380 = 10.52 ms/step
after low speed 40 is reached and not interrupted by leslie swith,
turn leslie OFF after 4 sec.
.........
3 manuals are sent to 3 different colls.
if no note is sounding, object turns black.
last pressed note in a chord sets color.
color lists slide using 0 - 500ms adjustable time.
saturation is common - CC#11
I removed swatch from color path to gl_color message
for good reason, please keep it so !
......
new patch routes 3 midi channel notes to 3 color colls editor.
3 colls have new names, you can copy 1st coll data from older patch, if you allready added many colors.
maybe one should now store colls as files too ?
and recall different setups.
next time ...
:-)))))))
YES - all CC on CH1, upper manual CH1
lower manual CH2
****** leslie ******
I know what the midi implementation says....but I see what works here on my machine...and that's cc6
anything I am missing. Below values are received when pressing "fast"

let me studie everything in detail and come back...this looks like almost the ideal patch.....
I am blown away.
How long did it take to do this ? I hope your price/hour will fit my virtual budget
Page 35 of user manual explains somewhat complicated handling of 3 leslie states
stop, slow, fast.
Now how to deal with that :
if you want that visual rotation follows leslie speed, than we need that 3 states.
And it seems that it is composed of 3 CC# messages.
You need to capture midi for that 3 states.
Then we can react on it.
Are you using CU-1 footswitch ?
By the way - it did not take me much time to help you with this,
in first pace when you post exactly what you want.
That it seems so complicated for you is understandable,
because if you don't know much about functions of so numerous max objects,
it is really difficult to search for one which can solve the problem...
:-) Yes - CU-1 Footswich
Slow:

Stop

Fast

........
I had to change this and cut the patch cord:

not sure what is the problem...... but it did not let the CC6 message pass through and object did not start rotating
.....
Keyboard Sounding Point and Visual "showing" point is uneven: when I press a key....I do hear the sound before the visual appears (when keyboard set to "shallow".....this is what an original B3 would feel like;
the deep sounding point is equal to visual.....) I guess I have to live with that...will send a video on this tmmrw.

I am glad you didn't waste too much time and excuse that I am pretty lost here....and I am curious from where you got the massive knowledge on max.....is it your profession ?
After this you'll earn a master degree in Hammond Technology....
for me definitely a steep learning curve in max....but still more questions than answers.
I'll send a demo video tmrw.
In old days in my band we had C3 with original leslie cabinet, rhodes 88 suitcase etc
in comparison to keyboarder, I only had marshall head with 2 x 12 and fender twin
but the sound of the damn hammond was worth the pain of carrying it arround.
If you don't change anything to leslie switches,
one can sum CC#6 & CC#98 to get:
1 = slow, 2 = stop , 3 = slow
deep or shallow --- you can't do anything to midi latency.
This simulation stuff exaggerates a bit in my opinion,
like when amp simulator includes that damn transformer hum, noises etc.
One would have been much more happy if it never existed, same as mechanical
problems of early keyboards.
here is the patch with updated leslie, stop makes motors turn off after slowing down to speed 0
in 4 seconds time, no matter what current speed was.
old days.......I understand now.
You know this instrument very well. I was already wondering if you are a Hammond/Leslie technician ;-)
I used to play piano in "young days" but found a passion for Hammond...and finally got it last year.
Amazing instrument.
deep / shallow - In the test video I use "shallow" in the first part, later switched to "deep" (2:38 min).
Deep works of course better, as it responds immediately......shallow has much latency....feels like 1/2 sec
I agree@exaggeration of simulation stuff. It's market you can make money. Ask Tom Scholz (Boston) what he thinks.......he doesn't even touch digital.
I am fine with our visual simulation....this is perfect or even better. No need to do anything further...couldn't be happier.
If I understand correctly it won't be possible to colour chords - correct ?
I'll check you latest patch.
If I understand correctly it won't be possible to colour chords - correct ?
What would you mean by "colour chords"? A few examples:
1 chord = 1 new color for the donut (not already used by individual notes)
1 chord = color something else than the donut
1 chord = colorize the donut with as many colors as there is notes in the chord, using stripes, gradients, or any pattern really (if so, you would like to create/modify a texture to apply to the donut)
1 chord = color the donut regarding a mix of the colors representing each played note. Which opens a new hole: how to mix colors? as a mean of their R/G/B components? Or H/S/L? Or other values from other color spaces?
All of this being possible of course.
you can also have a sort of chord detector to rgb
😱🫥🤔
Yes. All these options sounds great.
However firsthand I want to study your patch-work in detail to understand better how to do. And - as per your previous post set up ch2 lower manual. The donut 🍩 is ok for testing purposes otherwise I prefer eating them.
very simple: I'm too stupid.
In your patch I made a second donut which I wanted to play from lower manual. That worked perfect.
I did the same in Ableton patch but .....the Gate Output 2 remains closed.....
Live is a bullshit, it is not your fault.
problem is midi channels.
Live does not let you receive multiple midi channels in a track.
You must use imp.midi externals for that.
What system are you using, win , mac, M1 mac ?
Mac Intel I9.......same bullshit.
Which DAW are you on ?
David !
imp.midi - I replaced it with midiin....but where the SKX Pro Should show up....it's just grey...
nothing is coming thru...no CH 1-16....
Maybe better to drink some beers

you listed midi outputs, not inputs
bang left inlet, or message controllers
:-(
I banged my head against the wall.
Correct ? I can't list anything else...

time to say goodbye Ableton.
Ridiculous. I don't see the purpose bundle internally all to a single channel
It is possible not midi but instrument device - not sure if this means any disadvantages for the project
have a close look here:

you need to connect middle umenu outlet to imp.midiin.
ok, but Leslie simulation reacts strange......it starts but runs somehow slow pace and won't accept further messages from the controller.....won't stop
2 🍩 🫨😵💫
is that so in max or in live ?
P.S. you should use only 1 leslie patch and send it to both
jit.anim.drive instances.
if you want them to turn differently, you could manipulate
output to one of them.
In live. In editing mode it is fine
Maybe Live is simply not ok to use jit stuff ?
I can't say, never used Live and never will....
I found some interesting way around....I just added the normal midiin object and only let the CC for for foot switch pass. (I doubt this is the correct way)
Today's video is funny. I mixed few things I took from example patches here and there....lot's of bugs since I don't know how to do the patching correctly....still lack of knowledge.
Would love to know what you think abt. this.... I'd love to control the fractal parameters from the organ.....do something interesting with it.....still too many donuts....
I wonder if it is possible to make my donuts also receive light points (like geometry in the fractals does)...while it can change its colour because of playing/midi...(excuse my bad english)
it is the Disco example from GL3 Launch....
Maybe you have conflich with imp.midi and normal live midi track inputs.
Can you make it into audio device, and so have no live midi input at all ?
I managed to have both with light points and they do change the colour from my midi ch1.
However....everything changes the colour. It would be great if this would only apply to the right "cube"
and than I want to have the left cube show colours
Yes.....cube...not donut ! :-))
The reference says that jit.gl.camera overrides OB3D attributes of objects in the context it is drawing to.
If I understood correctly it is possible to send my CH1 / CH2 mat_diffuse to different shapes....but I did not understand "how to"...is it attribute: .drawto ?
I am sorry, but I am a wrong person to ask about jitter stuff.
Never had any interest in that visual stuff.
Maybe you could start different thread dealing with your
jitter questions.
I'll be glad to help you with routing or manipuating midi input,
or other non-jitter stuff.
Managed to solve all my problems, questions.
Now I understand "little" more about midi, jitter and how this works with live.
I want to thank you once more for all your help without I wouldn't have been able to finalise my target.
I think from here I can go further - now it seems like many doors are open.
Attached 2 patches. For anybody who plays 2 manual organ (sending on CH1 & CH2) for left and right hand or people with split-keyboard function using live: have fun with it.
Using lower manual drawbars to control fractal iterations, mu, scale....and likewise the sound :-)