Multitrack music represents a composition as separate musical lines or layers, such as instruments or vocal parts, that can be edited and processed independently. MuseGAN models interactions between these tracks to generate harmonious, cohesive compositions. section 13.0 section 13.1.2
A digital multitrack representation organizes music into nested time and pitch units:
- Tracks correspond to instruments such as piano, bass, and drums, or voices such as soprano, alto, tenor, and bass. section 13.0 section 13.1.2
- Bars divide time into measures, while steps subdivide each bar for sequencing rhythms and melodies. section 13.1.2
- Each step contains a note encoded as an 84-value one-hot vector representing pitch numbers from 0 through 83. section 13.1.2
JSB Chorales representation
A JSB Chorales example contains four tracks—soprano, alto, tenor, and bass. Each track spans two bars, each bar contains 16 steps, and every step selects one of 84 possible pitches. section 13.1.2
Listing 13.1 Visualizing the staff notation using the music21 library
%matplotlib inline #1
from music21 import midi, environment
mf = midi.MidiFile()
mf.open("files/example.midi") #2
mf.read()
mf.close()
stream = midi.translate.midiFileToStream(mf)
us = environment.Environment()
path = r'C:\Program Files\MuseScore 4\bin\MuseScore4.exe'
us['musescoreDirectPNGPath'] = path #3
stream.show() #4
Visualize a MIDI file as staff notation with music21, making the separate tracks and their musical structure inspectable. section 13.1.2
