add moddelay cmd

This commit is contained in:
Luna 2020-01-26 02:05:43 -03:00
parent a0a75579dd
commit 127ea389fd
5 changed files with 24 additions and 1 deletions

View file

@ -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. > 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 **TODO:** gives 0 output
@ -311,3 +311,9 @@ GVerb algorithm from SWH plugins.
- t3a\_db (tap 3 level, dB): -90..0, default -90 - t3a\_db (tap 3 level, dB): -90..0, default -90
- t4d (tap 4 distance, inches): 0..4, default 3 - t4d (tap 4 distance, inches): 0..4, default 3
- t4a\_db (tap 4 level, dB): -90..0, default -90 - 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

3
examples/moddelay.scri Normal file
View file

@ -0,0 +1,3 @@
load :0;
moddelay 3 1 1;
quicksave;

View file

@ -38,6 +38,7 @@ pub const CommandType = enum {
Gverb, Gverb,
Invert, Invert,
TapeDelay, TapeDelay,
ModDelay,
Noise, Noise,
WildNoise, WildNoise,
@ -205,6 +206,7 @@ pub const Lang = struct {
_ = try self.keywords.put("gverb", .Gverb); _ = try self.keywords.put("gverb", .Gverb);
_ = try self.keywords.put("invert", .Invert); _ = try self.keywords.put("invert", .Invert);
_ = try self.keywords.put("tapedelay", .TapeDelay); _ = try self.keywords.put("tapedelay", .TapeDelay);
_ = try self.keywords.put("moddelay", .ModDelay);
// custom implementations (not lv2) // custom implementations (not lv2)
_ = try self.keywords.put("noise", .Noise); _ = try self.keywords.put("noise", .Noise);

View file

@ -32,6 +32,7 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
.Gverb => "gverb", .Gverb => "gverb",
.Invert => "invert", .Invert => "invert",
.TapeDelay => "tapedelay", .TapeDelay => "tapedelay",
.ModDelay => "moddelay",
.Noise => "noise", .Noise => "noise",
.WildNoise => "wildnoise", .WildNoise => "wildnoise",

View file

@ -354,6 +354,11 @@ pub const Runner = struct {
try image.runPlugin("http://plugin.org.uk/swh-plugins/tapeDelay", pos, params); 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 { fn runCommand(self: *Runner, cmd: *lang.Command) !void {
var params = ParamList.init(self.allocator); var params = ParamList.init(self.allocator);
defer params.deinit(); defer params.deinit();
@ -664,6 +669,12 @@ pub const Runner = struct {
try self.tapedelayCmd(pos, params); try self.tapedelayCmd(pos, params);
}, },
.ModDelay => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "base");
try self.moddelayCmd(pos, params);
},
else => blk: { else => blk: {
std.debug.warn("Unsupported command: {}\n", .{cmd.command}); std.debug.warn("Unsupported command: {}\n", .{cmd.command});
break :blk RunError.UnknownCommand; break :blk RunError.UnknownCommand;