case class Music(tempoSetting: Option[Int], voices: Seq[Voice]) extends Product with Serializable
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")
.
- 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
- Alphabetic
- By Inheritance
- Music
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- lazy val nonEmpty: Boolean
whether the
Music
object has any MusicElems at all - def play(): Unit
Plays this music using the MIDI synthesizer.
Plays this music using the MIDI synthesizer. This is equivalent to calling o1.sound.midi.play. Students have access to the same functionality via the
play
method on the top-level package o1. - def productElementNames: Iterator[String]
- Definition Classes
- Product
- lazy val tempo: Int
The tempo of the music in beats per minute.
The tempo of the music in beats per minute. This equals tempoSetting or DefaultTempo, if that’s not set.
- val tempoSetting: Option[Int]
- def toMidi: Sequence
Returns the underlying MIDI sequence.
- val voices: Seq[Voice]