components.instruments Module

This module contains the instrument classes.

class components.instruments.AltoSaxophone

Bases: components.instruments.Saxophone

An alto saxophone.

class components.instruments.Baritone

Bases: components.instruments.LowBrassInstrument

A baritone.

class components.instruments.BaritoneHorn

Bases: components.instruments.LowBrassInstrument

A baritone horn.

class components.instruments.BaritoneSaxophone

Bases: components.instruments.Saxophone

A baritone saxophone.

class components.instruments.BassGuitar

Bases: components.instruments.Guitar

A bass guitar.

class components.instruments.Bassoon

Bases: components.instruments.WoodwindInstrument

A bassoon.

class components.instruments.BrassInstrument

Bases: components.instruments.Instrument

A brass instrument.

class components.instruments.Clarinet

Bases: components.instruments.WoodwindInstrument

A clarinet.

class components.instruments.Conductor

Bases: components.instruments.Instrument

A conductor. Yeah, not really an instrument. Neither is mayonnaise, Patrick! Who cares?

class components.instruments.Drums

Bases: components.instruments.PercussionInstrument

The drums.

class components.instruments.Euphonium

Bases: components.instruments.LowBrassInstrument

An euphonium.

class components.instruments.Flugelhorn

Bases: components.instruments.HighBrassInstrument

A flugelhorn.

class components.instruments.Flute

Bases: components.instruments.WoodwindInstrument

A flute.

class components.instruments.Guitar

Bases: components.instruments.Instrument

A guitar.

class components.instruments.HighBrassInstrument

Bases: components.instruments.BrassInstrument

A high brass instrument.

class components.instruments.Horn

Bases: components.instruments.HighBrassInstrument

A horn.

class components.instruments.Instrument

Bases: object

Base class for all instruments. Instruments are comparable, where the order is defined by class inheritance. For example:

Trumpet() < BrassInstrument() # True
Flugelhorn() <= Trumpet() # False
BrassInstrument() == BrassInstrument() # True
AltoSaxophone() == Saxophone() # False

Moreover, strings can be tested for equality with instruments. The comparison is case insensitive. The string will be compared to the string representation of the instrument.

Trumpet() == 'Trompete' # True
Trumpet() == 'trompete' # True
Trumpet() == 'Saxophon' # False
static from_string(string, allowed=None)

Given a string representation or an AkaBlas-style abbreviation of an instrument, this will return a corresponding components.Instrument instance.

Parameters
Raises

ValueError – If the abbreviation is not known.

Return type

Optional[Instrument]

class components.instruments.LowBrassInstrument

Bases: components.instruments.BrassInstrument

A low brass instrument.

class components.instruments.Oboe

Bases: components.instruments.WoodwindInstrument

An oboe.

class components.instruments.PercussionInstrument

Bases: components.instruments.Instrument

A percussion instrument.

class components.instruments.Saxophone

Bases: components.instruments.WoodwindInstrument

A saxophone.

class components.instruments.SopranoSaxophone

Bases: components.instruments.Saxophone

A soprano saxophone.

class components.instruments.TenorSaxophone

Bases: components.instruments.Saxophone

A tenor saxophone.

class components.instruments.Trombone

Bases: components.instruments.LowBrassInstrument

A trombone.

class components.instruments.Trumpet

Bases: components.instruments.HighBrassInstrument

A trumpet.

class components.instruments.Tuba

Bases: components.instruments.LowBrassInstrument

A tuba.

class components.instruments.WoodwindInstrument

Bases: components.instruments.Instrument

A woodwind instrument.