Lomse library. API documentation  0.30.0
ASoundInfo Class Reference
Inheritance diagram for ASoundInfo:
AObject

Detailed Description

ASoundInfo class contains and manages the information for one sound, such as its MIDI values. It always contains a AMidiInfo object. An AInstrument always have at least one sound but can have more. For each sound there is a ASoundInfo object and its associated AMidiInfo object.

MusicXML files and other can contain additional information about the sound for an instrument, such as performance data (a solo instrument or an ensemble?), the virtual instrument used for the sound, or the play technique to use for all notes played in the associated instrument. This information is stored in the ASoundInfo object when the score is imported from MusicXML files. But this information is not yet used in lomse sound API.

Warning
This documentation is incomplete. The user API for the document internal model is currently being defined and, thus, for this class, only some methods have been defined.

Public Member Functions

ImoSoundInfo * internal_object () const
 
AMidiInfo midi_info () const
 
- Public Member Functions inherited from AObject
 AObject ()
 
bool is_valid () const
 
ImoObj * internal_object () const
 
ImoId object_id () const
 
const std::string & object_name () const
 
ADocument owner_document () const
 
ADynamic downcast_to_dynamic () const
 
AInstrument downcast_to_instrument () const
 
AInstrGroup downcast_to_instr_group () const
 
ALink downcast_to_link () const
 
AList downcast_to_list () const
 
AParagraph downcast_to_paragraph () const
 
AScore downcast_to_score () const
 
ATextItem downcast_to_text_item () const
 
bool is_anonymous_block () const
 
bool is_button () const
 
bool is_content () const
 
bool is_control () const
 
bool is_dynamic () const
 
bool is_heading () const
 
bool is_image () const
 
bool is_inline_wrapper () const
 
bool is_instrument () const
 
bool is_instr_group () const
 
bool is_link () const
 
bool is_list () const
 
bool is_list_item () const
 
bool is_midi_info () const
 
bool is_multicolumn () const
 
bool is_music_data () const
 
bool is_paragraph () const
 
bool is_score () const
 
bool is_sound_info () const
 
bool is_table () const
 
bool is_table_cell () const
 
bool is_table_body () const
 
bool is_table_head () const
 
bool is_table_row () const
 
bool is_text_item () const
 

Member Function Documentation

◆ internal_object()

ImoSoundInfo * internal_object ( ) const

Transitional, to facilitate migration to the new public API. Notice that this method will be removed in future so, please, if you need to use this method open an issue at https://github.com/lenmus/lomse/issues explaining the need, so that the public API could be fixed and your app. would not be affected in future when this method is removed.

◆ midi_info()

AMidiInfo midi_info ( ) const

Provides access to the MIDI information for this instrument. MIDI info always exists. By default, when no MIDI information is provided in the source file or when programatically building a score, MIDI information is initialized as follows:

device name = ""
program name = ""
bank = 1
port = 0        port 0 is invalid. Means "not initialized"
channel = 0     channel 0 is invalid. Means "not initialized"
program = 1
unpitched = 0
volume = 1.0    maximum volume
pan = 0         in front, centered
elevation = 0   at listener head level

When MIDI information has been specified when building the score, notice that 'port', 'channel' or both could have not been specified and, thus, any of them can still in "not initialized". In these cases, port and channel are automatically assigned right values when the score is finished, that is, when invoking AScore::end_of_changes() method. The algorithm, in method MidiAssigner::assign_port_and_channel(), ensures that each instrument is assigned a unique combination (port, channel) for all instruments with port or channel containig the "not initialized" value.