diff --git a/doc/README.md b/doc/README.md index 4ce663a..d0509c0 100644 --- a/doc/README.md +++ b/doc/README.md @@ -293,7 +293,7 @@ GVerb algorithm from SWH plugins. > A utility plugin that inverts the signal, also (wrongly) known as a 180 degree phase shift. -## `tapedelay split index` +## `tapedelay split index speed da_db t1d t1a_db...` **TODO:** gives 0 output @@ -311,3 +311,9 @@ GVerb algorithm from SWH plugins. - t3a\_db (tap 3 level, dB): -90..0, default -90 - t4d (tap 4 distance, inches): 0..4, default 3 - t4a\_db (tap 4 level, dB): -90..0, default -90 + +## `moddelay split index` + +> A delay whose tap can be modulated at audio rate. + + - base (base delay, seconds): 0..1, default 1 diff --git a/examples/moddelay.scri b/examples/moddelay.scri new file mode 100644 index 0000000..202cafb --- /dev/null +++ b/examples/moddelay.scri @@ -0,0 +1,3 @@ +load :0; +moddelay 3 1 1; +quicksave; diff --git a/src/lang.zig b/src/lang.zig index dd91bd6..ae3e8cd 100644 --- a/src/lang.zig +++ b/src/lang.zig @@ -38,6 +38,7 @@ pub const CommandType = enum { Gverb, Invert, TapeDelay, + ModDelay, Noise, WildNoise, @@ -205,6 +206,7 @@ pub const Lang = struct { _ = try self.keywords.put("gverb", .Gverb); _ = try self.keywords.put("invert", .Invert); _ = try self.keywords.put("tapedelay", .TapeDelay); + _ = try self.keywords.put("moddelay", .ModDelay); // custom implementations (not lv2) _ = try self.keywords.put("noise", .Noise); diff --git a/src/printer.zig b/src/printer.zig index 8491328..6dfc508 100644 --- a/src/printer.zig +++ b/src/printer.zig @@ -32,6 +32,7 @@ pub fn printList(list: langs.CommandList, stream: var) !void { .Gverb => "gverb", .Invert => "invert", .TapeDelay => "tapedelay", + .ModDelay => "moddelay", .Noise => "noise", .WildNoise => "wildnoise", diff --git a/src/runner.zig b/src/runner.zig index 7bc870d..3a9a007 100644 --- a/src/runner.zig +++ b/src/runner.zig @@ -354,6 +354,11 @@ pub const Runner = struct { try image.runPlugin("http://plugin.org.uk/swh-plugins/tapeDelay", pos, params); } + fn moddelayCmd(self: *Runner, pos: Position, params: ParamList) !void { + var image = try self.getImage(); + try image.runPlugin("http://plugin.org.uk/swh-plugins/modDelay", pos, params); + } + fn runCommand(self: *Runner, cmd: *lang.Command) !void { var params = ParamList.init(self.allocator); defer params.deinit(); @@ -664,6 +669,12 @@ pub const Runner = struct { try self.tapedelayCmd(pos, params); }, + .ModDelay => { + const pos = try cmd.consumePosition(); + try cmd.appendParam(¶ms, "base"); + try self.moddelayCmd(pos, params); + }, + else => blk: { std.debug.warn("Unsupported command: {}\n", .{cmd.command}); break :blk RunError.UnknownCommand;