Deluge Firmware
Loading...
Searching...
No Matches
source.h
Go to the documentation of this file.
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#ifndef SOURCE_H
19#define SOURCE_H
20
21#include <MultiRangeArray.h>
23#include "SampleControls.h"
24
25class Sound;
27class WaveTable;
28class SampleHolder;
29
30class Source
31{
32public:
33 Source();
34 ~Source();
35
37
38 uint8_t oscType;
39
40 // These are not valid for Samples
41 int16_t transpose;
42 int8_t cents;
44
46
47 uint8_t repeatMode;
48
50
51 int16_t defaultRangeI; // -1 means none yet
52
53 bool renderInStereo(SampleHolder* sampleHolder = NULL);
54 void setCents(int newCents);
56 int32_t getLengthInSamplesAtSystemSampleRate(int note, bool forTimeStretching = false);
58 int loadAllSamples(bool mayActuallyReadFiles);
59 void setReversed(bool newReversed);
60 int getRangeIndex(int note);
61 MultiRange* getRange(int note);
64 void doneReadingFromFile(Sound* sound);
65 bool hasAnyLoopEndPoint();
66 void setOscType(int newType);
67
68
69private:
70 void destructAllMultiRanges();
71};
72
73#endif
Definition: MultiRangeArray.h:27
Definition: MultiRange.h:25
Definition: ParamManager.h:166
Definition: phaseincrementfinetuner.h:25
Definition: SampleControls.h:23
Definition: SampleHolder.h:32
Definition: sound.h:66
Definition: source.h:31
int32_t getLengthInSamplesAtSystemSampleRate(int note, bool forTimeStretching=false)
Definition: source.cpp:66
PhaseIncrementFineTuner fineTuner
Definition: source.h:43
int16_t transpose
Definition: source.h:41
bool hasAtLeastOneAudioFileLoaded()
Definition: source.cpp:164
int loadAllSamples(bool mayActuallyReadFiles)
Definition: source.cpp:102
void setOscType(int newType)
Definition: source.cpp:216
MultiRange * getOrCreateFirstRange()
Definition: source.cpp:150
int16_t defaultRangeI
Definition: source.h:51
void doneReadingFromFile(Sound *sound)
Definition: source.cpp:172
void setCents(int newCents)
Definition: source.cpp:75
void detachAllAudioFiles()
Definition: source.cpp:94
MultiRange * getRange(int note)
Definition: source.cpp:131
int8_t timeStretchAmount
Definition: source.h:49
Source()
Definition: source.cpp:36
bool renderInStereo(SampleHolder *sampleHolder=NULL)
Definition: source.cpp:86
int8_t cents
Definition: source.h:42
bool hasAnyLoopEndPoint()
Definition: source.cpp:205
MultiRangeArray ranges
Definition: source.h:45
SampleControls sampleControls
Definition: source.h:36
void recalculateFineTuner()
Definition: source.cpp:80
uint8_t oscType
Definition: source.h:38
~Source()
Definition: source.cpp:51
int getRangeIndex(int note)
Definition: source.cpp:141
void setReversed(bool newReversed)
Definition: source.cpp:115
uint8_t repeatMode
Definition: source.h:47
Definition: WaveTable.h:44