o1.sound.midi
Members list
Type members
Classlikes
An adjustment to the frequency of a Pitch: a Flat
, a Sharp
, or a Natural
.
An adjustment to the frequency of a Pitch: a Flat
, a Sharp
, or a Natural
.
Parameters
- shift
-
the shift from the base frequency caused by the accidental (in semitones). A positive number means a higher frequency, a negative number a lower one.
- symbol
-
a symbol describing the accidental: "#", "♭", or the empty string
Attributes
- Supertypes
Parameters
- notes
-
the
MusicElem
s that play simultanously in this chord
Attributes
- Companion
- object
- Supertypes
A MusicElem that sets the instrument for the upcoming notes. The 128 main instruments of the standard MIDI list are supported. The companion object of this class provides constants that match those instruments.
A MusicElem that sets the instrument for the upcoming notes. The 128 main instruments of the standard MIDI list are supported. The companion object of this class provides constants that match those instruments.
Parameters
- number
-
the number of a MIDI instrument between 0 and 127, inclusive
Attributes
- Companion
- object
- Supertypes
This object provides a selection of constants that correspond to the 128 main instruments of the standard MIDI list. They are grouped in nested objects (Piano, Strings, etc.). The object PercussionChannel contains constants that correspond to the special sounds available on the MIDI percussion channel.
This object provides a selection of constants that correspond to the 128 main instruments of the standard MIDI list. They are grouped in nested objects (Piano, Strings, etc.). The object PercussionChannel contains constants that correspond to the special sounds available on the MIDI percussion channel.
Attributes
- Companion
- class
- Supertypes
- Self type
-
Instrument.type
An error type that signals the underlying Java MIDI toolkit is unavailable.
An error type that signals the underlying Java MIDI toolkit is unavailable.
Attributes
- Supertypes
- Self type
This companion object of class Music
provides additional options for creating Music
objects.
Represents a piece of music that may consist of multiple Voices, which in turn consist of MusicElems such as notes.
Represents a piece of music that may consist of multiple Voices, which in turn consist of MusicElems such as notes.
Instead of using the constructor, you can use the companion object to construct a Music
object from a string: e.g., Music("cdefg&>gfedc")
.
Parameters
- tempoSetting
-
a tempo setting (in beats per minute) for the music, if there is one
- voices
-
the voices that, played simultaneously, make up the piece of music; no more than
MaxVoices
plus a possible percussion track
Attributes
- Companion
- object
- Supertypes
A MusicElem
is an element describes an aspect of MIDI music: a note, a chord, a pause, or a meta directive such as the change of an instrument. MusicElem
s put together make a Voice; voices put together compose a piece of Music.
A MusicElem
is an element describes an aspect of MIDI music: a note, a chord, a pause, or a meta directive such as the change of an instrument. MusicElem
s put together make a Voice; voices put together compose a piece of Music.
Each MusicElem
has a length
that represents how long it takes to play it. The duration of the shortest audible sound playable with o1.sound.midi
is one; other durations are linearly relative to that.
Attributes
- See also
-
the subtypes Note, Chord, Pause, OctaveShift, Instrument
- Supertypes
- Known subtypes
Each instance of this class represents a single musical note at a set pitch.
Each instance of this class represents a single musical note at a set pitch.
Parameters
- isStaccato
-
whether the note should be played staccato so that sound is shorter than its duration
- length
-
the duration of the note: how long it takes to play it
- pitch
-
the pitch of the note
Attributes
- Supertypes
Each instance of this class is a directive that instructs the subsequent notes to play one octave higher or lower.
Each instance of this class is a directive that instructs the subsequent notes to play one octave higher or lower.
Parameters
- shift
-
the direction of the shift: +1 means one octave higher, -1 one lower
Attributes
- Supertypes
A companion for class Pitch
.
A Pitch
is a frequency for a note to be played at.
A Pitch
is a frequency for a note to be played at.
Parameters
- accidental
-
an adjustment to the base frequency
- name
-
the name of the corresponding note, which provides the base frequency; one of "cdefgah" or their upper-case equivalents
- octave
-
the number of the octave relative to
DefaultOctave
; e.g., -2 means two octaves lower than the default; passing inNone
has the same effect as passing in zero
Attributes
- Companion
- object
- Supertypes
This object is an interface to the underlying MIDI sequencer. It is a thin Scala wrapper around the sequencer in the Java MIDI API.
This object is an interface to the underlying MIDI sequencer. It is a thin Scala wrapper around the sequencer in the Java MIDI API.
Attributes
- Supertypes
- Self type
-
Sequencer.type
This object is an interface to the underlying MIDI synthesizer. It is a thin Scala wrapper around the synthesizer in the Java MIDI API. Uses the piano sound.
This object is an interface to the underlying MIDI synthesizer. It is a thin Scala wrapper around the synthesizer in the Java MIDI API. Uses the piano sound.
Attributes
- Supertypes
- Self type
-
Synthesizer.type
Represents a single voice within a piece of Music. A voice consists of MusicElems, primarily notes, in order.
Represents a single voice within a piece of Music. A voice consists of MusicElems, primarily notes, in order.
Parameters
- isPercussion
-
whether the notes should not be interpresed as regular notes but as the special sounds defined for the MIDI standard’s percussion channel
- notes
-
the notes (and possible other MusicElems) that compose this voice
Attributes
- Supertypes
Types
An error type that signals the underlying Java MIDI toolkit is unavailable.
An error type that signals the underlying Java MIDI toolkit is unavailable.
Attributes
Value members
Concrete methods
Parses the given musical String
and returns the result as a Music object. The String
must be formatted as described in the package overview. Throws an IllegalArgumentException
in case the String
was invalid.
Parses the given musical String
and returns the result as a Music object. The String
must be formatted as described in the package overview. Throws an IllegalArgumentException
in case the String
was invalid.
Attributes
Parses the given musical String
and plays the music that it describes on the MIDI synthesizer. The String
must be formatted as described in the package overview. Prints out an error message in case the String
was invalid.
Parses the given musical String
and plays the music that it describes on the MIDI synthesizer. The String
must be formatted as described in the package overview. Prints out an error message in case the String
was invalid.
Attributes
Concrete fields
The number (5) of the default octave to play notes from.
The number (5) of the default octave to play notes from.
Attributes
The default tempo (120 beats per minute). This is used by various methods in with this package when playing music, unless otherwise specified.
The default tempo (120 beats per minute). This is used by various methods in with this package when playing music, unless otherwise specified.
Attributes
A number (127) that corresponds to the highest possible volume setting available to this MIDI package. (The lowest is zero.)
A number (127) that corresponds to the highest possible volume setting available to this MIDI package. (The lowest is zero.)
Attributes
A number (80) that corresponds to a “medium” volume on the scale from 0 to 127 that is available via MIDI.
A number (80) that corresponds to a “medium” volume on the scale from 0 to 127 that is available via MIDI.