O1Library Docs
Fall 2023
Docs API

# Note

o1.sound.midi.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.

## 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

Graph
Supertypes
  trait Serializable
  trait Product
  trait Equals
  trait MusicElem
  class Object
  trait Matchable
  class Any
  Show all

## Members list

### Value members

#### Concrete methods

def audibleLength: Int

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`

## Attributes

override def toString: String

Returns a string description of the note.

Returns a string description of the note.

## Attributes

Definition Classes
  Any

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.

## Attributes

#### Inherited methods

def productElementNames: Iterator[String]

## Attributes

Inherited from:
  Product

def productIterator: Iterator[Any]

## Attributes

Inherited from:
  Product