ofxPDSP
BitNoise.h
1 
2 // BitNoise.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 #ifndef PDSP_SOURCES_BITNOISE_H_INCLUDED
7 #define PDSP_SOURCES_BITNOISE_H_INCLUDED
8 
9 #include "../../DSP/pdspCore.h"
10 #include "../../DSP/random/WhiteNoise.h"
11 #include "../../DSP/signal/Bitcruncher.h"
12 #include "../../DSP/signal/Decimator.h"
13 #include "../../DSP/oscillators/phasors/LFOPhasor.h"
14 #include "../../DSP/utility/PitchToFreq.h"
15 
16 
17 namespace pdsp{
18 
23 class BitNoise : public Patchable {
24 
25 public:
26  BitNoise();
27  BitNoise(const BitNoise &Other);
28  BitNoise& operator=(const BitNoise &Other);
29 
34 
39 
43  Patchable& in_bits();
44 
48  Patchable& in_trig();
49 
54  Patchable& ch( size_t index );
55 
60  Patchable& ch_noise( size_t index );
61 
62 
66  [[deprecated("out_0() deprecated, use ch(0) instead")]]
67  Patchable& out_0();
68 
69  [[deprecated("out_1() deprecated, use ch(0) instead")]]
70  Patchable& out_1();
71 
72  [[deprecated("out_noise() deprecated, use ch_noise(0) instead")]]
73  Patchable& out_noise();
74 
75  [[deprecated("out_decimated() deprecated, just patch instead, it is the default output")]]
76  Patchable& out_decimated();
77 
78  [[deprecated("out_noise_0() deprecated, use ch_noise(0) instead")]]
79  Patchable& out_noise_0();
80 
81  [[deprecated("out_noise_1() deprecated, use ch_noise(1) instead")]]
82  Patchable& out_noise_1();
83 
84  [[deprecated("out_L() deprecated, use ch(0) instead")]]
85  Patchable& out_L();
86 
87  [[deprecated("out_R() deprecated, use ch(1) instead")]]
88  Patchable& out_R();
89 
90  [[deprecated("out_noise_L() deprecated, use ch_noise(0) instead")]]
91  Patchable& out_noise_L();
92 
93  [[deprecated("out_noise_R() deprecated, use ch_noise(1) instead")]]
94  Patchable& out_noise_R();
100 private:
101  void patch();
102 
103  PatchNode trigger;
104  PatchNode bits_ctrl;
105 
106  PitchToFreq p2fPhazor;
107  PitchToFreq p2fDecimator;
108 
109  LFOPhasor phasor;
110 
111  WhiteNoise noiseA;
112  Decimator decimateA;
113  Bitcruncher bitcrunchA;
114 
115  WhiteNoise noiseB;
116  Decimator decimateB;
117  Bitcruncher bitcrunchB;
118 
119 };
120 
121 } //END NAMESPACE
122 
123 
124 #endif // PDSP_SOURCES_BITNOISE_H_INCLUDED
Bitcruncher. Makes the output distorted by reducing the bit used for storing the amplitude values...
Definition: Bitcruncher.h:20
Patchable & ch(size_t index)
Uses the selected channel as output for the patching operation. 0 is for the left channel (default ou...
Definition: BitNoise.cpp:59
Stereo Digital noise generator with lots of control.
Definition: BitNoise.h:23
Patchable & in_trig()
Sets "trig" as selected input and returns this module ready to be patched. Connect a "trig" output to...
Definition: BitNoise.cpp:55
PseudoRandom Noise Generator (used for white noise, but it can also generate more complex noise timbr...
Definition: WhiteNoise.h:61
Patchable & in_bits()
Sets "bits" as selected input and returns this module ready to be patched. The bits of the noise outp...
Definition: BitNoise.cpp:51
Simple phazor for LFOs.
Definition: LFOPhasor.h:22
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
Converts pitch values to frequency values.
Definition: PitchToFreq.h:19
Patchable & in_pitch()
Sets "pitch" as selected input and returns this module ready to be patched. This is the default input...
Definition: BitNoise.cpp:43
Patchable & ch_noise(size_t index)
Uses the selected channel as output for the patching operation. 0 is for the left channel (default ou...
Definition: BitNoise.cpp:71
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
A Unit with no dsp inside, it just pass it's input to the output. Patching float to this Unit is thre...
Definition: PatchNode.h:41
Patchable & in_decimation()
Sets "decimation" as selected input and returns this module ready to be patched. This is pitch freque...
Definition: BitNoise.cpp:47
Sample Rate Decimator, reduce the sample rate of the input signal. New sample rate frequency is a rea...
Definition: Decimator.h:20