Note

final case class Note(pitch: Pitch, length: Int, isStaccato: Boolean) extends MusicElem

Each instance of this class represents a single musical note at a set pitch.

Value 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

trait Product
trait Equals
trait MusicElem
class Object
trait Matchable
class Any

Value members

Concrete methods

the duration that the note is audible. This equals the length of the note except for staccato notes whose audible length is half their length

the duration that the note is audible. This equals the length of the note except for staccato notes whose audible length is half their length

override def toString: String

Returns a string description of the note.

Returns a string description of the note.

Definition Classes
def volume: Int

the volume the note should be played at. The Note class selects between HighVolume and MediumVolume on the basis of the letter case of the note’s Pitch.

the volume the note should be played at. The Note class selects between HighVolume and MediumVolume on the basis of the letter case of the note’s Pitch.

Inherited methods

Inherited from:
Product