Skip to content

Commit

Permalink
updating bent delay
Browse files Browse the repository at this point in the history
  • Loading branch information
ssj71 committed Feb 2, 2018
1 parent 5e2ea9b commit 970a5de
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
16 changes: 10 additions & 6 deletions src/bentdelay/bentdelay.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
@prefix mod: <http://moddevices.com/ns/mod#> .
@prefix modgui: <http://moddevices.com/ns/modgui#> .

<http://ssj71.github.io/infamousPlugins/plugs.html#bentdelay>
a lv2:Plugin, lv2:DelayPlugin ;
Expand All @@ -17,9 +19,11 @@
foaf:homepage <http://ssj71.github.io/infamousPlugins> ;
foaf:mbox <mailto:[email protected]> ;
] ;
mod:brand "infamous";
mod:label "bent delay";
lv2:minorVersion 0 ;
lv2:microVersion 1 ;
rdfs:comment "This experimental delay subtracts a downsampled (aliased) delayed signal from the original. Makes bright gritty slapback sounds." ;
rdfs:comment "This lo-fi delay subtracts a downsampled (aliased) delayed signal from the original. Makes gritty slapback sounds or surprisingly warm textures." ;
lv2:optionalFeature lv2:hardRTCapable ;

lv2:port [
Expand All @@ -38,32 +42,32 @@
a lv2:InputPort, lv2:ControlPort ;
lv2:index 2 ;
lv2:symbol "DECIMATE" ;
lv2:name "Decimate" ;
lv2:name "Bend" ;
lv2:portProperty lv2:enumeration ;
lv2:scalePoint [ rdfs:label "1x"; rdf:value 0 ] ;
lv2:scalePoint [ rdfs:label "2x"; rdf:value 1 ] ;
lv2:scalePoint [ rdfs:label "4x"; rdf:value 2 ] ;
lv2:scalePoint [ rdfs:label "8x"; rdf:value 3 ] ;
lv2:scalePoint [ rdfs:label "16x"; rdf:value 4 ] ;
lv2:scalePoint [ rdfs:label "32x"; rdf:value 5 ] ;
lv2:default 2.0 ;
lv2:default 3.0 ;
lv2:minimum 0.0 ;
lv2:maximum 5.0 ;
], [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 3 ;
lv2:symbol "DELAY" ;
lv2:name "Delay" ;
lv2:default 500.0 ;
lv2:minimum -1400.0 ;
lv2:default 300.0 ;
lv2:minimum 0.0 ;
lv2:maximum 1400.0 ;
units:unit units:ms ;
], [
a lv2:InputPort, lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "FEEDBACK" ;
lv2:name "Feedback" ;
lv2:default 0.0 ;
lv2:default 50.0 ;
lv2:minimum 0.0 ;
lv2:maximum 100.0 ;
units:unit units:pc ;
Expand Down
15 changes: 5 additions & 10 deletions src/bentdelay/falter.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,23 @@ void run_falter(LV2_Handle handle, uint32_t nframes)
{
FALTER* plug = (FALTER*)handle;
float* in, *out, *buf, fb;
uint16_t i,w, pdelay, ndelay, mask, downmask;
uint16_t i,w, delay, mask, downmask;

in = plug->input_p;
out = plug->output_p;
buf = plug->buf;
w = plug->w;
mask = plug->mask;
downmask = (mask<<(uint8_t)*plug->decimate_p)&mask;
fb = *plug->feedback_p/100;
fb = *plug->feedback_p/100;


pdelay = ndelay = 0;
if(*plug->delay_p < 0)
ndelay = -*plug->delay_p*plug->sample_rate/1000;
else
pdelay = *plug->delay_p*plug->sample_rate/1000;
delay = *plug->delay_p*plug->sample_rate/1000.0;

for (i=0;i<nframes;i++)
{
buf[w] = in[i];
out[i] = buf[(w-pdelay)&mask] - buf[(w-ndelay)&downmask];
buf[w] += fb*out[i];
out[i] = buf[w] - buf[(w-delay)&downmask];
buf[w] -= fb*out[i];
w++;
w &= mask;
}
Expand Down
2 changes: 1 addition & 1 deletion src/bentdelay/falter.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum falter_ports
OUT,
DECIMATE,
DELAY,
FEEDBACK,
FEEDBACK
};

#endif

0 comments on commit 970a5de

Please sign in to comment.