From d9272453fdfc474b6bcf8b12919da5ba04dd01bd Mon Sep 17 00:00:00 2001 From: Stefano D'Angelo Date: Tue, 25 Jul 2023 15:03:29 +0200 Subject: [PATCH] const arg for bw_note_queue_is_valid() + bw_one_pole_process{_multi} use BW_SIZE_T + beginning of debugging code in bw_one_pole --- TODO | 5 +- include/bw_note_queue.h | 4 +- include/bw_one_pole.h | 442 +++++++++++++++++++++++++++++++++------- 3 files changed, 378 insertions(+), 73 deletions(-) diff --git a/TODO b/TODO index 538752c..3374f2c 100644 --- a/TODO +++ b/TODO @@ -3,12 +3,12 @@ code: * android, ios -* debugging (design by contract?, trace calls?) 1.0.0 ----- code: +* debugging * check all examples again * osc post filter (and one pole init, slew rate, etc.) val from input? set state instead? * audio rate optional pulse width/slope inputs? @@ -59,9 +59,10 @@ code: * should remove bw_config? * use custom NDEBUG? * NULL (C) vs BW_SIZE_T (non-C)...? +* clearly specify that state is tied to a particular set of coeffs (1:N) build system: -* single header generation +* single header generation (vs modules in bwp... to think about) post 1.0.0 ---------- diff --git a/include/bw_note_queue.h b/include/bw_note_queue.h index 8b37e97..37f00a5 100644 --- a/include/bw_note_queue.h +++ b/include/bw_note_queue.h @@ -125,7 +125,7 @@ static inline void bw_note_queue_add(bw_note_queue *BW_RESTRICT queue, unsigned * * #### bw_note_queue_add() * ```>>> */ -static inline char bw_note_queue_is_valid(bw_note_queue *BW_RESTRICT queue); +static inline char bw_note_queue_is_valid(const bw_note_queue *BW_RESTRICT queue); /*! <<<``` * WRITEME * }}} */ @@ -179,7 +179,7 @@ static inline void bw_note_queue_add(bw_note_queue *BW_RESTRICT queue, unsigned BW_ASSERT_DEEP(bw_note_queue_is_valid(queue)); } -static inline char bw_note_queue_is_valid(bw_note_queue *BW_RESTRICT queue) { +static inline char bw_note_queue_is_valid(const bw_note_queue *BW_RESTRICT queue) { BW_ASSERT(queue != NULL); if (queue->n_events >= 128 || queue->n_pressed >= 128) diff --git a/include/bw_one_pole.h b/include/bw_one_pole.h index 1cae903..b9e5ad7 100644 --- a/include/bw_one_pole.h +++ b/include/bw_one_pole.h @@ -32,6 +32,10 @@ *