musicaiz.structure.Instrument¶
- class musicaiz.structure.Instrument(program: Optional[int] = None, name: Optional[str] = None, family: Optional[str] = None, is_drum: Optional[bool] = None, general_midi: bool = True)[source]¶
- __init__(program: Optional[int] = None, name: Optional[str] = None, family: Optional[str] = None, is_drum: Optional[bool] = None, general_midi: bool = True)[source]¶
Instrument name or/and program must be provided.
If name is pprovided and no program is provided, the program will
be automatically set with the MIDI instrument program according to the instrument name. - If program is provided but no instrument name is provided, the instrument name will be automatically set with the MIDI instrument name according to the instrument program number. - If both instrument name and program number are provided, both values will be set as the input arguments (this is useful in case of personal definition of MIDI instrument programs) - If general_midi is False, then the program number and name provided will set the program and name attributes nad we won’t map the program to the instrument name nor viceversa according to general midi especification. - If general midi is False, we can also provide family if we know it, otherwise it’ll be set to none.
Methods
__init__
([program, name, family, is_drum, ...])Instrument name or/and program must be provided.