Songlib: note playing

John C. Lusth

Revision Date: January 14, 2015

Printable Version


Note-playing functions

The major note-playing functions/families are:

Most functions have alternative forms. For example, the main note playing function is play, but there are the following alternative forms: nplay, rplay, and dplay.

The 'n' version of a function means the note is specified by a numbered note rather than an octave/pitch pair. For example, these calls are all equivalent:

play(Hd,guitar,3,C);
nplay(Hd,guitar,C3);
play(Hd,guitar,C3 / NOTES,C3 % NOTES);
nplay(HD,guitar,3 * NOTES + C);

The 'r' version of a function indicates that an RRA object is passed rather than an octave/pitch specification. These three calls are equivalent:

play(Hd,guitar,3,C);
rplay(Hd,getNote(guitar,3,C));
rplay(Hd,getNumberedNote(guitar,C3));

The 'd' version of a function indicates that raw amplitude data is passed as an integer array and a length. The following calls to play and dplay are equivalent:

RRA *r = getNote(guitar,3,C);
play(Hd,guitar,3,C);
dplay(Hd,r->data[0],r->samples);

See also: noteNotations,rra

lusth@cs.ua.edu