~pbatch/soundpipe

soundpipe/tangled/phasewarp.c -rw-r--r-- 592 bytes
49c52318Paul Batchelor fix talkbox typos 4 days ago
                                                                                
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
#line 26 "phasewarp.org"
#include "phasewarp.h"
#line 54 "phasewarp.org"
SKFLT sk_phasewarp_tick(SKFLT in, SKFLT warp)
{
    SKFLT out;
    SKFLT wmp;

    out = 0;

#line 71 "phasewarp.org"
wmp = (warp + 1.0) * 0.5;
#line 54 "phasewarp.org"
#line 80 "phasewarp.org"
if (in < wmp) {
#line 92 "phasewarp.org"
if (wmp != 0) out = ((SKFLT)0.5 / wmp) * in;
#line 82 "phasewarp.org"
} else {
#line 101 "phasewarp.org"
if (wmp != 1.0) {
    out = ((SKFLT)0.5 / (SKFLT)(1.0 - wmp)) * (in - wmp) + 0.5;
}
#line 84 "phasewarp.org"
}
#line 63 "phasewarp.org"
    return out;
}
#line 26 "phasewarp.org"