MusicalNote
Last updated at 12:44 pm UTC on 29 July 2022
A MusicalNote object is part of the Musical objects for Squeak image.
Object subclass: #MusicalElement
instanceVariableNames: 'duration sowhat'
classVariableNames: ''
poolDictionaries: ''
category: 'MuO-Music'
A MusicalElement object is "Anything that can be delayed, scaled and mixed"!
MusicalElement subclass: #AtomicElement
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'MuO-Music'
"An AtomicElement is the note associated to a MusicalCollection, such as a MIDI note or a Csound i-statement.
Most proeminent features:
- has a time and a length (not to be confused with the duration, which has a very specific meaning for MusicalElements)
- has an #associatedCollection (a MusicalCollection) returned by mix operations."
AtomicElement subclass: #MusicalNote
instanceVariableNames: 'time pitch volume channel length mute pan'
classVariableNames: 'Beat Channel DisplayTruncation EnvelopesCache Tempo'
poolDictionaries: ''
category: 'MuO-Music'
The broadest representation of a musical note: maintains a channel, a pitch, a volume, a starting time and a length. Provides methods for translation into "real" notes, such as MIDI notes or Csound i-statements.
The instance variable pan is the location in the panning spectrum, from -1.0 (left) to 1.0 (right) - it is up to a synthesizer how it will make use of that. See
for example how MIDI encodes paning in MusicalNote>>#asExplicitMIDIEvents.
The instance variable sowhat is a placeholder for arbitrary information (see senders of #hey: and #what).