ofxPDSP
Bitcruncher.h
1 
2 // Bitcruncher.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 
7 #ifndef PDSP_SIGNAL_BITCRUNCHER_H_INCLUDED
8 #define PDSP_SIGNAL_BITCRUNCHER_H_INCLUDED
9 
10 #include "../pdspCore.h"
11 
12 
13 namespace pdsp{
14 
20 class Bitcruncher : public Unit{
21 
22 public:
23  Bitcruncher();
24 
29 
33  Patchable& in_bits();
34 
39 
40 
41 private:
42  void prepareUnit( int expectedBufferSize, double sampleRate ) override;
43  void releaseResources () override;
44  void process (int bufferSize) noexcept override ;
45 
46  template<bool bitsAR>
47  void process_audio(const float* &inputBuffer, const float* &bitsBuffer, const int &bufferSize)noexcept;
48 
49  float multiply;
50  float scaleBack;
51 
52  OutputNode output;
53 
54  InputNode input_bits;
55  InputNode input_signal;
56 
57 };
58 
59 } // pdsp namespace end
60 
61 
62 #endif // PDSP_SIGNAL_BITCRUNCHER_H_INCLUDED
Bitcruncher. Makes the output distorted by reducing the bit used for storing the amplitude values...
Definition: Bitcruncher.h:20
Patchable & out_signal()
Sets "signal" as selected output and returns this Unit ready to be patched. This is the default outpu...
Definition: Bitcruncher.cpp:23
Abstract class for implementing Units.
Definition: BasicNodes.h:223
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
Patchable & in_signal()
Sets "signal" as selected input and returns this Unit ready to be patched. This is the default input...
Definition: Bitcruncher.cpp:19
Input of a Unit, process all the connected Outputs and sum them. Has an internal variable state...
Definition: BasicNodes.h:536
Patchable & in_bits()
Sets "bits" as selected input and returns this Unit ready to be patched. Default bits is 16...
Definition: Bitcruncher.cpp:15
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
Output of a Unit, contains a buffer of rendered floats and has a variable state flag.
Definition: BasicNodes.h:354