O1Library Docs
Fall 2023
Docs API

# Voice

o1.sound.midi.Voice
final case class Voice(notes: Seq[MusicElem], isPercussion: Boolean)

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

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

## Members list

### Value members

#### Concrete methods

override def toString: String

Returns a string description of the music.

Returns a string description of the music.

## Attributes

Definition Classes
  Any

#### Inherited methods

def productElementNames: Iterator[String]

## Attributes

Inherited from:
  Product

def productIterator: Iterator[Any]

## Attributes

Inherited from:
  Product

#### Concrete fields

lazy val length: Int

the total `length` (duration) of all the notes in the voice

the total `length` (duration) of all the notes in the voice

## Attributes

lazy val nonEmpty: Boolean

whether the voice has any MusicElems at all

whether the voice has any MusicElems at all

## Attributes