allow for stereo input (unused, though)

This commit is contained in:
Luna 2019-07-13 16:40:08 -03:00
parent 387984bff1
commit f07c989407
2 changed files with 23 additions and 2 deletions

View file

@ -104,7 +104,7 @@ Parameters:
- `gain`: Gain, 0..12, default 0 - `gain`: Gain, 0..12, default 0
- `noClip`: Soft Clip (assumed boolean), 0..1, default 0 - `noClip`: Soft Clip (assumed boolean), 0..1, default 0
## `delay seed gain` ## `delay seed gain feedback_pc tap_count first_delay delay_range delay_scale delay_rand_pc gain_scale wet`
Parameters: Parameters:
- `seed`: Random seed, 0..1000, default 0 - `seed`: Random seed, 0..1000, default 0
@ -118,10 +118,25 @@ Parameters:
- `gain_scale`: Amplitude change, 0.2..5, default 1 - `gain_scale`: Amplitude change, 0.2..5, default 1
- `wet`: Dry/wet mix, 0..1, default 1 - `wet`: Dry/wet mix, 0..1, default 1
## TODO `vynil split index year warp click wear`
VyNil effect from SWH.
Parameters:
- `year`: Year (int), 1900..1990, default 1990
- `rpm`: RPM (int), 33..78, default 33
- `warp`: Surface Warping, 0..1, default 0
- `click`: Crackle, 0..1, default 0
- `wear`: Wear, 0..1, default 0
## TODO `echo split index delay` ## TODO `echo split index delay`
Run an echo filter on the given loaded file. Run an echo filter on the given loaded file.
## TODO `noise split index seed`
Inject white noise on the image.
## `quicksave` ## `quicksave`
Save the file on the same directory of the file specified by `load`, but Save the file on the same directory of the file specified by `load`, but

View file

@ -72,8 +72,14 @@ pub const RunContext = struct {
return ImageError.InstantiateFail; return ImageError.InstantiateFail;
} }
// we allocate []f32 with size 2 to account for stereo plugins, however
// we only use &in_buf[0] and &out_buf[0], and don't use the
// (supposedly) right side of neither input or output.
var in_buf = try allocator.alloc(f32, 2);
std.mem.secureZero(f32, in_buf);
return RunContext{ return RunContext{
.in_buf = try allocator.alloc(f32, 1), .in_buf = in_buf,
.out_buf = try allocator.alloc(f32, 2), .out_buf = try allocator.alloc(f32, 2),
.instance = instance.?, .instance = instance.?,
}; };