MuseData Example: color

From CCARH Wiki
Revision as of 22:28, 1 February 2011 by Craig (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Notes in MuseData files can be colored by adding six possible characters in column 14 of pitch records:

RColor notehead/stem red
GColor notehead/stem green
BColor notehead/stem blue
rColor notehead red
gColor notehead green
bColor notehead blue

Capital letters color both the noteheads and the stems/beams to which the notes attach. Lower-case letters only color the noteheads. Both upper- and lower-case letters color accidentals and augmentation dots, but only upper-case letters color articulations and ties. Neither coloring method will color slurs attached to the notes. Upper-case letters will aggressively color beams and all stems attached to the beams.

More information can be found in the official MuseData specification. The following graphical notation example was printed from the MuseData source code found below using muse2ps.

Mdex-color.png

@muse2psv1==z21jT^Coloring Notes in MuseData^v240
Header Record 1
Header Record 2
Header Record 3
02/01/2011 C. Sapp
WK#:1 MV#:1
Header Record 6: source
Color sampler
Header Record 8: movement title

Header Record 10
Group memberships: score
score: part 1 of 1
$  Q:4   T:6/4   C:4
&
Column 14 for notes can be used to indicate color.  Three colors
are possible, in two coloring variants:
   R = red, note plus stem
   G = green, note plus stem
   B = blue, note plus stem
   r = red, note plus stem
   g = green, note plus stem
   b = blue, note plus stem
Column 44 repeats the color codes so that they are visible underneath
the notes as text in the printed example.
&
C4     4     R1 q                          R
D4     4     r1 q                          r
E4     4     G1 q                          G
F4     4     g1 q                          g
G4     4     B1 q                          B
A4     4     b1 q                          b
measure 2
C4     2     R1 e        [                 R
D4     2     R1 e        ]                 R
C4     2     r1 e        [                 r
D4     2     r1 e        ]                 r
E4     2     G1 e        [                 G
F4     2     G1 e        ]                 G
E4     2     g1 e        [                 g
F4     2     g1 e        ]                 g
G4     2     B1 e        [                 B
A4     2     B1 e        ]                 B
G4     2     b1 e        [                 b
A4     2     b1 e        ]                 b
measure 3
C4     2      1 e        [
D4     2     R1 e        ]                 R
C4     2      1 e        [
D4     2     r1 e        ]                 r
E4     2      1 e        [
F4     2     G1 e        ]                 G
E4     2      1 e        [
F4     2     g1 e        ]                 g
G4     2      1 e        [
A4     2     B1 e        ]                 B
G4     2      1 e        [
A4     2     b1 e        ]                 b
measure 4
C4     1     R1 s        [[                R
D4     1     R1 s        ==                R
C4     1     R1 s        ==                R
D4     1     R1 s        ]]                R
C4     1     r1 s        [[                r
D4     1     r1 s        ==                r
C4     1     r1 s        ==                r
D4     1     r1 s        ]]                r
E4     1     G1 s        [[                G
F4     1     G1 s        ==                G
E4     1     G1 s        ==                G
F4     1     G1 s        ]]                G
E4     1     g1 s        [[                g
F4     1     g1 s        ==                g
E4     1     g1 s        ==                g
F4     1     g1 s        ]]                g
G4     1     B1 s        [[                B
A4     1     B1 s        ==                B
G4     1     B1 s        ==                B
A4     1     B1 s        ]]                B
G4     1     b1 s        [[                b
A4     1     b1 s        ==                b
G4     1     b1 s        ==                b
A4     1     b1 s        ]]                b
measure 5
C4     1      1 s        [[
D4     1     R1 s        ==                R
C4     1     R1 s        ==                R
D4     1      1 s        ]]
C4     1      1 s        [[
D4     1     r1 s        ==                r
C4     1     r1 s        ==                r
D4     1      1 s        ]]
E4     1     G1 s        [[                G
F4     1     G1 s        ==                G
E4     1      1 s        ==
F4     1      1 s        ]]
E4     1     g1 s        [[                g
F4     1     g1 s        ==                g
E4     1      1 s        ==
F4     1      1 s        ]]
G4     1      1 s        [[
A4     1      1 s        ==
G4     1     B1 s        ==                B
A4     1     B1 s        ]]                B
G4     1     b1 s        [[                b
A4     1      1 s        ==
G4     1     b1 s        ==                b
A4     1     b1 s        ]]                b
measure 6
C4     1     R1 s        [[                R
D4     1      1 s        ==
C4     1      1 s        ==
D4     1      1 s        ]]
C4     1      1 s        [[
D4     1     r1 s        ==                r
C4     1      1 s        ==
D4     1      1 s        ]]
E4     1      1 s        [[
F4     1      1 s        ==
E4     1     G1 s        ==                G
F4     1      1 s        ]]
E4     1      1 s        [[
F4     1      1 s        ==
E4     1      1 s        ==
F4     1     g1 s        ]]                g
G4     1      1 s        [[
A4     1      1 s        ==
G4     1      1 s        ==
A4     1     B1 s        ]]                B
G4     1      1 s        [[
A4     1      1 s        ==
G4     1     b1 s        ==                b
A4     1      1 s        ]]
measure 7
C#4    4     R1 q                          R
D#4    4     r1 q                          r
E#4    4     G1 q                          G
F#4    4     g1 q                          g
G#4    4     B1 q                          B
A#4    4     b1 q                          b
measure 8
C#4    4     R1 q              >           R
D#4    4     r1 q              >           r
E#4    4     G1 q              >           G
F#4    4     g1 q              >           g
G#4    4     B1 q              >           B
A#4    4     b1 q              >           b
measure 9
C4     4-    R1 q              -           R
C4     4     R1 q                          R
D4     4-    r1 q              -           r
D4     4     r1 q                          r
E4     4-    B1 q              -           B
E4     4     B1 q                          B
measure 10
F4     4-    b1 q              -           b
F4     4     b1 q                          b
G4     4-    G1 q              -           G
G4     4     G1 q                          G
A4     4-    g1 q              -           g
A4     4     g1 q                          g
measure 11
C4     4     R1 q              (           R
D4     4     R1 q              )           R
C4     4     r1 q              (           r
D4     4     r1 q              )           r
E4     4     B1 q              (           B
F4     4     B1 q              )           B
measure 12
E4     4     b1 q              (           b
F4     4     b1 q              )           b
G4     4     G1 q              (           G
A4     4     G1 q              )           G
G4     4     g1 q              (           g
A4     4     g1 q              )           g
measure 13
C4     3     R1 q.                         R
C4     3     R1 e                          R
D4     4     r1 q.                         r
D4     3     r1 e                          r
E4     3     G1 q.                         G
E4     1     G1 e                          G
measure 14
F4     3     g1 q.                         g
F4     3     g1 e                          g
G4     4     B1 q.                         B
G4     3     B1 e                          B
A4     3     b1 q.                         b
A4     1     b1 e                          b
mheavy2
/END
/eof
//

Other colors

MuseData printing with muse2ps and dmuse will only accommodate 3 colors. If you need any three other colors, then you can edit the color functions in the output PostScript data (which may be found on each page or once for the entire file depending on the printing software version):

 /makered   { 1.0 0.0 0.0 setrgbcolor } def
 /makeblue  { 0.0 0.0 1.0 setrgbcolor } def
 /makegreen { 0.0 0.7 0.0 setrgbcolor } def

The three numbers are the red, green and blue color channels, which each range from 0.0 to 1.0. Here is an sample from the previous example where the colors were changed to:

 /makered   { 0.6 0.3 0.0 setrgbcolor } def
 /makeblue  { 0.5 0.0 0.9 setrgbcolor } def
 /makegreen { 0.3 0.5 0.3 setrgbcolor } def


Mdex-coloralt.png