O1Library Docs
Fall 2023
Docs API

# Instrument

o1.sound.midi.Instrument
See the Instrument companion object
case class Instrument(number: Int) extends MusicElem

A MusicElem that sets the instrument for the upcoming notes. The 128 main instruments of the standard MIDI list are supported. The companion object of this class provides constants that match those instruments.

## Parameters

number

  the number of a MIDI instrument between 0 and 127, inclusive

## Attributes

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

## Members list

### Value members

#### Inherited methods

def productElementNames: Iterator[String]

## Attributes

Inherited from:
  Product

def productIterator: Iterator[Any]

## Attributes

Inherited from:
  Product

#### Concrete fields

val length: Int

an `Instrument` element is a meta directive; it has no duration, so its length is zero

an `Instrument` element is a meta directive; it has no duration, so its length is zero

## Attributes