Debian Codegraph @

src/pt2_blep.h

raw symbols SCIP
1 // these BLEP routines are based on code by aciddose (written for this project)cxx . . $ `<file>/src/pt2_blep.h`/
2
3 #pragma once
4
5 #include <stdint.h>
6
7 /* aciddose:
8 ** information on blep variables
9 **
10 ** ZC = zero crossings, the number of ripples in the impulse
11 ** OS = oversampling, how many samples per zero crossing are taken
12 ** SP = step size per output sample, used to lower the cutoff (play the impulse slower)
13 ** NS = number of samples of impulse to insert
14 ** RNS = the lowest power of two greater than NS, minus one (used to wrap output buffer)
15 **
16 ** ZC and OS are here only for reference, they depend upon the data in the table and can't be changed.
17 ** SP, the step size can be any number lower or equal to OS, as long as the result NS remains an integer.
18 ** for example, if ZC=8,OS=5, you can set SP=1, the result is NS=40, and RNS must then be 63.
19 ** the result of that is the filter cutoff is set at nyquist * (SP/OS), in this case nyquist/5.
20 */
21
22 #define BLEP_ZCcxx . . $ `src/pt2_blep.h:22:9`! 16
23 #define BLEP_OScxx . . $ `src/pt2_blep.h:23:9`! 16
24 #define BLEP_SPcxx . . $ `src/pt2_blep.h:24:9`! 16
25 #define BLEP_NScxx . . $ `src/pt2_blep.h:25:9`! (BLEP_ZC * BLEP_OS / BLEP_SP)
26 #define BLEP_RNScxx . . $ `src/pt2_blep.h:26:9`! 31 // RNS = (2^ > NS) - 1
27
28 typedef struct blep_tcxx . . $ blep_t#
29 {
30 int32_tcxx . . $ int32_t# indexcxx . . $ blep_t#index., samplesLeftcxx . . $ blep_t#samplesLeft.;
31 float fBuffercxx . . $ blep_t#fBuffer.[BLEP_RNScxx . . $ `src/pt2_blep.h:26:9`!+1], fLastValuecxx . . $ blep_t#fLastValue.;
32 } blep_tcxx . . $ blep_t#;
33
34 void blepAddcxx . . $ blepAdd(878c0c6d9184ff8a).(blep_tcxx . . $ blep_t# *b, const float fOffset, const float fAmplitude);
35 float blepRuncxx . . $ blepRun(6ddfbab99006406a).(blep_tcxx . . $ blep_t# *b, const float fInput);