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:
- if instrument is monophonic or polyphonic,
- how many simultaneous notes are playable,
- it's common ambitus,
- glissando type: continuous, white keys, semi-tones...
- if pitch and velocity can change after note's attack
- it's classification in orchestra and in general MIDI
- ...
Section
Section | Summary |
---|---|
MusicalInstruments | Musical instruments constants, Map and static functions |
Summary
Field | Type | Summary |
---|---|---|
GeographicOrigin | For "ethnic" instrument, their geographical origin | |
ID | int | Identifier of the instrument, one of INSTR_* constants. |
IsVolumeDecays | bool | Does volume decays? |
MaxSimultaneousNotes | int | Maximum number of simultaneously played notes: 1=monophonic, 2==polyphonic. |
MidiSection | int | MIDI section |
Name | string | Instrument name |
OrchestraSection | int | Section of the orchestra. |
Sounds | table | Gold Base sounds. |
Return type | Function and summary |
---|---|
table | getSounds(bool excludeDuplicateDrums) Get the list of sounds for this instrument |
bool | isMonophonic() Is instrument monophonic? |
bool | isPolyphonic() 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 defaultSounds["legato" | "staccato" | ...]
: legato/stacatto/... variants, if any (some violins, clarinet and brass)Sounds["stops"]
: stops for organs, accordionsSounds["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
Parameter | Type | Default | Description |
---|---|---|---|
excludeDuplicateDrums | bool | false | Some 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.