add multichorus cmd

This commit is contained in:
Luna 2020-01-26 14:03:01 -03:00
parent 127ea389fd
commit bc8ab98689
6 changed files with 53 additions and 1 deletions

View file

@ -39,6 +39,7 @@ pub const CommandType = enum {
Invert,
TapeDelay,
ModDelay,
MultiChorus,
Noise,
WildNoise,
@ -207,6 +208,7 @@ pub const Lang = struct {
_ = try self.keywords.put("invert", .Invert);
_ = try self.keywords.put("tapedelay", .TapeDelay);
_ = try self.keywords.put("moddelay", .ModDelay);
_ = try self.keywords.put("multichorus", .MultiChorus);
// custom implementations (not lv2)
_ = try self.keywords.put("noise", .Noise);

View file

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

View file

@ -359,6 +359,11 @@ pub const Runner = struct {
try image.runPlugin("http://plugin.org.uk/swh-plugins/modDelay", pos, params);
}
fn multichorusCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://calf.sourceforge.net/plugins/MultiChorus", pos, params);
}
fn runCommand(self: *Runner, cmd: *lang.Command) !void {
var params = ParamList.init(self.allocator);
defer params.deinit();
@ -675,6 +680,26 @@ pub const Runner = struct {
try self.moddelayCmd(pos, params);
},
.MultiChorus => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "min_delay");
try cmd.appendParam(&params, "mod_depth");
try cmd.appendParam(&params, "mod_rate");
try cmd.appendParam(&params, "stereo");
try cmd.appendParam(&params, "voices");
try cmd.appendParam(&params, "vphase");
try cmd.appendParam(&params, "amount");
try cmd.appendParam(&params, "dry");
try cmd.appendParam(&params, "freq");
try cmd.appendParam(&params, "freq2");
try cmd.appendParam(&params, "q");
try cmd.appendParam(&params, "overlap");
try cmd.appendParam(&params, "level_in");
try cmd.appendParam(&params, "level_out");
try cmd.appendParam(&params, "lfo");
try self.multichorusCmd(pos, params);
},
else => blk: {
std.debug.warn("Unsupported command: {}\n", .{cmd.command});
break :blk RunError.UnknownCommand;