From 6d4e29c8519ce5f70f088fe962c3240a39331e6b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 24 Apr 2020 23:32:02 -0400 Subject: [PATCH] Strips mixer back to basics in search of audio issues. --- Components/OPL2/OPL2.cpp | 13 +++++++++++-- .../xcshareddata/xcschemes/Clock Signal.xcscheme | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Components/OPL2/OPL2.cpp b/Components/OPL2/OPL2.cpp index 6587222a4..67f1b539d 100644 --- a/Components/OPL2/OPL2.cpp +++ b/Components/OPL2/OPL2.cpp @@ -66,7 +66,16 @@ void OPLL::get_samples(std::size_t number_of_samples, std::int16_t *target) { const int update_period = 72 / audio_divider_; const int channel_output_period = 8 / audio_divider_; - // Fill in any leftover from the previous session. + while(number_of_samples--) { + if(!audio_offset_) update_all_chanels(); + + *target = int16_t(channels_[audio_offset_ / channel_output_period].level); + ++target; + audio_offset_ = (audio_offset_ + 1) % update_period; + } + + +/* // Fill in any leftover from the previous session. if(audio_offset_) { while(audio_offset_ < update_period && number_of_samples) { *target = int16_t(channels_[audio_offset_ / channel_output_period].level); @@ -101,7 +110,7 @@ void OPLL::get_samples(std::size_t number_of_samples, std::int16_t *target) { *target = int16_t(channels_[c / channel_output_period].level); ++target; } - } + }*/ } void OPLL::set_sample_volume_range(std::int16_t range) { diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme index a99eb0a5d..63be2c037 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme +++ b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme @@ -67,7 +67,7 @@