Deluge Firmware 1.3.0
Build date: 2025.11.04
Loading...
Searching...
No Matches
source.h
1/*
2 * Copyright © 2014-2023 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 "definitions_cxx.hpp"
21#include "model/sample/sample_controls.h"
22#include "storage/multi_range/multi_range_array.h"
23#include "util/phase_increment_fine_tuner.h"
24
25class Sound;
27class WaveTable;
28class SampleHolder;
29class DxPatch;
30
31class Source {
32public:
33 Source();
34 ~Source();
35
36 SampleControls sampleControls;
37
38 OscType oscType;
39
40 // These are not valid for Samples
41 int16_t transpose;
42 int8_t cents;
44
45 MultiRangeArray ranges;
46
47 DxPatch* dxPatch;
48 bool dxPatchChanged = false;
49 SampleRepeatMode repeatMode;
50
51 int8_t timeStretchAmount;
52
53 int16_t defaultRangeI; // -1 means none yet
54
57
58 bool renderInStereo(Sound* s, SampleHolder* sampleHolder = nullptr);
59 void setCents(int32_t newCents);
60 void recalculateFineTuner();
61 int32_t getLengthInSamplesAtSystemSampleRate(int32_t note, bool forTimeStretching = false);
62 void detachAllAudioFiles();
63 Error loadAllSamples(bool mayActuallyReadFiles);
64 void setReversed(bool newReversed);
65 int32_t getRangeIndex(int32_t note);
66 MultiRange* getRange(int32_t note);
67 MultiRange* getOrCreateFirstRange();
68 bool hasAtLeastOneAudioFileLoaded();
69 void doneReadingFromFile(Sound* sound);
70 bool hasAnyLoopEndPoint();
71 void setOscType(OscType newType);
72
73 DxPatch* ensureDxPatch();
74
75private:
76 void destructAllMultiRanges();
77};
Definition dx7note.h:38
Definition multi_range_array.h:26
Definition multi_range.h:23
Definition param_manager.h:174
Definition phase_increment_fine_tuner.h:21
Definition sample_controls.h:22
Definition sample_holder.h:32
Definition sound.h:71
bool isTracking
Determines if the oscillator tracks note pitch or not.
Definition source.h:56
Definition wave_table.h:42