diff options
Diffstat (limited to 'src/audio')
| -rw-r--r-- | src/audio/synth.cpp | 10 | ||||
| -rw-r--r-- | src/audio/synth.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/audio/synth.cpp b/src/audio/synth.cpp index f009876..3c20b0b 100644 --- a/src/audio/synth.cpp +++ b/src/audio/synth.cpp @@ -155,3 +155,13 @@ void synth_render(float* output_buffer, int num_frames) { output_buffer[i * 2 + 1] = right_sample; } } + +int synth_get_active_voice_count() { + int count = 0; + for (int i = 0; i < MAX_VOICES; ++i) { + if (g_voices[i].active) { + count++; + } + } + return count; +} diff --git a/src/audio/synth.h b/src/audio/synth.h index ce9825d..17770a7 100644 --- a/src/audio/synth.h +++ b/src/audio/synth.h @@ -22,3 +22,4 @@ void synth_commit_update(int spectrogram_id); void synth_trigger_voice(int spectrogram_id, float volume, float pan); void synth_render(float* output_buffer, int num_frames); +int synth_get_active_voice_count(); |
