bgossage / BioTunes

A group project to generate music from DNA or protein sequences.
GNU General Public License v3.0
0 stars 0 forks source link

Encode sheet music to SMF (and define SMF) (Nico) #2

Open bgossage opened 7 years ago

nicobako commented 7 years ago

So far, encoding sheet music into SMF must be done by hand. I can definitely help everyone with that.

SMF will be a string which consists of notes that are separated by a space. A typical SMF note would be G2e. The first character is the note itself. Notes range from A - C. The second character is the octave of the note. The octaves range from 0-3. The third character is the duration of the note where e=eighth, q=quarter, and h=half.

Only notes C0, C1, and C2 are allowed to be half notes. All other notes are either eighth or quarter notes.

An SMF note shall be considered an eighth note if it is appears as an eighth or smaller in the original music. An SMF note will be considered a quarter note if it appears as anything greater than an eighth note in the original piece of music.

Lastly, C0, C1, and C2 are allowed to be half notes if they appear as half notes or greater in the original music.

I hope this clarifies how an SMF is generated.

Here is an example SMF obtained from the first 8 measures of a music piece by Mazas - 75 Melodious and progressive and progressive studies op.36 no.7.

SMF = 'C1h G0q E1q D1q A0q F1q B0q D1q F1q A1q G1e G1q F1e E1e C2h G1q E1q D1e F1e A1e D2e F2q G2e A2e G0e E1e G1e C2e B1e D2e F2e B1e B1q C2e D2e C2q'