Class MusicalEnsemble

A musical ensemble, or group, or band, is a set of instruments.

See
https://en.wikipedia.org/wiki/Musical_ensemble
https://fr.wikipedia.org/wiki/Ensemble_musical

Section

SectionSummary
InstrumentsClassificationsMusical instrument classifications

Summary

FieldTypeSummary
CategorystringCategory of the ensemble, e.g.
IDstringMusicalEnsemble identifier: name in English
InstrumentstableList of instruments of the ensemble.
NamestringTranslated name of the ensemble
Return typeFunction and summary
MusicalEnsemblenew(string name, string cateogry)
Instantiate a musical ensemble (band, orchestra).
MusicalEnsembleadd(int instrID, string name, string shortName, string staffTemplate)
Add an instrument to the musical ensemble
MusicalEnsembleaddSection(string sectType, string sectID)
Add, in one call, all the instruments of a midi or orchestra section.
booleancontains(instr)
Does this ensemble contains the instrument?

Fields

string MusicalEnsemble:ID

MusicalEnsemble identifier: name in English

string MusicalEnsemble:Name

Translated name of the ensemble

string MusicalEnsemble:Category

Category of the ensemble, e.g.

"Classical/Chamber music"

table MusicalEnsemble:Instruments

List of instruments of the ensemble.

Each entry of the table is a table:

  • ID: MusicalInstrument id,
  • Name: if provided, specific name in this ensemble, e.g. "Chocalho" is the name for shaker in Batucada,
  • ShortName: if provided, spectific short name in this ensemble,
  • StaffTemplate: if provided, staff template.

Methods

MusicalEnsemble:new(string name, string cateogry)

Instantiate a musical ensemble (band, orchestra).

ParameterTypeDefaultDescription
namestring name
cateogrystring Category of the ensemble, e.g. "Classical/Chamber music")
Return
MusicalEnsemble: MusicalEnsemble

MusicalEnsemble:add(int instrID, string name, string shortName, string staffTemplate)

Add an instrument to the musical ensemble

ParameterTypeDefaultDescription
instrIDint One of INSTR_* constants.
namestringnilIf provided, specific name for this instrument in this ensemble, e.g. "Chocalho" for shaker in Batucada.
shortNamestringnilIf provided, specific short name for this instrument staff.
staffTemplatestringnilIf provided, staff template file name.
Return
MusicalEnsemble: self

MusicalEnsemble:addSection(string sectType, string sectID)

Add, in one call, all the instruments of a midi or orchestra section.

Not as fast as individual :add(...) calls, but good way to add all drumkit instruments for example.

ParameterTypeDefaultDescription
sectTypestring "midi" or "orch"
sectIDstring One of MIDI_SECTION_* or ORCH_SECTION_* constants.
Return
MusicalEnsemble: self
Example

myEnsemble:addSection("midi", MIDI_SECTION_DRUMKITS)

MusicalEnsemble:contains(instr)

Does this ensemble contains the instrument?

ParameterTypeDefaultDescription
instr  , or int it's ID.
Return
boolean: true if yes, nil if false.