20#include "OSLikeStuff/scheduler_api.h"
21#include "definitions_cxx.hpp"
22#include "dsp/compressor/rms_feedback.h"
23#include "dsp/envelope_follower/absolute_value.h"
24#include "memory/fast_allocator.h"
25#include "memory/object_pool.h"
26#include "model/output.h"
27#include "util/containers.h"
31struct InterruptsDisabled;
56enum class Polarity : uint8_t;
58namespace deluge::dsp {
137#define DO_AUDIO_LOG 0
139namespace AudioEngine {
140#define logAction(string) logAudioAction(string, __FILE__, __LINE__)
142using VoicePool = deluge::memory::ObjectPool<Voice, deluge::memory::fast_allocator>;
143using VoiceSamplePool = deluge::memory::ObjectPool<VoiceSample, deluge::memory::fast_allocator>;
144using TimeStretcherPool = deluge::memory::ObjectPool<TimeStretcher, deluge::memory::fast_allocator>;
147void routineWithClusterLoading(
bool mayProcessUserActionsBetween =
false);
164void previewSample(
String* path, FilePointer* filePointer,
bool shouldActuallySound,
PreviewVolume const& volume);
165void stopAnyPreviewing();
167void songSwapAboutToHappen();
168void killAllVoices(
bool deletingSong =
false);
169void logAudioAction(
char const*
string,
const char* file,
int line);
171void getReverbParamsFromSong(
Song* song);
174void voiceSampleUnassigned(
VoiceSample* voiceSample);
179LiveInputBuffer* getOrCreateLiveInputBuffer(OscType inputType,
bool mayCreate);
181void doRecorderCardRoutines();
183int32_t getNumSamplesLeftToOutputFromPreviousRender();
185void registerSideChainHit(int32_t strength);
187SampleRecorder* getNewRecorder(int32_t numChannels, AudioRecordingFolder folderID, AudioInputChannel mode,
188 bool keepFirstReasons,
bool writeLoopPoints, int32_t buttonPressLatency,
191bool isAnyInternalRecordingHappening();
195uint8_t logNextIndex = 0;
196uint32_t logAbsoluteIndex = 0;
197char* getEmptyLogEntry();
200int32_t getNumAudio();
201int32_t getNumVoices();
202bool doSomeOutputting();
203void updateReverbParams();
205extern bool headphonesPluggedIn;
206extern bool micPluggedIn;
207extern bool lineInPluggedIn;
208extern bool renderInStereo;
209extern uint32_t audioSampleTimer;
213extern bool inputMonitoringWarmedUp;
216extern bool usbInputMonitoredByTrack;
217extern bool mustUpdateReverbParamsBeforeNextRender;
218extern bool bypassCulling;
219extern uint32_t i2sTXBufferPos;
220extern uint32_t i2sRXBufferPos;
221extern int32_t cpuDireness;
222extern InputMonitoringMode inputMonitoringMode;
223extern bool audioRoutineLocked;
224extern bool routineBeenCalled;
225extern uint8_t numHopsEndedThisRoutineCall;
227extern uint32_t timeThereWasLastSomeReverb;
228extern deluge::fast_vector<Sound*> sounds;
230extern uint32_t nextVoiceState;
232extern int32_t reverbSidechainVolume;
233extern int32_t reverbSidechainShape;
234extern int32_t reverbPan;
238extern uint32_t timeLastSideChainHit;
239extern int32_t sizeLastSideChainHit;
242extern TaskID routine_task_id;
243void feedReverbBackdoorForGrain(
int index, q31_t value);
246q31_t getInputMonitoringGain(uint32_t offset);
251int32_t* getInputBufferStart(AudioInputChannel channel);
252int32_t* getInputBufferEnd(AudioInputChannel channel);
254int32_t* getInputReadPos(AudioInputChannel channel);
258constexpr bool isCodecInput(AudioInputChannel channel) {
259 return channel < AUDIO_INPUT_CHANNEL_FIRST_INTERNAL_OPTION && channel != AudioInputChannel::USB;
263bool allowedToStartVoice();
267void cancelScheduledGates(uint8_t gateMask,
const InterruptsDisabled&);
269void midiGateOutputTimerFired();
Definition absolute_value.h:24
Definition instrument.h:45
Definition metronome.h:26
Definition model_stack.h:282
Definition param_manager.h:155
Definition rms_feedback.h:26
Definition sample_recorder.h:53
Definition sidechain.h:27
Definition sound_drum.h:28
Definition time_stretcher.h:37
Definition voice_sample.h:36
Definition audio_engine.h:154
int32_t velocityCableDepth
depth of the VELOCITY -> LOCAL_VOLUME patch cable
Definition audio_engine.h:157
int32_t volumePostFX
params::GLOBAL_VOLUME_POST_FX
Definition audio_engine.h:155
int32_t localVolume
params::LOCAL_VOLUME
Definition audio_engine.h:156
Polarity velocityCablePolarity
polarity of the VELOCITY -> LOCAL_VOLUME patch cable
Definition audio_engine.h:158
static PreviewVolume neutral()
The defaults the preview drum is built with, from Sound::initParams() and Sound::setupAsSample().
Definition audio_engine.cpp:1632
Definition sample_recorder.h:49
Definition functions.h:444
Definition stereo_sample.h:25