Deluge Firmware 1.3.0
Build date: 2026.03.02
Loading...
Searching...
No Matches
basic_waves.h
1/*
2 * Copyright © 2017-2023 Synthstrom Audible Limited, 2025 Mark Adams
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#include <cstdint>
20#include <utility>
21namespace deluge::dsp {
22void renderWave(const int16_t* __restrict__ table, int32_t tableSizeMagnitude, int32_t amplitude,
23 int32_t* __restrict__ outputBuffer, int32_t* bufferEnd, uint32_t phaseIncrement, uint32_t phase,
24 bool applyAmplitude, uint32_t phaseToAdd, int32_t amplitudeIncrement);
25void renderPulseWave(const int16_t* __restrict__ table, int32_t tableSizeMagnitude, int32_t amplitude,
26 int32_t* __restrict__ outputBuffer, int32_t* bufferEnd, uint32_t phaseIncrement, uint32_t phase,
27 bool applyAmplitude, uint32_t phaseToAdd, int32_t amplitudeIncrement);
28uint32_t renderCrudeSawWaveWithAmplitude(int32_t* thisSample, int32_t* bufferEnd, uint32_t phaseNowNow,
29 uint32_t phaseIncrementNow, int32_t amplitudeNow, int32_t amplitudeIncrement,
30 int32_t numSamples);
31uint32_t renderCrudeSawWaveWithoutAmplitude(int32_t* thisSample, int32_t* bufferEnd, uint32_t phaseNowNow,
32 uint32_t phaseIncrementNow, int32_t numSamples);
38std::pair<int32_t, int32_t> getTableNumber(uint32_t phaseIncrement);
39extern const int16_t* sawTables[20];
40extern const int16_t* squareTables[20];
41extern const int16_t* analogSquareTables[20];
42extern const int16_t* analogSawTables[20];
43
44} // namespace deluge::dsp