Deluge Firmware
1.3.0
Build date: 2026.11.28
Toggle main menu visibility
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
25
class
Sound
;
26
class
ParamManagerForTimeline
;
27
class
WaveTable
;
28
class
SampleHolder
;
29
class
DxPatch
;
30
31
class
Source {
32
public
:
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;
43
PhaseIncrementFineTuner
fineTuner;
44
45
MultiRangeArray
ranges;
46
47
DxPatch
* dxPatch;
48
bool
dxPatchChanged =
false
;
49
uint16_t loopCrossfadeMs{0};
// 0 means off. Sits in the padding after the bool above
50
SampleRepeatMode repeatMode;
51
52
int8_t timeStretchAmount;
53
54
int16_t defaultRangeI;
// -1 means none yet
55
56
bool
renderInStereo(
Sound
* s,
SampleHolder
* sampleHolder =
nullptr
);
57
void
setCents(int32_t newCents);
58
void
recalculateFineTuner();
59
int32_t getLengthInSamplesAtSystemSampleRate(int32_t note,
bool
forTimeStretching =
false
);
60
void
detachAllAudioFiles();
61
Error loadAllSamples(
bool
mayActuallyReadFiles);
62
void
setReversed(
bool
newReversed);
63
int32_t getRangeIndex(int32_t note);
64
MultiRange
* getRange(int32_t note);
65
MultiRange
* getOrCreateFirstRange();
66
bool
hasAtLeastOneAudioFileLoaded();
67
void
doneReadingFromFile(
Sound
* sound);
68
bool
hasAnyLoopEndPoint();
69
OscType getOscType();
70
void
setOscType(OscType newType);
71
72
DxPatch
* ensureDxPatch();
73
74
private
:
75
void
destructAllMultiRanges();
76
};
DxPatch
Definition
dx7note.h:38
MultiRangeArray
Definition
multi_range_array.h:26
MultiRange
Definition
multi_range.h:23
ParamManagerForTimeline
Definition
param_manager.h:156
PhaseIncrementFineTuner
Definition
phase_increment_fine_tuner.h:21
SampleControls
Definition
sample_controls.h:22
SampleHolder
Definition
sample_holder.h:32
Sound
Definition
sound.h:78
WaveTable
Definition
wave_table.h:42