Class MusicalInstrument

MusicalInstrument is an object that regroup several Gold sounds sharing same characteristics, playing techniques, sound capabilities.

i.e. in family "Piano" we have many sounds of Piano, Grand and electric pianos, but also Harpsichords, so we have at least two instruments: Piano and Harpsichord. This class allow to know:

Section

SectionSummary
MusicalInstrumentsMusical instruments constants, Map and static functions

Summary

FieldTypeSummary
GeographicOrigin For "ethnic" instrument, their geographical origin
IDintIdentifier of the instrument, one of INSTR_* constants.
IsVolumeDecaysboolDoes volume decays?
MaxSimultaneousNotesintMaximum number of simultaneously played notes: 1=monophonic, 2==polyphonic.
MidiSectionintMIDI section
NamestringInstrument name
OrchestraSectionintSection of the orchestra.
SoundstableGold Base sounds.
Return typeFunction and summary
tablegetSounds(bool excludeDuplicateDrums)
Get the list of sounds for this instrument
boolisMonophonic()
Is instrument monophonic?
boolisPolyphonic()
Is instrument polyphonic?

Fields

int MusicalInstrument:ID

Identifier of the instrument, one of INSTR_* constants.

string MusicalInstrument:Name

Instrument name

int MusicalInstrument:OrchestraSection

Section of the orchestra.

int MusicalInstrument:MidiSection

MIDI section

MusicalInstrument:GeographicOrigin

For "ethnic" instrument, their geographical origin

table MusicalInstrument:Sounds

Gold Base sounds.

3-dimension tables:

  • Sounds["basic"]: by default
  • Sounds["legato" | "staccato" | ...]: legato/stacatto/... variants, if any (some violins, clarinet and brass)
  • Sounds["stops"]: stops for organs, accordions
  • Sounds["duplicate"]: some drumkit sounds are duplicated, the firsts are "basic", the duplicates are marked as "duplicate"
Sounds["basic"][1234] = "gold sound name", from MSSounds by default, but can be overwritten. Some subtables may be nil, so be careful browsing!

bool MusicalInstrument:IsVolumeDecays

Does volume decays?

int MusicalInstrument:MaxSimultaneousNotes

Maximum number of simultaneously played notes: 1=monophonic, 2==polyphonic.

Pianos may have 51 (white keys in a HUGE cluster), Marimba/Vibraphone may have 4 (2 sticks in each hand), clarinet is monophonic (MaxSimultaneousNotes=1).

Methods

MusicalInstrument:getSounds(bool excludeDuplicateDrums)

Get the list of sounds for this instrument

ParameterTypeDefaultDescription
excludeDuplicateDrumsboolfalseSome drumkits may use the same sounds, i.e. the same big and small gongs, same caxixi for all drumkits. This param to true to get a shortened list.
Return
table: 2D table: t[1].ID is the soundID, t[1].Name the name.

MusicalInstrument:isPolyphonic()

Is instrument polyphonic?

Return
bool:

MusicalInstrument:isMonophonic()

Is instrument monophonic?

Return
bool: