Skip to content

Generate simple random melodies and corresponding sheet music for practising note reading

Notifications You must be signed in to change notification settings

grey-area/note-reading-exercise

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note Reading Exercise Generator

Melody and midi generation forked from random-midi by Jobsecond.

I use random-midi and lilypond (a program for typesetting sheet music in LaTeX) to generate short melodies and corresponding sheet music, intended for practising note reading for guitar.

Prerequisites

This project is written in Python 3.6.

Generating MIDI and Sheet Music

Install MIDIUtil with pip:

pip install MIDIUtil

Install lilypond with apt:

sudo apt-get install lilypond

Playing MIDI files

In order to play midi files you may want to install timidity:

sudo apt-get install timidity timidity-interfaces-extra

or VLC and the appropriate plugin:

sudo apt-get install vlc vlc-plugin-fluidsynth

How to use?

Simply run main.py. A standard MIDI file will be generated in output folder. The filename is {timestamp}.mid. You'll also find a PDF file of the corresponding sheet music in output/{timestamp}.pdf, and the text file compiled by lilypond into this sheet music in output/{timestamp}.txt.

The melodies produced are very short: by default, 10 melodies of 8 notes are produced.

Customize

There are four optional command-line arguments:

python main.py --tempo <tempo> --num-exercises <# exercises> --num-bars <# bars per exercise> --key <key>

The default tempo is slow (45). The default number of exercises (number of short melodies to be generated) is 10. The default number of bars is two, with four notes to a bar.

Keys are A through G. Sharp and flat keys are available by adding an is or es suffix respectively (taken from Lilypond's note naming convention), so, for example,

python main.py --key ges

will produce exercises using the G♯ major scale. In the produced sheet music, accidentals are used rather than indicating the key signature.

Example Output

The following is sheet music generated for the sequence of melodies found in the example MIDI file here. The PDF can be found here.

Example sheet music

About

Generate simple random melodies and corresponding sheet music for practising note reading

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%