-
Notifications
You must be signed in to change notification settings - Fork 7
/
extras.cpp
75 lines (61 loc) · 1.51 KB
/
extras.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "extras.h"
#ifdef __cplusplus
namespace imajuscule::audio {
namespace audioelement {
std::ostream & operator << (std::ostream & os, OscillatorType t) {
switch(t) {
case OscillatorType::SinusLoudnessVolumeAdjusted:
os << "SinusLoudnessVolumeAdjusted"; break;
case OscillatorType::Sinus:
os << "Sinus"; break;
case OscillatorType::Saw:
os << "Saw"; break;
case OscillatorType::Square:
os << "Square"; break;
case OscillatorType::Triangle:
os << "Triangle"; break;
case OscillatorType::Noise:
os << "Noise"; break;
case OscillatorType::Sweep:
os << "Sweep"; break;
}
return os;
}
} // NS
Ctxt & getAudioContext() {
static Ctxt c;
return c;
}
Stepper & getStepper() {
constexpr int sz_one_shots = 400; // we need one to start or change or end a note.
constexpr int sz_computes = 400; // we need one per synth.
static Stepper stepper(GlobalAudioLock<audioEnginePolicy>::get(),
sz_one_shots,
sz_computes);
return stepper;
}
Reverb & getReverb() {
static Reverb r;
return r;
}
Limiter<double> & getLimiter() {
static Limiter<double> l;
return l;
}
VoiceWindImpl & windVoice()
{
static VoiceWindImpl v;
return v;
}
std::mutex & windVoiceMutex()
{
static std::mutex mut;
return mut;
}
NoteIdsGenerator & windVoiceNoteIdsGen()
{
static NoteIdsGenerator gen(150);
return gen;
}
} // NS imajuscule::audio
#endif