# 1 colour per note played

Goal: 1 colour per note played

128 Notes from the digital piano to MIDI
Python equation to get frequency Hz from data: pow(2,((me.inputVal-69)/12))440
Mapping each note to 1 channel on a DMX LED 512 (RGB, 3 leds per 1 channel)

is this a CHOP to TOP set up? with an expression CHOP?
If anyone has any idea I am all eyes…

Please don’t repost same question in another section of forum. If you haven’t gotten an answer you can try uploading what you’ve already been trying, that would probably get you help faster.

Hey,

do the midi notes played directly convert to an LED light? Whyy do you need the frequency for the LEDs?

In this case all you need to do is use a Shuffle CHOP after the Midi IN with the Method set to “Sequence all Channels”. Use a Merge CHOP to merge the Shuffle 3 times which gives you 1 channel for r, g and b. Before sending it to DMX, you now need to put those into the right order which you can do with a Shuffle CHOP again setting the Method to “Sequence all Samples”. As DMX requires the values to be between 0 and 255, add a Math CHOP and set the Multiply to 255. Attach a DMX Out with Format set to “Packet Per Channel”, fill out the Routing Table if you are using ArtNet and you should be good to go.

Cheers
Markus

Hi,

Thanks for posting a solution.

Yes, you are correct. The MIDI notes played directly convert to LEDs.

I put the components you suggested together.
Lumicrest lighting solutions will be filling out the Routing Table for us.

In this setup, at what point do I get to decide what note played == what colour?

Thanks again

Hey,

is it that 1 note will play one LED or 1 note translates to a specific color?

Cheers
Markus

One note translates to one colour.

There are 128 notes on the piano so we will have 128 unique channels to DMX output r,g,b colours.

Does that make any sense?

Thanks again Markus. You rock.

Ah - ok - I misunderstood this initially.

How are the colors defined and how many LEDs do you have or are these LED fixtures?

Cheers
Markus

That’s why initially I was thinking frequency would define colour.

We have a rope of DMX LEDs with 512 channels available. Each channel will have a r, g, b led to combine and make one colour.

We would like to predetermine the colours and not have them random but assigned by note, or Hz from the piano.

Do you have a project file you can post that you were testing?

Hey,

in what unit the lookup for the colors is specified doesn’t really matter - in fact by note number would be easier as it’s a running index instead of a non-linear hz value.

This is best done with a Lookup CHOP. The first input would be the index of the Midi Note played (you can get this by using the MidiIn CHOP and connect a Fan CHOP to it with the Fan Operation set to Fan In → the result will be the index of the note that is being played). The second input would be the list of colors in CHOP format. So start with a Table DAT with 3 columns for r, g and b and every row being a color you selected (you should then have 129 rows in total). The output from the lookup CHOP will be the color for your LED.
Now it depends if all LEDs have the same color assigned or you want different LEDs light up at different times?

Best place to check the functionality of the mentioned operators is to see examples in the Operator Snippets which you can find under the Help Menu inside TouchDesigner.

For reference I have attached a file using random rgb values per note to drive the whole strip. As I don’t know your Midi setup, perhaps you will have to make adjustments to the parameters…

Cheers
Markus
colorPerNote.tox (2.42 KB)

Markus, you’re a champion!!

Thank you for all of your help so far. I have downloaded your sample and I am playing with it now. Thank you so much.

The LEDs will all be different colours and they will light up at different times… but hopefully like a musical composition plays different notes at the same time, we will be able to “play” different colours together (from different LEDs on the same rope)