tinyNotation – a simple way of specifying single line melodies that uses a notation somewhat similar to Lilypond but with WAY fewer options. It was originally developed to notate trecento (medieval Italian) music, but it is pretty useful for a lot of short examples, so we have made it a generally supported music21 format N.B.: TinyNotation is not meant to expand to cover every single case. Instead it is meant to be subclassable to extend to the cases your project needs. See for instance the harmony examples in HarmonyStream and HarmonyNote or the Trecento specific examples in trecento/cadencebook.py Here are the most important rules: Note names are: a,b,c,d,e,f,g and r for rest Flats, sharps, and naturals are notated as #,- (not b), and (if needed) n. If the accidental is above the staff (i.e., editorial), enclose it in parentheses: (#), etc. Make sure that flats in the key signatures are explicitly specified. Note octaves are specified as follows: CC to BB = from C below bass clef to second-line B in bass clef C to B = from bass clef C to B below middle C. c to b = from middle C to the middle of treble clef c’ to b’ = from C in treble clef to B above treble clef After the note name, a number may be placed indicating the note length: 1 = whole note, 2 = half, 4 = quarter, 8 = eighth, 16 = sixteenth. etc. If the number is omitted then it is assumed to be the same as the previous note. I.e., c8 B c d is a string of eighth notes. After the number, a ~ can be placed to show a tie to the next note. A “.” indicates a dotted note. (If you are entering data via Excel or other spreadsheet, be sure that “capitalize the first letter of sentences” is turned off under “Tools->AutoCorrect,” otherwise the next letter will be capitalized, and the octave will be screwed up. For triplets use this notation: trip{c4 d8} indicating that these two notes both have “3s” over them. For 4 in the place of 3, use quad{c16 d e8}. No other tuplets are supported. Again, see the HarmonyStream (below) and trecento.cadencebook examples to see how to make TinyNotation useful for your own needs. (Currently, final notes with fermatas (or any very long final note), take 0 for the note length. But expect this to disappear from the TinyNotation specification soon, as it’s too Trecento specific.)
>>> tcN = TinyNotationNote("AA-4.~=aflat_hel-")
>>> note1 = tcN.note
>>> note1.name
'A-'
>>> note1.octave
2
>>> note1.lyric
'hel-'
>>> note1.id
'aflat'
TinyNotationNote methods
- customNotationMatch(m21NoteObject, stringRep, storedDict)¶
- No documentation.
- customPitchMatch(stringRep, storedDict)¶
- method to create a note object in sub classes of tiny notation. Should return a Note-like object or None
- getDots(stringRep, noteObj)¶
- subclassable method to set the dots attributes of the duration object. It is subclassed in music21.trecento.cadencebook.TrecentoNote where double dots are redefined as referring to multiply by 2.25 (according to a practice used by some Medieval musicologists).
Inherits from: Stream, Music21Object
A TinyNotationStream takes in a string representation similar to Lilypond format but simplified somewhat and an optional time signature string (or TimeSignature object). example in 3/4:
>>> stream1 = TinyNotationStream("E4 r f# g=lastG trip{b-8 a g} c", "3/4")
>>> stream1.getElementById("lastG").step
'G'
>>> stream1.notes[1].isRest
True
>>> stream1.notes[0].octave
3
TinyNotationStream attributes
Attributes without Documentation: stringRep
Attributes inherited from Stream: isMeasure, flattenedRepresentationOf, isFlat, isSorted
Attributes inherited from Music21Object: classSortOrder, id, groups
TinyNotationStream properties
Properties inherited from Stream: notes, pitches, duration, elements, flat, highestOffset, highestTime, isGapless, lily, lowestOffset, metadata, midiFile, midiTracks, musicxml, mx, semiFlat, sorted
Properties inherited from Music21Object: classes, offset, parent, priority
TinyNotationStream methods
- getNote(stringRep, storedDict={})¶
- called out so as to be subclassable
Methods inherited from Stream: append(), insert(), insertAndShift(), transpose(), augmentOrDiminish(), scaleOffsets(), scaleDurations(), addGroupForElements(), allPlayingWhileSounding(), analyze(), attachIntervalsBetweenStreams(), attributeCount(), bestClef(), extendDuration(), extractContext(), findConsecutiveNotes(), findGaps(), getClefs(), getElementAfterElement(), getElementAfterOffset(), getElementAtOrAfter(), getElementAtOrBefore(), getElementBeforeElement(), getElementBeforeOffset(), getElementById(), getElementsByClass(), getElementsByGroup(), getElementsByOffset(), getElementsNotOfClass(), getInstrument(), getKeySignatures(), getOffsetByElement(), getOverlaps(), getSimultaneous(), getTimeSignatures(), groupCount(), groupElementsByOffset(), index(), indexList(), insertAtNativeOffset(), isClass(), isMultiPart(), isSequence(), makeAccidentals(), makeBeams(), makeMeasures(), makeNotation(), makeRests(), makeTies(), makeTupletBrackets(), measure(), measureOffsetMap(), measures(), melodicIntervals(), pitchAttributeCount(), playingWhenAttacked(), plot(), pop(), quantize(), remove(), repeatAppend(), repeatInsert(), replace(), setupPickleScaffold(), shiftElements(), simultaneousAttacks(), splitByClass(), stripTies(), teardownPickleScaffold(), transferOffsetToElements(), trimPlayingWhileSounding()
Methods inherited from Music21Object: addContext(), addLocation(), addLocationAndParent(), freezeIds(), getContextAttr(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), hasContext(), purgeLocations(), removeLocationBySite(), removeLocationBySiteId(), searchParentByAttr(), setContextAttr(), setOffsetBySite(), show(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()
Inherits from: TinyNotationStream, Stream, Music21Object
example of subclassing TinyNotationStream to include a possible harmonic representation of the note
>>> michelle = "c2*F*_Mi- c_chelle r4*B-m7* d-_ma A-2_belle "
>>> michelle += "G4*E-*_these c_are A-_words G_that "
>>> michelle += "F*Ddim*_go A-_to- Bn_geth- A-_er"
>>> hns = HarmonyStream(michelle, "4/4")
>>> ns = hns.notes
>>> ns[0].step
'C'
>>> ns[0].editorial.misc['harmony']
'F'
>>> ns[0].lyric
'Mi-'
>>> ns[2].isRest
True
>>> ns[5].name
'G'
>>> ns[7].name
'A-'
Inherits from: TinyNotationNote
HarmonyNote methods
- customNotationMatch(m21NoteObject, stringRep, storedDict)¶
- checks to see if a note has markup in the form TEXT and if so, stores TEXT in the notes editorial.misc[] dictionary object See the demonstration in the docs for class HarmonyLine.
Methods inherited from TinyNotationNote: customPitchMatch(), getDots()