File SMInstruments.mys

Instruments database: section, musical instrument characteristics and Gold sounds

Table of contents

  1. Loading and performance
  2. Why?
  3. Classification
  4. The database
  5. MusicalInstrument vs Instrument
  6. Properties

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)
  • ...
All these are... pianos! They share same characteristics, ambitus, playing techniques (articulations, phrasing...). Only the sounds differ.

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:

  1. 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.
  2. 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.

Author
Sylvain Machefert

Classes

ClassSummary
CourseA course is one string or two or more adjacent strings that are closely spaced relative to the other strings.
MusicalEnsembleA musical ensemble, or group, or band, is a set of instruments.
MusicalInstrumentMusicalInstrument is an object that regroup several sounds sharing same characteristics, playing techniques, sound capabilities.
NeckNeck definition of string instrument (violin, guitar, bass, ukulele, bouzouki...).
SoundA sound is a variant of an instrument.

Sections

SectionSummary
InstrumentsClassificationsMusical instrument classifications
MusicalInstrumentsMusical instruments constants, Map and static functions

Summary

ConstantTypeSummary
FAMILY_ACCORDIONSintAccordions family, including Bandoneon, Concertina.
FAMILY_BALALAIKASintBalalaikas family (from prima to contrabass)
FAMILY_BANJOSintBanjos family
FAMILY_BASSOONSintBassoons family, from alto to contrabass
FAMILY_BOUZOUKISintBouzoukis family (baglama, tzoura, bouzouki)
FAMILY_CAPPED_REEDSintCapped reeds: cornamuse, Crumhorn, kelhorn, Rauschpfeife.
FAMILY_CHARANGOSintCharangos family
FAMILY_CHORAL_VOICESintChoral voices family
FAMILY_CITTERNSintCiterns family
FAMILY_CLARINETSintClarinets family
FAMILY_CORNETTSintCornetts family
FAMILY_DOMRASintDomras (russian 3-4 strings lutes) family.
FAMILY_DRUMKITintDrumkit is a s et of drums: kick, snare, toms, cymbals.
FAMILY_DUDUKSintDuduk and duduk bass
FAMILY_DULCIMERSintHammered dulcimers, struck stringes.
FAMILY_ERHUSintHuqin (chinese bowed strings) family.
FAMILY_FLAGEOLETSintFlageolets family
FAMILY_FLUTESintFlutes family (from piccolo to bass)
FAMILY_GUITARSintGuitars family (classical, flamenco, jazz, electric, bass)
FAMILY_HARMONICASintHarmonicas family
FAMILY_HARPSintHarps family.
FAMILY_HORNSintHorns family
FAMILY_LONG_NECK_LUTESintLong-neck lutes family, from Middle-East and Turkic cultures.
FAMILY_LUTESintLutes family
FAMILY_LYRESintLyras/lyres family
FAMILY_MANDOLINSintMandolins family (from piccolo to mandobass, algerian mandole and bandolim)
FAMILY_OBOESintOboes family, with English horn
FAMILY_OCARINASintOcarinas family
FAMILY_OPERA_VOICESintOpera voices family
FAMILY_PORTUGUESE_VIOLASintPortuguese violas (guitars body) family, not to confuse with portuguese guitar which is part of cittern family.
FAMILY_RECORDERSintRecorders family (from sopranino to bass)
FAMILY_RUANSintRuan (chinese lute) family.
FAMILY_SARRUSOPHONESintSarrusophones family.
FAMILY_SAXHORNSintSaxhorns family
FAMILY_SAXOPHONESintSaxophones family (from soprano to baryton)
FAMILY_SERPENTSintSerpents and ophicleides family
FAMILY_SHAWMSintShawms family
FAMILY_SHENGSintChinese Sheng family
FAMILY_TAMBURICAS Tamburicas family, croatian, serbian and hungarian plucked strings.
FAMILY_TROMBONESintTrombones family
FAMILY_TRUMPETSintTrumpets family
FAMILY_TUBASintTubas family
FAMILY_UKULELESintUkuleles family
FAMILY_VIOLINSintViolins family (from violin to double bass)
FAMILY_VIOLSintViols, viola da gamba family
FAMILY_WHISTLESintWhistles (tin, low, slide...) family
FAMILY_ZITHERSintZithers family, plucked strings on a flat and large body.
MIDI_SECTION_BASSintMIDI section: basses
MIDI_SECTION_BRASSintMIDI section: brass
MIDI_SECTION_CHROMATIC_PERCSintMIDI section: chromatics percussions
MIDI_SECTION_DRUMKITSintMIDI section: drumkits More percussive, mostly non-pitched.
MIDI_SECTION_EFFECTSintMIDI section: effects (sounds & noise)
MIDI_SECTION_ENSEMBLESintMIDI section: ensembles
MIDI_SECTION_ETHNICSintMIDI section: ethnics
MIDI_SECTION_GUITARSintMIDI section: guitars
MIDI_SECTION_ORGANSintMIDI section: organs
MIDI_SECTION_OTHERSintMIDI section: unknown/unsorted
MIDI_SECTION_PERCUSSIONSintMIDI section: percussives
MIDI_SECTION_PIANOSintMIDI section; pianos
MIDI_SECTION_PIPESintMIDI section: pipes
MIDI_SECTION_REEDSintMIDI section: reeds
MIDI_SECTION_STRINGSintMIDI section solo strings & orchestral instruments
MIDI_SECTION_SYNTH_FXintMIDI section: synth effects
MIDI_SECTION_SYNTH_LEADS=intMIDI section: synth leads
MIDI_SECTION_SYNTH_PADSintMIDI section: synth pads
MUSICAL_ENSEMBLESMapMap of MusicalEnsemble objects.
MUSICAL_INSTRUMENTSMapMap of MusicalInstrument objects.
ORCH_SECTION_ANALOGICSintAnalogic instruments of the orchestra: Moog, Yamaha DX7, Roland AX, synths
ORCH_SECTION_BOWED_STRINGSintBowed strings section of the orchestra: for violins, hurdy-gurdy...
ORCH_SECTION_BRASSintBrass section of the orchestra: for trumpet, trombone.
ORCH_SECTION_DOUBLE_REEDSintDouble-reeds section of the orchestra: for oboe, bassoon, bombarde, some bagpipes, duduk...
ORCH_SECTION_ELECTRONICSintElectronic (non analogic) instruments of the orchestra: Theremine, Martenot waves.
ORCH_SECTION_ELECTRO_MECHANICS=intElectro mechanics instruments of the orchestra: for Hammond organ, Rhodes piano, Wurlitzer, clavinet...
ORCH_SECTION_FLUTESintFlutes section of the orchestra: for flute, church organ, recorders, ocarina, tin whistle...
ORCH_SECTION_FREE_REEDS=intFree-reeds section of the orchestra: for harmonica, accordion, harmonium, sheng, guimbarde...
ORCH_SECTION_IDIOPHONESintIdiophone percussions section of the orchestra: cymbals, triangle, claves, maracas...
ORCH_SECTION_MECHANICALSintMecanical instruments of the orchestra: for street organ, musical box
ORCH_SECTION_MEMBRANOPHONESintMembranophone (skin) percussions section of the orchestra: bass, snares and toms, djembe, cuica
ORCH_SECTION_OTHERSintUnsorted instruments of the orchestra
ORCH_SECTION_OTHER_PERCSintOther (auxiliary, aerophones) percussion section of the orchestra: sirens, whistles...
ORCH_SECTION_PITCHED_PERCSintPitched percussions section of the orchestra: for glockenspiel, celesta, xylophone, steeldrums, bells...
ORCH_SECTION_PLUCKED_STRINGSintPlucked strings section of the orchestra: for guitars, harpsichord, harp...
ORCH_SECTION_SINGLE_REEDSintSingle-reed section of the orchestra: for clarinet, sax, xaphoon, alboka...
ORCH_SECTION_SOUNDSintInstrument sounds and effects
ORCH_SECTION_STRUCK_STRINGSintStruck strings section of the orchestra: for piano, cymbalum, yangqin, berimbau...
ORCH_SECTION_VOICESintVoice section of the orchestra: for choirs Oooh or Aaah...
Return typeFunction and summary
MapGetAllFamilies()
Get the list of all families.
MapGetAllMidiSections()
Get the list of all MIDI sections.
MapGetAllOrchestralSections()
Get the list of all sections of the orchestra.
CollectionGetAlphabetOfInstruments()
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.
MusicalEnsembleGetEnsembleByName(string eName)
Find a MusicalEnsemble by it's name
CollectionGetEraListOfInstruments()
Get the list of eras of musical instruments.
CollectionGetGeographicListOfInstruments()
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, SoundGetInstrumentBySoundID(SoundID)
Search the MusicalInstrument corresponding to Instrument.SoundID.
CollectionGetInstrumentsByEra(string era)
Returns a Collection of MusicalInstrument by their era, ordered alphabetically
CollectionGetInstrumentsByFamily(int family)
Returns a Collection of MusicalInstrument that are member of family family.
CollectionGetInstrumentsByFirstLetter(string letter)
Returns a Collection of MusicalInstrument by their first letter, ordered alphabetically
CollectionGetInstrumentsByGeographicOrigin(string country)
Returns a Collection of MusicalInstrument by their geographical origin, ordered alphabetically
CollectionGetInstrumentsByMidiSection(int midiSection)
Returns a Collection of MusicalInstrument that are member of MIDI section midiSection.
CollectionGetInstrumentsByOrchestraSection(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...

See
https://fr.wikipedia.org/wiki/Instrument_%C3%A0_cordes_frott%C3%A9es

int ORCH_SECTION_PLUCKED_STRINGS

Plucked strings section of the orchestra: for guitars, harpsichord, harp...

See
https://fr.wikipedia.org/wiki/Instrument_%C3%A0_cordes_pinc%C3%A9es

int ORCH_SECTION_STRUCK_STRINGS

Struck strings section of the orchestra: for piano, cymbalum, yangqin, berimbau...

See
https://fr.wikipedia.org/wiki/Instrument_%C3%A0_cordes_frapp%C3%A9es

int ORCH_SECTION_FLUTES

Flutes section of the orchestra: for flute, church organ, recorders, ocarina, tin whistle...

See
https://fr.wikipedia.org/wiki/Fl%C3%BBte

int ORCH_SECTION_FREE_REEDS=

Free-reeds section of the orchestra: for harmonica, accordion, harmonium, sheng, guimbarde...

See
https://fr.wikipedia.org/wiki/Instrument_%C3%A0_anche_libre

int ORCH_SECTION_SINGLE_REEDS

Single-reed section of the orchestra: for clarinet, sax, xaphoon, alboka...

See
https://fr.wikipedia.org/wiki/Instrument_%C3%A0_anche_simple

int ORCH_SECTION_DOUBLE_REEDS

Double-reeds section of the orchestra: for oboe, bassoon, bombarde, some bagpipes, duduk...

See
https://fr.wikipedia.org/wiki/Instrument_%C3%A0_anche_double

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...

See
https://en.wikipedia.org/wiki/Pitched_percussion

int ORCH_SECTION_MEMBRANOPHONES

Membranophone (skin) percussions section of the orchestra: bass, snares and toms, djembe, cuica

See
https://fr.wikipedia.org/wiki/Membranophone

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

See
https://fr.wikipedia.org/wiki/Instrument_de_musique_m%C3%A9canique

int ORCH_SECTION_ELECTRO_MECHANICS=

Electro mechanics instruments of the orchestra: for Hammond organ, Rhodes piano, Wurlitzer, clavinet...

See
https://fr.wikipedia.org/wiki/Instrument_%C3%A9lectrom%C3%A9canique

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_PERCUSSIONS

MIDI section: percussives

See
MIDI_SECTION_DRUMKITS

int MIDI_SECTION_EFFECTS

MIDI section: effects (sounds & noise)

int MIDI_SECTION_DRUMKITS

MIDI section: drumkits More percussive, mostly non-pitched.

See
MIDI_SECTION_PERCUSSIONS

int MIDI_SECTION_OTHERS

MIDI section: unknown/unsorted

int FAMILY_ACCORDIONS

Accordions family, including Bandoneon, Concertina.

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_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).

See
https://en.wikipedia.org/wiki/Hammered_dulcimer#Around_the_world

int FAMILY_ERHUS

Huqin (chinese bowed strings) family.

See
https://en.wikipedia.org/wiki/Huqin

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_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_RECORDERS

Recorders family (from sopranino to bass)

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_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.

See
https://en.wikipedia.org/wiki/Zither
https://fr.wikipedia.org/wiki/Cithare

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.

ParameterTypeDefaultDescription
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

ParameterTypeDefaultDescription
eNamestring eName
Return
MusicalEnsemble: nil if not found.

GetInstrumentsByOrchestraSection(int orchSection)

Returns a Collection of MusicalInstrument that are member of orchestral section orchSection.

ParameterTypeDefaultDescription
orchSectionint 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.

ParameterTypeDefaultDescription
midiSectionint 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.

ParameterTypeDefaultDescription
familyint 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

ParameterTypeDefaultDescription
letterstring 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

ParameterTypeDefaultDescription
countrystring country
Return
Collection: Collection of MusicalInstrument objects

GetInstrumentsByEra(string era)

Returns a Collection of MusicalInstrument by their era, ordered alphabetically

ParameterTypeDefaultDescription
erastring era
Return
Collection: Collection of MusicalInstrument objects