IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
[Request] New Feature: "A color for each ton of the octave"
anaono
post Nov 25 2013, 14:56
Post #1





Group: Members
Posts: 32
Joined: 9-February 11
Member No.: 88035



@Admin: Sorry, Please delete this post! It should be under:

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



Dear fismineur, many thanks for your Musical Spectrum smile.gifsmile.gifsmile.gif

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").

This post has been edited by anaono: Nov 25 2013, 15:10
Go to the top of the page
+Quote Post
romor
post Dec 15 2013, 19:07
Post #2





Group: Members
Posts: 677
Joined: 16-January 09
Member No.: 65630



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
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
number_of_octaves = 8
cl = ''.join(number_of_octaves * cl)

which we'll append as bytes to a "header":
CODE
header = '001E099F08928D40818A1619B19AA41A2C000000E86700001878' + \
        '%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
with open("colorpiano_8oct.cfg", "wb") as f:
    for i in range(0, len(header + cl), 2):
        f.write(chr(int((header + cl)[i:i+2], 16)))


Result:



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

Cheers
Attached File(s)
Attached File  colorpiano_8oct.zip ( 243bytes ) Number of downloads: 56
 


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
anaono
post Dec 16 2013, 13:26
Post #3





Group: Members
Posts: 32
Joined: 9-February 11
Member No.: 88035



Thank you smile.gif

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 ...

This post has been edited by anaono: Dec 16 2013, 13:40
Go to the top of the page
+Quote Post
romor
post Dec 17 2013, 08:49
Post #4





Group: Members
Posts: 677
Joined: 16-January 09
Member No.: 65630



QUOTE (anaono @ Dec 16 2013, 14:26) *
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 wink.gif


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
EpicForever
post Feb 8 2014, 09:56
Post #5





Group: Members
Posts: 712
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



Great preset romor !! Thanks smile.gif I only changed background to black and disabled white/black keys smile.gif looks great
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 2nd October 2014 - 16:31