diff --git a/doc/README.md b/doc/README.md index 6ab542d..e895de2 100644 --- a/doc/README.md +++ b/doc/README.md @@ -104,7 +104,7 @@ Parameters: - `gain`: Gain, 0..12, default 0 - `noClip`: Soft Clip (assumed boolean), 0..1, default 0 -## `delay seed gain feedback_pc tap_count first_delay delay_range delay_scale delay_rand_pc gain_scale wet` +## `delay seed gain` Parameters: - `seed`: Random seed, 0..1000, default 0 @@ -118,25 +118,10 @@ Parameters: - `gain_scale`: Amplitude change, 0.2..5, default 1 - `wet`: Dry/wet mix, 0..1, default 1 -## TODO `vinyl 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` Run an echo filter on the given loaded file. -## TODO `noise split index seed` - -Inject white noise on the image. - ## `quicksave` Save the file on the same directory of the file specified by `load`, but diff --git a/examples/vinyl.scri b/examples/vinyl.scri deleted file mode 100644 index 940d089..0000000 --- a/examples/vinyl.scri +++ /dev/null @@ -1,3 +0,0 @@ -load :0; -vinyl 3 1 1990 33 0 0 0; -quicksave; diff --git a/src/image.zig b/src/image.zig index 6fd37db..47991b3 100644 --- a/src/image.zig +++ b/src/image.zig @@ -212,12 +212,12 @@ pub const Image = struct { var ports = try lv2.setupPorts(&ctx); - if (ctx.n_audio_in > 2) { - std.debug.warn("plugin <{}> accepts more than two channels.\n", plugin_uri); + if (ctx.n_audio_in != 1) { + std.debug.warn("plugin <{}> does not accept mono input.\n", plugin_uri); return ImageError.InvalidPlugin; } - // TODO check n_audio_out > 2 + // TODO check n_audio_out // now, for each param for the plugin, we find its port, and set // the value for the port there. diff --git a/src/lang.zig b/src/lang.zig index bacb55a..fc5f1d6 100644 --- a/src/lang.zig +++ b/src/lang.zig @@ -24,7 +24,6 @@ pub const CommandType = enum { Reverb, Highpass, Delay, - Vinyl, }; pub const Command = struct { @@ -140,7 +139,6 @@ pub const Lang = struct { _ = try self.keywords.put("reverb", .Reverb); _ = try self.keywords.put("highpass", .Highpass); _ = try self.keywords.put("delay", .Delay); - _ = try self.keywords.put("vinyl", .Vinyl); } pub fn parse(self: *Lang, data: []const u8) !CommandList { diff --git a/src/plugin.zig b/src/plugin.zig index abc22f5..79094f6 100644 --- a/src/plugin.zig +++ b/src/plugin.zig @@ -72,14 +72,8 @@ pub const RunContext = struct { 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{ - .in_buf = in_buf, + .in_buf = try allocator.alloc(f32, 1), .out_buf = try allocator.alloc(f32, 2), .instance = instance.?, }; diff --git a/src/runner.zig b/src/runner.zig index 0ebc0eb..a8042ca 100644 --- a/src/runner.zig +++ b/src/runner.zig @@ -235,11 +235,6 @@ pub const Runner = struct { try image.runPlugin("http://plugin.org.uk/swh-plugins/delayorama", pos, params); } - fn vinylCmd(self: *Runner, pos: Position, params: ParamList) !void { - var image = try self.getImage(); - try image.runPlugin("http://plugin.org.uk/swh-plugins/vynil", pos, params); - } - fn runCommand(self: *Runner, cmd: *lang.Command) !void { var params = ParamList.init(self.allocator); defer params.deinit(); @@ -355,18 +350,6 @@ pub const Runner = struct { try self.delayCmd(pos, params); }, - .Vinyl => blk: { - const pos = try cmd.consumePosition(); - - try cmd.appendParam(¶ms, "year"); - try cmd.appendParam(¶ms, "rpm"); - try cmd.appendParam(¶ms, "warp"); - try cmd.appendParam(¶ms, "click"); - try cmd.appendParam(¶ms, "wear"); - - try self.vinylCmd(pos, params); - }, - else => blk: { std.debug.warn("Unsupported command: {}\n", cmd.command); break :blk RunError.UnknownCommand;