Deluge Firmware 1.3.0
Build date: 2026.10.14
Loading...
Searching...
No Matches
iterance_migration.h
1/*
2 * Copyright © 2024 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include "model/iterance/iterance.h"
21#include <cstdint>
22
23// Decodes an iterance value from the old C1.2 / pre-1.3 probability-byte encoding.
24//
25// Old format (noteHexLength==22 and the pre-lift else path): iterance was stored in
26// the probability field as (kNumProbabilityValues + legacyPresetIndex) where
27// legacyPresetIndex ran from 1 ("1 of 2") to 35 ("8 of 8").
28//
29// Commit 3ce3d41d prepended FIRST and LAST to iterancePresets[], shifting every
30// subsequent preset's array index by +2. This function applies that correction.
31Iterance iteranceFromLegacyProbabilityByte(int32_t probability);
32
33// Decodes an iterance value from the old early-1.3-nightly preset-index encoding.
34//
35// Old format (noteHexLength==26): the preset index was stored directly. In that
36// era the index space was: 0=OFF, 1=1of2 … 35=8of8, 36=custom. After FIRST and
37// LAST were prepended the mapping is: 0=OFF, 1=FIRST, 2=LAST, 3=1of2 … 37=8of8,
38// 38=custom. This function applies the +2 correction to non-zero indices.
39Iterance iteranceFromLegacyPresetIndex(int32_t presetIndex);
Definition iterance.h:26