Deluge Firmware 1.3.0
Build date: 2025.04.16
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 <span>
21#include <utility>
22
23namespace deluge::dsp {
24void renderWave(const int16_t* __restrict__ table, int32_t tableSizeMagnitude, int32_t amplitude,
25 std::span<int32_t> buffer, uint32_t phaseIncrement, uint32_t phase, bool applyAmplitude,
26 uint32_t phaseToAdd, int32_t amplitudeIncrement);
27void renderPulseWave(const int16_t* __restrict__ table, int32_t tableSizeMagnitude, int32_t amplitude,
28 std::span<int32_t> outputBuffer, uint32_t phaseIncrement, uint32_t phase, bool applyAmplitude,
29 uint32_t phaseToAdd, int32_t amplitudeIncrement);
30
32uint32_t renderCrudeSawWave(std::span<int32_t> buffer, uint32_t phase, uint32_t phase_increment, int32_t amplitude,
33 int32_t amplitude_increment);
34
36uint32_t renderCrudeSawWave(std::span<int32_t> buffer, uint32_t phase, uint32_t phase_increment);
42std::pair<int32_t, int32_t> getTableNumber(uint32_t phaseIncrement);
43extern const int16_t* sawTables[20];
44extern const int16_t* squareTables[20];
45extern const int16_t* analogSquareTables[20];
46extern const int16_t* analogSawTables[20];
47
48} // namespace deluge::dsp