Class MusicalEnsemble
A musical ensemble, or group, or band, is a set of instruments.
Section
Section | Summary |
---|---|
InstrumentsClassifications | Musical instrument classifications |
Summary
Field | Type | Summary |
---|---|---|
Category | string | Category of the ensemble, e.g. |
ID | string | MusicalEnsemble identifier: name in English |
Instruments | table | List of instruments of the ensemble. |
Name | string | Translated name of the ensemble |
Return type | Function and summary |
---|---|
MusicalEnsemble | new(string name, string cateogry) Instantiate a musical ensemble (band, orchestra). |
MusicalEnsemble | add(int instrID, string name, string shortName, string staffTemplate) Add an instrument to the musical ensemble |
MusicalEnsemble | addSection(string sectType, string sectID) Add, in one call, all the instruments of a midi or orchestra section. |
boolean | contains(instr) Does this ensemble contains the instrument? |
Fields
string MusicalEnsemble:ID
MusicalEnsemble identifier: name in English
string MusicalEnsemble:Name
Translated name of the ensemble
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).
Parameter | Type | Default | Description |
---|---|---|---|
name | string | name | |
cateogry | string | 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
Parameter | Type | Default | Description |
---|---|---|---|
instrID | int | One of INSTR_* constants. | |
name | string | nil | If provided, specific name for this instrument in this ensemble, e.g. "Chocalho" for shaker in Batucada. |
shortName | string | nil | If provided, specific short name for this instrument staff. |
staffTemplate | string | nil | If 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.
Parameter | Type | Default | Description |
---|---|---|---|
sectType | string | "midi" or "orch" | |
sectID | string | 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?
Parameter | Type | Default | Description |
---|---|---|---|
instr |
- Return
- boolean:
true
if yes,nil
if false.