Feature request: add volume control to SampleEvent
hypeastrum opened this issue · 2 comments
I need to control volume of each (sample) event, to make accents. With current API I can achieve it with many samples with adjusted volume in buffers (memory overhead) or many instruments with different volumes (not flexible, code overhead).
I suggest to add volume control to all events, like in SynthEvent.
@hypeastrum Good point! Volume should be available to any type of AudioEvent. Each inheriting class can then decide how to interpret it (e.g. to swap samples depending on volume threshold / use different synthesis routines, or simply just scale the output volume (default), etc.).
I have added a branch "event-volumes" to the repository. In this branch _volume has moved to the BaseAudioEvent class and should be available to all AudioEvent-classes. You can use the getVolume() and setVolume( float ) methods everywhere. The mixing of the buffers into the AudioChannel has been updated to us the _volume value of the event.
If you can review whether this meets your request, we can merge it to master.
It works fine. Exact for my request.
On 9 нояб. 2015 г., at 12:09, Igor Zinken notifications@github.com wrote:
Good point! Volume should be available to any type of AudioEvent. Each inheriting class can then decide how to interpret it (e.g. to swap samples depending on volume threshold / use different synthesis routines, or simply just scale the output volume (default), etc.).
I have added a branch "event-volumes" to the repository. In this branch _volume has moved to the BaseAudioEvent class and should be available to all AudioEvent-classes. You can use the getVolume() and setVolume( float ) methods everywhere. The mixing of the buffers into the AudioChannel has been updated to us the _volume value of the event.
If you can review whether this meets your request, we can merge it to master.
—
Reply to this email directly or view it on GitHub #9 (comment).