### Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: [Request] New Feature: "A color for each ton of the octave" (Read 4790 times)
0 Members and 1 Guest are viewing this topic.

## [Request] New Feature: "A color for each ton of the octave"

##### 2013-11-25 13:56:32

http://www.hydrogenaudio.org/forums/index....showtopic=97404

Dear fismineur, many thanks for your Musical Spectrum

I ask you for a new feature. I propose to give a different color for each of the 12 notes of the octave. For an example show here:

http://www.planetware.de/colormusic/iColorpiano.html

(In this example i find it difficult to distinguish the colors for "c#, d and d#" and for "b ans c").

## [Request] New Feature: "A color for each ton of the octave"

##### Reply #1 – 2013-12-15 18:07:09
I'll show you a workaround in the meantime.
Similar to what you requested can be accomplished by choosing "Horizontal A" colormap rendering and a tiny bit of tweaking (example for Python interpreter):

1. We put the colors from your linked page to a list, and then pad those colors with "00":
Code: [Select]
cl = ["669900", "006699", "0066FF", "6600FF", "660099", "CC0066", "FF0000", "FF6600", "FF9900", "FFCC00", "FFFF00", "99CC33"]
cl = [i + "00" for i in cl]

2. Let's suppose our musical spectrum displays 8 octaves (starting from C for simplicity), thus:
Code: [Select]
number_of_octaves = 8
cl = ''.join(number_of_octaves * cl)

which we'll append as bytes to a "header":
Code: [Select]
'%02X' % (number_of_octaves * 12) + \
'03C4000D00F4013200B8011900FFFF0300C0C0C000FFFFFF002E354300F8F8F800B0B0B000'

Header contains some settings about musical spectrum configuration and important in this case - number of colors we want to introduce - 8 * 12 = 96 or in hex = 60.

3. Than we pack everything to binary file:
Code: [Select]
with open("colorpiano_8oct.cfg", "wb") as f:
for i in range(0, len(header + cl), 2):

Result:

So this is very simple walk-through how to get there from Python interpreter.

Cheers

## [Request] New Feature: "A color for each ton of the octave"

##### Reply #2 – 2013-12-16 12:26:05
Thank you

It looks good. I will test it in the next weeks, if i have more time.
It still needs some fine adjustment about color distribution: C2# is blue, but C9# is green; or B2 is light green and B8 is yellow: perhaps because you have configured [C2..C10] = 8 * 12 + 1 tones = 97 tones (i dont't know the real reason).

I am pleased to be able to see my music in colored tones ...

## [Request] New Feature: "A color for each ton of the octave"

##### Reply #3 – 2013-12-17 07:49:27
C2# is blue, but C9# is green; or B2 is light green and B8 is yellow: perhaps because you have configured [C2..C10] = 8 * 12 + 1 tones = 97 tones (i dont't know the real reason).

You are absolutely right
In above screenshot, I have chosen scale from C2 to C10, while I should have from C2 to B9.

IMHO, this is just harmless example of so common problem - indexing. Does limits include in range, does both sides share same rule, does indexing starts from 0 or 1. If you ever had a course in mathematics practicing operations with sequences I guess you'll find everything a breeze except sequence indexing

## [Request] New Feature: "A color for each ton of the octave"

##### Reply #4 – 2014-02-08 08:56:32
Great preset romor !! Thanks  I only changed background to black and disabled white/black keys  looks great