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.
## `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

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,
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);

View File

@ -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",

View File

@ -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(&params, "base");
try self.moddelayCmd(pos, params);
},
else => blk: {
std.debug.warn("Unsupported command: {}\n", .{cmd.command});
break :blk RunError.UnknownCommand;