From 13aa3ae3b3bdd716c16b984615801339fcec56df Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 18 Oct 2025 05:21:17 -0500 Subject: [PATCH] pattern data refactor, part 14 update comment in pattern.h --- src/engine/pattern.h | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/engine/pattern.h b/src/engine/pattern.h index 977bb82a1..ff2417fef 100644 --- a/src/engine/pattern.h +++ b/src/engine/pattern.h @@ -22,6 +22,21 @@ struct DivPattern { String name; + /** + * pattern data is stored in this order: + * - 0 note: 0 (min) is C-(-5), 60 is C-0, and 179 (max) is B-9. + 252 is null/bug, 253 is note off, 254 is note release and + 255 is macro release. + * - 1 instrument + * - 2 volume + * - 3 effect + * - 4 effect value + * - 5... (the rest of effects/effect values) + * + * use the DIV_PAT_* macros in defines.h for convenience. + * + * if a cell is -1, it means "empty". + */ short newData[DIV_MAX_ROWS][DIV_MAX_COLS]; /** @@ -39,14 +54,10 @@ struct DivPattern { struct DivChannelData { unsigned char effectCols; - // data goes as follows: data[ROW][TYPE] - // TYPE is: - // 0: note - // 1: octave - // 2: instrument - // 3: volume - // 4-5+: effect/effect value - // do NOT access directly unless you know what you're doing! + /** + * do NOT access directly unless you know what you're doing! + * use getPattern() instead. + */ DivPattern* data[DIV_MAX_PATTERNS]; /**