From: kazu Date: Sun, 7 Apr 2024 10:18:34 +0000 (+0000) Subject: Fixed channel 15 not playing bug X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=6274e0a6aee3b52b45e3154d04ee8a0d0fdb6514;p=ksynth.git Fixed channel 15 not playing bug git-svn-id: file:///raid/svn-main/kazu-ksynth/trunk@11 7b47e76f-e598-2f43-bc14-414d160cc389 --- diff --git a/src/ksynth.c b/src/ksynth.c index f00bdd3..a58426a 100644 --- a/src/ksynth.c +++ b/src/ksynth.c @@ -67,7 +67,7 @@ struct KSynth* ksynth_new(const char* sample_file_path, int sample_rate, int num } void ksynth_note_on(struct KSynth* ksynth_instance, int channel, int note, int velocity) { - if(ksynth_instance == NULL || channel < 0 || channel > 15 || note < 0 || note > 127 || velocity < 0 || velocity > 127) { + if(ksynth_instance == NULL || channel < 0 || channel > 16 || note < 0 || note > 127 || velocity < 0 || velocity > 127) { fprintf(stderr, "[KSynth] Error: Invalid parameters for note on.\n"); return; } @@ -101,7 +101,7 @@ void ksynth_note_on(struct KSynth* ksynth_instance, int channel, int note, int v } void ksynth_note_off(struct KSynth* ksynth_instance, int channel, int note) { - if (ksynth_instance == NULL || channel < 0 || channel > 15 || note < 0 || note > 127) { + if (ksynth_instance == NULL || channel < 0 || channel > 16 || note < 0 || note > 127) { fprintf(stderr, "[KSynth] Error: Invalid parameters for note off.\n"); return; }