Deluge Firmware
1.3.0
Build date: 2026.11.22
Toggle main menu visibility
Loading...
Searching...
No Matches
voice_unison_part_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 "dsp/oscillators/supersaw.h"
22
#include "model/sample/sample.h"
23
#include <gsl/gsl>
24
25
class
TimeStretcher
;
26
class
VoiceSamplePlaybackGuide
;
27
class
Source
;
28
class
Voice
;
29
class
VoiceSample
;
30
class
LivePitchShifter
;
31
class
DxVoice
;
32
33
class
VoiceUnisonPartSource {
34
public
:
35
VoiceUnisonPartSource() =
default
;
36
~VoiceUnisonPartSource();
37
bool
noteOn(
Voice
* voice,
Source
* source,
VoiceSamplePlaybackGuide
* voiceSource, uint32_t samplesLate,
38
uint32_t oscPhase,
bool
resetEverything, SynthMode synthMode, uint8_t velocity);
39
void
unassign(
bool
deletingSong);
40
bool
getPitchAndSpeedParams(
Source
* source,
VoiceSamplePlaybackGuide
* voiceSource, uint32_t* phaseIncrement,
41
uint32_t* timeStretchRatio, uint32_t* noteLengthInSamples);
42
uint32_t getSpeedParamForNoSyncing(
Source
* source, int32_t phaseIncrement, int32_t pitchAdjustNeutralValue);
45
uint32_t
getStretchToUndoPitch
(int32_t pitchAdjustNeutralValue, uint32_t phaseIncrement);
46
47
uint32_t oscPos;
// FKA phase. No longer used for Sample playback / rate conversion position. Only waves, including
48
// wavetable.
49
deluge::dsp::Supersaw::SidePhases
supersawPhases =
deluge::dsp::Supersaw::sidePhasesFrom
(0);
50
uint32_t phaseIncrementStoredValue;
51
int32_t carrierFeedback;
52
bool
active;
53
VoiceSample
* voiceSample =
nullptr
;
54
LivePitchShifter
* livePitchShifter =
nullptr
;
55
gsl::owner<DxVoice*> dxVoice =
nullptr
;
56
57
private
:
58
int32_t stretchToUndoPitchNeutral_ = 0;
59
uint32_t stretchToUndoPitchIncrement_ = 0;
60
uint32_t stretchToUndoPitch_ = 0;
61
};
DxVoice
Definition
dx7note.h:76
LivePitchShifter
Definition
live_pitch_shifter.h:25
Source
Definition
source.h:31
TimeStretcher
Definition
time_stretcher.h:37
VoiceSamplePlaybackGuide
Definition
voice_sample_playback_guide.h:28
VoiceSample
Definition
voice_sample.h:36
VoiceUnisonPartSource::getStretchToUndoPitch
uint32_t getStretchToUndoPitch(int32_t pitchAdjustNeutralValue, uint32_t phaseIncrement)
Definition
voice_unison_part_source.cpp:201
Voice
Definition
voice.h:35
deluge::dsp::Supersaw::SidePhases
std::array< uint32_t, kNumSaws - 1 > SidePhases
Phases of the side saws. The centre saw's phase is the regular oscillator phase.
Definition
supersaw.h:33
deluge::dsp::Supersaw::sidePhasesFrom
static constexpr SidePhases sidePhasesFrom(uint32_t centrePhase)
Definition
supersaw.h:37