Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

runrig (3385)


Just another perl hacker somewhere near Disneyland

I have this homenode [] of little consequence on Perl Monks [] that you probably have no interest in whatsoever.

I also have some modules [] on CPAN [] some of which are marginally [] more [] useful [] than others.

Journal of runrig (3385)

Sunday November 11, 2007
12:10 PM

Free (as in beer) Music Scoring

[ #34877 ]

My daughter is in the school jazz band. She plays french horn. As you might imagine, there isn't much jazz band music written for french horn. The instructor has some trombone music in the same range, but trombone is written in concert pitch with a bass clef, horn is an F instrument written with a treble clef.

I did not want to manually write the notes with pencil and paper, I wanted some sort of "music scoring language" for the computer. At first, I thought of XML (why?), searched for Music and XML, and found a ".org" whose website looked like an advertisement for the company who had come up with this flavor of XML. And the XML was verbose, and I was not looking forward to entering all that cruft.

Then I think I searched for "music scoring opensource", and came up with LilyPond. And I looked at the language, and it was (sometimes) as dense as a perl regular expression. To enter a run of quarter notes, you just enter them "c d e f g". To make them eighth notes, just add the duration to the first one: "c8 d e f g". It gets somewhat ugly when you mark up a make the c staccato and mark it as (dynamic) forte it would be "c8-.\f" (the "f" appears below the note, the "." appears above or below the note depending on stem direction). Dynamics like "f" (in the previous example) and "sfz" are built in, but for "sffz" you have to create a "custom dynamic."

Text markup is ugly too...I wanted to add a "D.S. (w/symbol) al Coda (w/symbol)" above the staff with "(No repeat)" underneath it, and this is what I came up with (it's attached to a rest note):

  r1^\markup { \hspace #3.0 \tiny \center-align {
                 { \line { "D.S. " \musicglyph #"scripts.segno" " al Coda  " \musicglyph #"scripts.coda" } }
                 { "(No Repeat)" }
             } }

You can create macros, and that's what I think I would do next time for the musicglyphs above. Also, glissandos (rising or falling pitch to or from a note) must have starting and ending notes, but sometimes the start or end pitches are indeterminate, so you have to create an "invisible note" and modify the duration of the notes (here the starting note is 9/10 the normal value, so the invisible end note is 1/10 the same value, and the style is a "zigzag" line instead of a straight line):

\once \override Glissando #'style = #'zigzag
    \hideNotes g4*1/10 \unHideNotes

I had two pieces (each two pages) to transcribe, the first one took me 10 hours or so (big learning curve), the next took less than an hour (it had less text markup). When I was done, I compared the trombone music against the original, corrected my typos(**), then I wrapped the whole thing in a "\transpose f c' { ... }", changed the bass clef to treble, and I had some nice new jazz for horn :-)

Oh yeah, and it has a Scheme based scripting language (which I have not begun to look at), and outputs pdf, postscript (w/direct links to modify the postscript output), and other formats.

(**) Along with the usual typos, before I learned about the hideNotes thing, I had a glissando between a note and a rest, which worked fine for trombone in that instance, but when transposed to horn, it was a glissando up instead of down, so I had to learn all about the hiding notes thing to fix it :-)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • have
      a look at the 'abc' music notation system. wonderfully simple, clear and powerful enough for most music types as far as i can tell (i write music for bagpipe, violin and akordeon)
    • look at the 'abc' music notation system. wonderfully simple,

      Thanks, it looks useful for many things, but in the 17 minutes that I've researched it, it might be a little too simple for my needs. I looked at an abc tutorial [], and found a list of proposed features [], almost all of which I need now. Of course, it's possible that this is an old tutorial, and that everything has been implemented by now, or that some implementation of abc includes all these features, but then I'd still have to go find some impleme

      • And on the rehearsal marks, I used "format-mark-box-barnumbers", which printed giant bar numbers with boxes around them above the staff, and was also useful for finding my mistakes when the generated bar numbers didn't match the bar number on the page I was trying to transcribe (LilyPond also has a "bar check" feature for the same sort of thing, but I didn't needs that with this type of rehearsal mark).
      • lilypond is not _that_ hard, really. i do mostly folk-type music and some classical (viol and akkordeon). rehearsal marks in abc, um, not right now. lilypond does produce the most beautiful music out there (i include some commercial apps in the windows world).