From 44deba7559e37b000c349676918c96ccbacf1047 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 2 Aug 2024 13:38:38 -0400 Subject: [PATCH] cwWaveTableNotes.cpp : gen_note() now validates the sample rate. --- cwWaveTableNotes.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cwWaveTableNotes.cpp b/cwWaveTableNotes.cpp index 0dd9301..7998eef 100644 --- a/cwWaveTableNotes.cpp +++ b/cwWaveTableNotes.cpp @@ -49,11 +49,8 @@ cw::rc_t cw::wt_note::gen_note( wt_bank::handle_t wtbH, if( mcs->chN < chN ) chN = mcs->chN; - // TODO: VERIFY srate == SAMPLE RATE OF WAVETABLES - // mcs->valid_srate(srate) - - // allocate and setup xthe oscillator - if((rc = create(&osc,chN,mcs)) != kOkRC ) + // allocate,setup and validate the expected srate of the oscillator + if((rc = create(&osc,chN,mcs,srate)) != kOkRC ) { rc = cwLogError(rc,"multi-ch-wt-seq-osc create failed."); goto errLabel; @@ -277,8 +274,8 @@ cw::rc_t cw::wt_note::test( const test::test_args_t& args ) rc_t rc = kOkRC; const char* wtb_json_fname = "/home/kevin/temp/temp_5.json"; unsigned instr_idx = 0; - unsigned min_pitch = 60; - unsigned max_pitch = 60; + unsigned min_pitch = 21; + unsigned max_pitch = 21; srate_t srate = 48000; unsigned audioChN = 2; double note_dur_sec = 9;