lenmus / lomse

A C++ library for rendering, editing and playing back music scores.
MIT License
120 stars 28 forks source link

Add mute information to notes and suppress playback for muted notes #362

Closed cecilios closed 2 years ago

cecilios commented 2 years ago

Lomse internal model distinguishes between elements used for sound information and elements used for notation information.

For display, visibility of any note is controlled by methods is_visible() and set_visible(). But for playback there is not any method to mute a note as all this was waiting to implement playback techniques.

This PR adds methods ImoNote::mute() and ImoNote::is_muted() to control notes playback. In preparation for the future implementation of playback techniques, method ImoNote::mute(EMuteType value) receives as parameter not a boolean but a value from enum EMuteType that defines different mute techniques. For now, any value different from k_mute_off causes to suppress playback for the affected note.

MIDI events generation has been reviewed to ensure that no MIDI events are generated for muted notes.

This PR closes #360