Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
engine.h
1/*
2 * Copyright © 2015-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 "EngineMkI.h"
21#include "definitions_cxx.hpp"
22#include "dx7note.h"
23
24// seems to cause crashes... maybe YAGNI
25// #define DX_PREALLOC
26
27class DxEngine {
28public:
29 DxEngine();
30#define EXP2_LG_N_SAMPLES 10
31#define EXP2_N_SAMPLES (1 << EXP2_LG_N_SAMPLES)
32 int32_t exp2tab[EXP2_N_SAMPLES << 1];
33
34#define TANH_LG_N_SAMPLES 10
35#define TANH_N_SAMPLES (1 << TANH_LG_N_SAMPLES)
36 int32_t tanhtab[TANH_N_SAMPLES << 1];
37
38// Use twice as much RAM for the LUT but avoid a little computation
39#define SIN_DELTA
40
41#define SIN_LG_N_SAMPLES 10
42#define SIN_N_SAMPLES (1 << SIN_LG_N_SAMPLES)
43#ifdef SIN_DELTA
44 int32_t sintab[SIN_N_SAMPLES << 1];
45#else
46 int32_t sintab[SIN_N_SAMPLES + 1];
47#endif
48
49#define FREQ_LG_N_SAMPLES 10
50#define FREQ_N_SAMPLES (1 << FREQ_LG_N_SAMPLES)
51 int32_t freq_lut[FREQ_N_SAMPLES + 1];
52
53#ifdef DX_PREALLOC
54 DxVoice dxVoices[kNumVoiceSamplesStatic];
55 DxVoice* firstUnassignedDxVoice;
56#endif
57
58 EngineMkI engineMkI;
59 FmCore engineModern;
60
61 DxVoice* solicitDxVoice();
62 void dxVoiceUnassigned(DxVoice* dxVoice);
63 DxPatch* newPatch();
64};
65
66extern DxEngine* dxEngine;
67
68DxEngine* getDxEngine();
Definition engine.h:27
Definition dx7note.h:38
Definition dx7note.h:76
Definition EngineMkI.h:23
Definition fm_core.h:52