Home > abc.rb

abc.rb

Abc.rb is a project mainly written in Ruby, it's free.

abc.rb is a Ruby library for working with music notation in the abc format

h2. abc.rb

!http://www.jeffbots.com/judgedredd1.jpg!

abc is a Ruby library for working with music notation in the "abc format":abcnotation.

h3. Installation

abc.rb relies on the following dependencies;

  • "abcm2ps":abcm2ps a command line library for converting abc notation into traditional music representation on a stave in postscript format.
  
    wget http://moinejf.free.fr/abcm2ps-5.9.3.tar.gz
    tar -xzf abcm2ps-5.9.3.tar.gz
    cd abcm2ps-5.9.3
    make
    sudo make install
  
  • "ghostscript":gs an interpreter for the postscript language, we use it to transform the postscript file into a format that is easier for the web.

[abcm2ps]http://moinejf.free.fr/ [abcnotation]http://abcnotation.org.uk/ [gs]http://pages.cs.wisc.edu/~ghost/

h3. Example usage 0.0.1


Abc.to_png "KitchenGirl", kitchen_girl = <<-SRC
    M:4/4
    O:I
    R:R

    X:1
    T:Untitled Reel
    C:Trad.
    K:D
    eg|a2ab ageg|agbg agef|g2g2 fgag|f2d2 d2:|
    ed|cecA B2ed|cAcA E2ed|cecA B2ed|c2A2 A2:|
    K:G
    AB|cdec BcdB|ABAF GFE2|cdec BcdB|c2A2 A2:|

    X:2
    T:Kitchen Girl
    C:Trad.
    K:D
    [c4a4] [B4g4]|efed c2cd|e2f2 gaba|g2e2 e2fg|
    a4 g4|efed cdef|g2d2 efed|c2A2 A4:|
    K:G
    ABcA BAGB|ABAG EDEG|A2AB c2d2|e3f edcB|ABcA BAGB|
    ABAG EGAB|cBAc BAG2|A4 A4:|
    SRC