mm.StaffSVGVisualizer advanced usage

mm.StaffSVGVisualizer extends the basic mm.BaseVisualizer class with new capabilities to draw music notes in one single staff per instance, which can be configured though extended interface mm.StaffSVGVisualizerConfig. Those new capabilities include:

Mixing it all

In next example you can relize several combined features. Two tracks of a single score have been filtered in two staffs (left and right hand) which automatically adapt to the appropriate clef according to their note range. Switching Compact visualization mode makes same score be drawn on different mm.StaffSVGVisualizer instances, from compact mode (like a printed staff), to proportional mode (placing note heads in x axis similarly to piano-roll rectangles, ideal for multiple piled up visualizers). Musical symbols have been scaled up according with the defined 'noteHeight' config value. Visualization mode can be changed during playing, but given there will be a new instance you can experience a fast rewind before scrolling to the next active note. Finally G Key has been forced as default key assuming provided score doesn't handle any key information.

Compact visualization mode: Tempo:

Multiple Key and Time signatures

Next example adds more notes to the score (+) changing through all keys and the time signatures subset [2/4, 3/4, 4/4] to see how the staff grows and adapts to it. Please notice mm.Player does not handle incremental NoteSequence modifications once it has started to play.

Compact visualization mode: Tempo:

Piling several visualizers

Next example loads a MIDI file and will split it in as many staffs as as tracks (instruments) it contains. Following, it will add a mm.PianoRollSVGVisualizer that will show a synchronized version of full score. Please remember you are doing it all in a browser, have mercy and do not load a full orchestra symphony.

Compact visualization mode: Tempo:

Musical symbol catalog and managed use cases

Next score shows all musical symbols (but F clef, previously shown). In a G clef score, C key and 4/4 time signature, anacrusis starting, all notes (all F) and rests from whole to sixty-fourth are shown in first four bars with gradually lowering intensity (MIDI velocity). Following use cases are: a splitted note between two bars (thirty-second tied to sixty-fourth), rest completion by a sequence of lowering rests (half to sisty-fourth), polyphonic overlapping notes splitted and tied, bar splitted rests, accidentals repetition avoiding (F#), accidental re-activation (normal F), accidental re-activation (F#), accidental reset after bar (F#), accidental reset avoiding on tied notes after bar, accidental reset following tied notes after bar and, finally, dotted note. Time changes have been shown in previous scores.

Known issues are: No note beams are shown (flagged notes are used instead), and no triplets nor quintuplets are managed yet.

Compact visualization mode: Tempo: