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
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- lazy val nonEmpty: Boolean
whether the
Music
object has any MusicElems at all - final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.