File SMInstruments.mys
Instruments database: section, musical instrument characteristics and Gold sounds
Table of contents
Loading and performance
SMInstruments.mys is NOT included when you Include "SMUtils"
.
Notes about performances:
- In debug mode, first load can take 40 seconds, a progress bar is shown. In Run mode, it taks about 1 second :)
- At first launch, and after soundbase or language change, a cache is built, abpprox 20 seconds in DebugMode.
- Once cached, debug mode takes 10 seconds to load the cache, with no progressbar, and run mode takes 50 milliseconds.
- So it's recommanded to run scripts that need instruments, instead of debuging them. See Debug section to print logs on console.
Why?
In MIDI section "Pianos", we have, in Gold base, a lot of pianos sounds:
- Grand Piano 1 and 2
- Softs pianos
- Classical
- Natural upright (recorded by myself, hehe)
- Honky-tonk (often badly maintained and out of tune pianos in bars)
- ...
We also have MIDI section "Organs" which contains very different instruments:
- Pipe organ / church organ (which are mainly flutes/pipes)
- Electro-mechanicals organs such as Hammond, theater organ...
- Accordions, harmonicas and harmoniums which are free-reeds instruments
- Street organ which is mechanical
They have very different characteristics and playing capabilities!
...And we have similar instruments scattered in several MIDI sections: pianos, cymbalums (from Hungary) and yangqin (from China) are all struck strings. We find them in Pianos, chromatic percussions, and strings MIDI sections!
That's why I created MusicalInstrument objects and two main classifications.
Classification
All musical instruments are classified in two ways:
- MIDI section (
MIDI_SECTION_*
constants) which are more or less following the General MIDI. In Harmony these are the "Instrument kind", left side column in "Edit instrument" dialog. - Their family in orchestra (
ORCH_SECTION_*
constants), such as:- Bowed strings
- Plucked strings
- Struck strings
- Single-reeds
- Double-reeds
- Brass
- Pitched percussions
- ... and even mechanicals, electronics, analogics.
A portion of them are classified by family, e.g. Violin, Viola, Cello are in "Violin" family, soprano, alto, baritone and tenor sax are in "Sax" family...
For ethnic music, I also added to some instruments the geographical origin(s).
In the Instrument Picker (still under development as of January 2025), you'll also find an alphabetical index.
The database
More than 500 instruments, their properties, pictures, ranges and list of sound make the database too strong to be displayed in this page.
Browse the MyrScript SMCore instruments database.
NOTE: each instrument has a constant INSTR_*, not present in the list below, nor in the
SMCore index. Constant name is present in database.
MusicalInstrument vs Instrument
Instrument is a MyrScript object that represent the sound played by one staff (or one of its rules),
- the output engine (Digital, MyriadHQ, MIDI, VST...)
- The sound (in Gold base, user-defined),
- Volume, panning, vibrato, tremolo, FXProcessor and transposition
MusicalInstrument is a higher abstraction level above that.
Properties
Properties will be added as necessary for coming scripts. For each MusicalInstrument you can get:
- List of Gold sounds
- Playing characteristics if known: common tessiture, polyphonic or monophonic...
- Section in the orchestra
- MIDI section
- Family
- Geographic origin(s)
- ...
Some functions allow you to find the MusicalInstrument from a sound ID (constant in MSSounds), find the instruments by section.
- Sylvain Machefert
Classes
Class | Summary |
---|---|
Course | A course is one string or two or more adjacent strings that are closely spaced relative to the other strings. |
MusicalEnsemble | A musical ensemble, or group, or band, is a set of instruments. |
MusicalInstrument | MusicalInstrument is an object that regroup several sounds sharing same characteristics, playing techniques, sound capabilities. |
Neck | Neck definition of string instrument (violin, guitar, bass, ukulele, bouzouki...). |
Sound | A sound is a variant of an instrument. |
Sections
Section | Summary |
---|---|
InstrumentsClassifications | Musical instrument classifications |
MusicalInstruments | Musical instruments constants, Map and static functions |
Summary
Constant | Type | Summary |
---|---|---|
FAMILY_ACCORDIONS | int | Accordions family, including Bandoneon, Concertina. |
FAMILY_BALALAIKAS | int | Balalaikas family (from prima to contrabass) |
FAMILY_BANJOS | int | Banjos family |
FAMILY_BASSOONS | int | Bassoons family, from alto to contrabass |
FAMILY_BOUZOUKIS | int | Bouzoukis family (baglama, tzoura, bouzouki) |
FAMILY_CAPPED_REEDS | int | Capped reeds: cornamuse, Crumhorn, kelhorn, Rauschpfeife. |
FAMILY_CHARANGOS | int | Charangos family |
FAMILY_CHORAL_VOICES | int | Choral voices family |
FAMILY_CITTERNS | int | Citerns family |
FAMILY_CLARINETS | int | Clarinets family |
FAMILY_CORNETTS | int | Cornetts family |
FAMILY_DOMRAS | int | Domras (russian 3-4 strings lutes) family. |
FAMILY_DRUMKIT | int | Drumkit is a s et of drums: kick, snare, toms, cymbals. |
FAMILY_DUDUKS | int | Duduk and duduk bass |
FAMILY_DULCIMERS | int | Hammered dulcimers, struck stringes. |
FAMILY_ERHUS | int | Huqin (chinese bowed strings) family. |
FAMILY_FLAGEOLETS | int | Flageolets family |
FAMILY_FLUTES | int | Flutes family (from piccolo to bass) |
FAMILY_GUITARS | int | Guitars family (classical, flamenco, jazz, electric, bass) |
FAMILY_HARMONICAS | int | Harmonicas family |
FAMILY_HARPS | int | Harps family. |
FAMILY_HORNS | int | Horns family |
FAMILY_LONG_NECK_LUTES | int | Long-neck lutes family, from Middle-East and Turkic cultures. |
FAMILY_LUTES | int | Lutes family |
FAMILY_LYRES | int | Lyras/lyres family |
FAMILY_MANDOLINS | int | Mandolins family (from piccolo to mandobass, algerian mandole and bandolim) |
FAMILY_OBOES | int | Oboes family, with English horn |
FAMILY_OCARINAS | int | Ocarinas family |
FAMILY_OPERA_VOICES | int | Opera voices family |
FAMILY_PORTUGUESE_VIOLAS | int | Portuguese violas (guitars body) family, not to confuse with portuguese guitar which is part of cittern family. |
FAMILY_RECORDERS | int | Recorders family (from sopranino to bass) |
FAMILY_RUANS | int | Ruan (chinese lute) family. |
FAMILY_SARRUSOPHONES | int | Sarrusophones family. |
FAMILY_SAXHORNS | int | Saxhorns family |
FAMILY_SAXOPHONES | int | Saxophones family (from soprano to baryton) |
FAMILY_SERPENTS | int | Serpents and ophicleides family |
FAMILY_SHAWMS | int | Shawms family |
FAMILY_SHENGS | int | Chinese Sheng family |
FAMILY_TAMBURICAS | Tamburicas family, croatian, serbian and hungarian plucked strings. | |
FAMILY_TROMBONES | int | Trombones family |
FAMILY_TRUMPETS | int | Trumpets family |
FAMILY_TUBAS | int | Tubas family |
FAMILY_UKULELES | int | Ukuleles family |
FAMILY_VIOLINS | int | Violins family (from violin to double bass) |
FAMILY_VIOLS | int | Viols, viola da gamba family |
FAMILY_WHISTLES | int | Whistles (tin, low, slide...) family |
FAMILY_ZITHERS | int | Zithers family, plucked strings on a flat and large body. |
MIDI_SECTION_BASS | int | MIDI section: basses |
MIDI_SECTION_BRASS | int | MIDI section: brass |
MIDI_SECTION_CHROMATIC_PERCS | int | MIDI section: chromatics percussions |
MIDI_SECTION_DRUMKITS | int | MIDI section: drumkits More percussive, mostly non-pitched. |
MIDI_SECTION_EFFECTS | int | MIDI section: effects (sounds & noise) |
MIDI_SECTION_ENSEMBLES | int | MIDI section: ensembles |
MIDI_SECTION_ETHNICS | int | MIDI section: ethnics |
MIDI_SECTION_GUITARS | int | MIDI section: guitars |
MIDI_SECTION_ORGANS | int | MIDI section: organs |
MIDI_SECTION_OTHERS | int | MIDI section: unknown/unsorted |
MIDI_SECTION_PERCUSSIONS | int | MIDI section: percussives |
MIDI_SECTION_PIANOS | int | MIDI section; pianos |
MIDI_SECTION_PIPES | int | MIDI section: pipes |
MIDI_SECTION_REEDS | int | MIDI section: reeds |
MIDI_SECTION_STRINGS | int | MIDI section solo strings & orchestral instruments |
MIDI_SECTION_SYNTH_FX | int | MIDI section: synth effects |
MIDI_SECTION_SYNTH_LEADS= | int | MIDI section: synth leads |
MIDI_SECTION_SYNTH_PADS | int | MIDI section: synth pads |
MUSICAL_ENSEMBLES | Map | Map of MusicalEnsemble objects. |
MUSICAL_INSTRUMENTS | Map | Map of MusicalInstrument objects. |
ORCH_SECTION_ANALOGICS | int | Analogic instruments of the orchestra: Moog, Yamaha DX7, Roland AX, synths |
ORCH_SECTION_BOWED_STRINGS | int | Bowed strings section of the orchestra: for violins, hurdy-gurdy... |
ORCH_SECTION_BRASS | int | Brass section of the orchestra: for trumpet, trombone. |
ORCH_SECTION_DOUBLE_REEDS | int | Double-reeds section of the orchestra: for oboe, bassoon, bombarde, some bagpipes, duduk... |
ORCH_SECTION_ELECTRONICS | int | Electronic (non analogic) instruments of the orchestra: Theremine, Martenot waves. |
ORCH_SECTION_ELECTRO_MECHANICS= | int | Electro mechanics instruments of the orchestra: for Hammond organ, Rhodes piano, Wurlitzer, clavinet... |
ORCH_SECTION_FLUTES | int | Flutes section of the orchestra: for flute, church organ, recorders, ocarina, tin whistle... |
ORCH_SECTION_FREE_REEDS= | int | Free-reeds section of the orchestra: for harmonica, accordion, harmonium, sheng, guimbarde... |
ORCH_SECTION_IDIOPHONES | int | Idiophone percussions section of the orchestra: cymbals, triangle, claves, maracas... |
ORCH_SECTION_MECHANICALS | int | Mecanical instruments of the orchestra: for street organ, musical box |
ORCH_SECTION_MEMBRANOPHONES | int | Membranophone (skin) percussions section of the orchestra: bass, snares and toms, djembe, cuica |
ORCH_SECTION_OTHERS | int | Unsorted instruments of the orchestra |
ORCH_SECTION_OTHER_PERCS | int | Other (auxiliary, aerophones) percussion section of the orchestra: sirens, whistles... |
ORCH_SECTION_PITCHED_PERCS | int | Pitched percussions section of the orchestra: for glockenspiel, celesta, xylophone, steeldrums, bells... |
ORCH_SECTION_PLUCKED_STRINGS | int | Plucked strings section of the orchestra: for guitars, harpsichord, harp... |
ORCH_SECTION_SINGLE_REEDS | int | Single-reed section of the orchestra: for clarinet, sax, xaphoon, alboka... |
ORCH_SECTION_SOUNDS | int | Instrument sounds and effects |
ORCH_SECTION_STRUCK_STRINGS | int | Struck strings section of the orchestra: for piano, cymbalum, yangqin, berimbau... |
ORCH_SECTION_VOICES | int | Voice section of the orchestra: for choirs Oooh or Aaah... |
Return type | Function and summary |
---|---|
Map | GetAllFamilies() Get the list of all families. |
Map | GetAllMidiSections() Get the list of all MIDI sections. |
Map | GetAllOrchestralSections() Get the list of all sections of the orchestra. |
Collection | GetAlphabetOfInstruments() Get the alphabet of first letter of all musical instruments The Collection is built each time this function is called, so it's recommanded to store the result in a variable and reuse it while needed. |
MusicalEnsemble | GetEnsembleByName(string eName) Find a MusicalEnsemble by it's name |
Collection | GetEraListOfInstruments() Get the list of eras of musical instruments. |
Collection | GetGeographicListOfInstruments() Get the list of geographic origins of "ethnic" musical instruments The Collection is built each time this function is called, so it's recommanded to store the result in a variable and reuse it while needed. |
MusicalInstrument, Sound | GetInstrumentBySoundID(SoundID) Search the MusicalInstrument corresponding to Instrument.SoundID . |
Collection | GetInstrumentsByEra(string era) Returns a Collection of MusicalInstrument by their era, ordered alphabetically |
Collection | GetInstrumentsByFamily(int family) Returns a Collection of MusicalInstrument that are member of family family. |
Collection | GetInstrumentsByFirstLetter(string letter) Returns a Collection of MusicalInstrument by their first letter, ordered alphabetically |
Collection | GetInstrumentsByGeographicOrigin(string country) Returns a Collection of MusicalInstrument by their geographical origin, ordered alphabetically |
Collection | GetInstrumentsByMidiSection(int midiSection) Returns a Collection of MusicalInstrument that are member of MIDI section midiSection. |
Collection | GetInstrumentsByOrchestraSection(int orchSection) Returns a Collection of MusicalInstrument that are member of orchestral section orchSection. |
Constants
int ORCH_SECTION_BOWED_STRINGS
Bowed strings section of the orchestra: for violins, hurdy-gurdy...
int ORCH_SECTION_PLUCKED_STRINGS
Plucked strings section of the orchestra: for guitars, harpsichord, harp...
int ORCH_SECTION_STRUCK_STRINGS
Struck strings section of the orchestra: for piano, cymbalum, yangqin, berimbau...
int ORCH_SECTION_FLUTES
Flutes section of the orchestra: for flute, church organ, recorders, ocarina, tin whistle...
int ORCH_SECTION_FREE_REEDS=
Free-reeds section of the orchestra: for harmonica, accordion, harmonium, sheng, guimbarde...
int ORCH_SECTION_SINGLE_REEDS
Single-reed section of the orchestra: for clarinet, sax, xaphoon, alboka...
int ORCH_SECTION_DOUBLE_REEDS
Double-reeds section of the orchestra: for oboe, bassoon, bombarde, some bagpipes, duduk...
int ORCH_SECTION_BRASS
Brass section of the orchestra: for trumpet, trombone.
int ORCH_SECTION_VOICES
Voice section of the orchestra: for choirs Oooh or Aaah...
int ORCH_SECTION_PITCHED_PERCS
Pitched percussions section of the orchestra: for glockenspiel, celesta, xylophone, steeldrums, bells...
int ORCH_SECTION_MEMBRANOPHONES
Membranophone (skin) percussions section of the orchestra: bass, snares and toms, djembe, cuica
int ORCH_SECTION_IDIOPHONES
Idiophone percussions section of the orchestra: cymbals, triangle, claves, maracas...
int ORCH_SECTION_OTHER_PERCS
Other (auxiliary, aerophones) percussion section of the orchestra: sirens, whistles...
int ORCH_SECTION_MECHANICALS
Mecanical instruments of the orchestra: for street organ, musical box
int ORCH_SECTION_ELECTRO_MECHANICS=
Electro mechanics instruments of the orchestra: for Hammond organ, Rhodes piano, Wurlitzer, clavinet...
int ORCH_SECTION_ELECTRONICS
Electronic (non analogic) instruments of the orchestra: Theremine, Martenot waves.
int ORCH_SECTION_ANALOGICS
Analogic instruments of the orchestra: Moog, Yamaha DX7, Roland AX, synths
int ORCH_SECTION_SOUNDS
Instrument sounds and effects
int ORCH_SECTION_OTHERS
Unsorted instruments of the orchestra
int MIDI_SECTION_PIANOS
MIDI section; pianos
int MIDI_SECTION_CHROMATIC_PERCS
MIDI section: chromatics percussions
int MIDI_SECTION_ORGANS
MIDI section: organs
int MIDI_SECTION_GUITARS
MIDI section: guitars
int MIDI_SECTION_BASS
MIDI section: basses
int MIDI_SECTION_STRINGS
MIDI section solo strings & orchestral instruments
int MIDI_SECTION_ENSEMBLES
MIDI section: ensembles
int MIDI_SECTION_BRASS
MIDI section: brass
int MIDI_SECTION_REEDS
MIDI section: reeds
int MIDI_SECTION_PIPES
MIDI section: pipes
int MIDI_SECTION_SYNTH_LEADS=
MIDI section: synth leads
int MIDI_SECTION_SYNTH_PADS
MIDI section: synth pads
int MIDI_SECTION_SYNTH_FX
MIDI section: synth effects
int MIDI_SECTION_ETHNICS
MIDI section: ethnics
int MIDI_SECTION_EFFECTS
MIDI section: effects (sounds & noise)
int MIDI_SECTION_DRUMKITS
MIDI section: drumkits More percussive, mostly non-pitched.
int MIDI_SECTION_OTHERS
MIDI section: unknown/unsorted
int FAMILY_ACCORDIONS
Accordions family, including Bandoneon, Concertina.
int FAMILY_BALALAIKAS
Balalaikas family (from prima to contrabass)
int FAMILY_BANJOS
Banjos family
int FAMILY_BASSOONS
Bassoons family, from alto to contrabass
int FAMILY_BOUZOUKIS
Bouzoukis family (baglama, tzoura, bouzouki)
int FAMILY_CAPPED_REEDS
Capped reeds: cornamuse, Crumhorn, kelhorn, Rauschpfeife.
int FAMILY_CHARANGOS
Charangos family
int FAMILY_CHORAL_VOICES
Choral voices family
int FAMILY_CLARINETS
Clarinets family
int FAMILY_CORNETTS
Cornetts family
int FAMILY_DOMRAS
Domras (russian 3-4 strings lutes) family.
int FAMILY_DRUMKIT
Drumkit is a s et of drums: kick, snare, toms, cymbals.
int FAMILY_DUDUKS
Duduk and duduk bass
int FAMILY_DULCIMERS
Hammered dulcimers, struck stringes.
Not to confuse with mountain dulcimer (plucked).
int FAMILY_FLAGEOLETS
Flageolets family
int FAMILY_FLUTES
Flutes family (from piccolo to bass)
int FAMILY_GUITARS
Guitars family (classical, flamenco, jazz, electric, bass)
int FAMILY_HARMONICAS
Harmonicas family
int FAMILY_HORNS
Horns family
int FAMILY_LONG_NECK_LUTES
Long-neck lutes family, from Middle-East and Turkic cultures.
int FAMILY_LUTES
Lutes family
int FAMILY_MANDOLINS
Mandolins family (from piccolo to mandobass, algerian mandole and bandolim)
int FAMILY_OBOES
Oboes family, with English horn
int FAMILY_OCARINAS
Ocarinas family
int FAMILY_OPERA_VOICES
Opera voices family
int FAMILY_PORTUGUESE_VIOLAS
Portuguese violas (guitars body) family, not to confuse with portuguese guitar which is part of cittern family.
int FAMILY_RECORDERS
Recorders family (from sopranino to bass)
int FAMILY_RUANS
Ruan (chinese lute) family.
int FAMILY_SAXHORNS
Saxhorns family
int FAMILY_SAXOPHONES
Saxophones family (from soprano to baryton)
int FAMILY_SERPENTS
Serpents and ophicleides family
int FAMILY_SHENGS
Chinese Sheng family
FAMILY_TAMBURICAS
Tamburicas family, croatian, serbian and hungarian plucked strings.
int FAMILY_TROMBONES
Trombones family
int FAMILY_TRUMPETS
Trumpets family
int FAMILY_TUBAS
Tubas family
int FAMILY_UKULELES
Ukuleles family
int FAMILY_VIOLINS
Violins family (from violin to double bass)
int FAMILY_WHISTLES
Whistles (tin, low, slide...) family
int FAMILY_ZITHERS
Zithers family, plucked strings on a flat and large body.
Map MUSICAL_INSTRUMENTS
Map of MusicalInstrument objects.
Map MUSICAL_ENSEMBLES
Map of MusicalEnsemble objects.
Functions
GetInstrumentBySoundID(SoundID)
Search the MusicalInstrument corresponding to Instrument.SoundID
.
if MusicalInstrument is known, use the very faster MusicalInstrument:getSound(...)
to get the Sound object.
Parameter | Type | Default | Description |
---|---|---|---|
SoundID | Sound or int ID |
- Returns
- MusicalInstrument: nil if not found
- Sound: nil if not found
- See
- MusicalInstrument:getSound
GetAllOrchestralSections()
Get the list of all sections of the orchestra.
Returns a Map that is built each time this function is called, so it's recommanded to store the result in a variable and reuse it while needed.
- Return
- Map: Keys are ORCH_SECTION_* constants, values are translated names.
GetAllMidiSections()
Get the list of all MIDI sections.
Returns a Map that is built each time this function is called, so it's recommanded to store the result in a variable and reuse it while needed.
- Return
- Map: Keys are MIDI_SECTION_* constants, values are translated names.
GetAllFamilies()
Get the list of all families.
Returns a Map that is built each time this function is called, so it's recommanded to store the result in a variable and reuse it while needed.
- Return
- Map: Keys are FAMILY_* constants, values are translated names.
GetAlphabetOfInstruments()
Get the alphabet of first letter of all musical instruments The Collection is built each time this function is called, so it's recommanded to store the result in a variable and reuse it while needed.
- Return
- Collection: sorted collection
GetGeographicListOfInstruments()
Get the list of geographic origins of "ethnic" musical instruments The Collection is built each time this function is called, so it's recommanded to store the result in a variable and reuse it while needed.
- Return
- Collection: sorted collection of strings
GetEraListOfInstruments()
Get the list of eras of musical instruments.
The Collection is built each time this function is called, so it's recommanded to store the result in a variable and reuse it while needed.
- Return
- Collection: sorted collection of strings
GetEnsembleByName(string eName)
Find a MusicalEnsemble by it's name
Parameter | Type | Default | Description |
---|---|---|---|
eName | string | eName |
- Return
- MusicalEnsemble:
nil
if not found.
GetInstrumentsByOrchestraSection(int orchSection)
Returns a Collection of MusicalInstrument that are member of orchestral section orchSection.
Parameter | Type | Default | Description |
---|---|---|---|
orchSection | int | One of ORCH_SECTION_* constants |
- Return
- Collection: Collection of MusicalInstrument objects
GetInstrumentsByMidiSection(int midiSection)
Returns a Collection of MusicalInstrument that are member of MIDI section midiSection.
Parameter | Type | Default | Description |
---|---|---|---|
midiSection | int | One of MIDI_SECTION_* constants |
- Return
- Collection: Collection of MusicalInstrument objects
GetInstrumentsByFamily(int family)
Returns a Collection of MusicalInstrument that are member of family family.
Parameter | Type | Default | Description |
---|---|---|---|
family | int | One of FAMILY_SECTION_* constants |
- Return
- Collection: Collection of MusicalInstrument objects
GetInstrumentsByFirstLetter(string letter)
Returns a Collection of MusicalInstrument by their first letter, ordered alphabetically
Parameter | Type | Default | Description |
---|---|---|---|
letter | string | 1-char letter "A", "B"... |
- Return
- Collection: Collection of MusicalInstrument objects
GetInstrumentsByGeographicOrigin(string country)
Returns a Collection of MusicalInstrument by their geographical origin, ordered alphabetically
Parameter | Type | Default | Description |
---|---|---|---|
country | string | country |
- Return
- Collection: Collection of MusicalInstrument objects
GetInstrumentsByEra(string era)
Returns a Collection of MusicalInstrument by their era, ordered alphabetically
Parameter | Type | Default | Description |
---|---|---|---|
era | string | era |
- Return
- Collection: Collection of MusicalInstrument objects