• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.


Ramid II

Page history last edited by Steve Witham 10 years, 8 months ago

    Ramid II






At the 2009 Hack Day I wrote ramid.py, which composes melodies and outputs MIDI files.  This year I added PDF score output using Abjad, a Python library built on the LilyPond music notation system.





Some ramid.py melodies (mp3, 850K)


PyraQuant, the C language predecessor to ramid.py, composed this short piece (mp3, 380K).


Ramid II composed:

Gnossienne_nr_404.mid / Gnossienne_nr_404.pdf, and

ramid_ii_qiyBEMYJ9.mid / ramid_ii_qiyBEMYJ9.pdf (bouncier).


Here's the theory of how these programs compose melodies.


Ramid II code


spianostaff.py has the class that paints a single melody across the treble/bass clef piano staff.

ramid_ii.py composes a melody and outputs MIDI (via pythonmidi) and/or PDF (via spianostaff, Abjad and LilyPond).


Tools, Platforms and APIs Used


Abjad -- Python API for building LilyPond scores.

LilyPond -- Music notation rendering system.

pythonmidi -- Max M's midi library is used in the original ramid.py and in Ramid II.  LilyPond can produce midi output but ramid*.py adds expression to the midi that's not in the score.

Python, okay.

Comments (0)

You don't have permission to comment on this page.