Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
sample_holder_for_voice.h
1/*
2 * Copyright © 2015-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 "model/sample/sample_holder.h"
21#include "util/phase_increment_fine_tuner.h"
22
23class Source;
24
25class SampleHolderForVoice final : public SampleHolder {
26public:
27 SampleHolderForVoice();
28 ~SampleHolderForVoice() override;
29 void unassignAllClusterReasons(bool beingDestructed = false) override;
30 void setCents(int32_t newCents);
31 void recalculateFineTuner();
32 void claimClusterReasons(bool reversed, int32_t clusterLoadInstruction = CLUSTER_ENQUEUE) override;
33 void setTransposeAccordingToSamplePitch(bool minimizeOctaves = false, bool doingSingleCycle = false,
34 bool rangeCoversJustOneNote = false, bool thatOneNote = 0);
35 uint32_t getMSecLimit(Source* source);
36
38 uint32_t loopStartPos;
42 uint32_t loopEndPos;
43
44 int16_t transpose;
45 int8_t cents;
49
50 Cluster* clustersForLoopStart[kNumClustersLoadedAhead];
51
52 // These two now only exist for loading in data from old files
53 uint32_t startMSec;
54 uint32_t endMSec;
55
56 [[nodiscard]] uint32_t loopLength() const { return loopEndPos - loopStartPos; }
57
58protected:
59 void sampleBeenSet(bool reversed, bool manuallySelected) override;
60};
Definition cluster.h:34
Definition phase_increment_fine_tuner.h:21
bool loopLocked
Whether the loop length should be kept constant when updating the start/end position.
Definition sample_holder_for_voice.h:47
uint32_t loopEndPos
Definition sample_holder_for_voice.h:42
uint32_t loopStartPos
In samples. 0 means not set.
Definition sample_holder_for_voice.h:38
Definition source.h:31