Deluge Firmware
1.3.0
Build date: 2026.08.16
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
SampleRepeatMode repeatMode;
50
51
int8_t timeStretchAmount;
52
53
int16_t defaultRangeI;
// -1 means none yet
54
55
bool
renderInStereo(
Sound
* s,
SampleHolder
* sampleHolder =
nullptr
);
56
void
setCents(int32_t newCents);
57
void
recalculateFineTuner();
58
int32_t getLengthInSamplesAtSystemSampleRate(int32_t note,
bool
forTimeStretching =
false
);
59
void
detachAllAudioFiles();
60
Error loadAllSamples(
bool
mayActuallyReadFiles);
61
void
setReversed(
bool
newReversed);
62
int32_t getRangeIndex(int32_t note);
63
MultiRange
* getRange(int32_t note);
64
MultiRange
* getOrCreateFirstRange();
65
bool
hasAtLeastOneAudioFileLoaded();
66
void
doneReadingFromFile(
Sound
* sound);
67
bool
hasAnyLoopEndPoint();
68
OscType getOscType();
69
void
setOscType(OscType newType);
70
71
DxPatch
* ensureDxPatch();
72
73
private
:
74
void
destructAllMultiRanges();
75
};
DxPatch
Definition
dx7note.h:38
MultiRangeArray
Definition
multi_range_array.h:26
MultiRange
Definition
multi_range.h:23
ParamManagerForTimeline
Definition
param_manager.h:174
PhaseIncrementFineTuner
Definition
phase_increment_fine_tuner.h:21
SampleControls
Definition
sample_controls.h:22
SampleHolder
Definition
sample_holder.h:32
Sound
Definition
sound.h:71
WaveTable
Definition
wave_table.h:42