add saturator, vintagedelay cmd
This commit is contained in:
parent
bc8ab98689
commit
08d9923e75
6 changed files with 114 additions and 0 deletions
|
@ -40,6 +40,8 @@ pub const CommandType = enum {
|
|||
TapeDelay,
|
||||
ModDelay,
|
||||
MultiChorus,
|
||||
Saturator,
|
||||
VintageDelay,
|
||||
|
||||
Noise,
|
||||
WildNoise,
|
||||
|
@ -209,6 +211,8 @@ pub const Lang = struct {
|
|||
_ = try self.keywords.put("tapedelay", .TapeDelay);
|
||||
_ = try self.keywords.put("moddelay", .ModDelay);
|
||||
_ = try self.keywords.put("multichorus", .MultiChorus);
|
||||
_ = try self.keywords.put("saturator", .Saturator);
|
||||
_ = try self.keywords.put("vintagedelay", .VintageDelay);
|
||||
|
||||
// custom implementations (not lv2)
|
||||
_ = try self.keywords.put("noise", .Noise);
|
||||
|
|
|
@ -34,6 +34,8 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
|
|||
.TapeDelay => "tapedelay",
|
||||
.ModDelay => "moddelay",
|
||||
.MultiChorus => "multichorus",
|
||||
.Saturator => "saturator",
|
||||
.VintageDelay => "vintagedelay",
|
||||
|
||||
.Noise => "noise",
|
||||
.WildNoise => "wildnoise",
|
||||
|
|
|
@ -364,6 +364,16 @@ pub const Runner = struct {
|
|||
try image.runPlugin("http://calf.sourceforge.net/plugins/MultiChorus", pos, params);
|
||||
}
|
||||
|
||||
fn saturatorCmd(self: *Runner, pos: Position, params: ParamList) !void {
|
||||
var image = try self.getImage();
|
||||
try image.runPlugin("http://calf.sourceforge.net/plugins/Saturator", pos, params);
|
||||
}
|
||||
|
||||
fn vintagedelayCmd(self: *Runner, pos: Position, params: ParamList) !void {
|
||||
var image = try self.getImage();
|
||||
try image.runPlugin("http://calf.sourceforge.net/plugins/VintageDelay", pos, params);
|
||||
}
|
||||
|
||||
fn runCommand(self: *Runner, cmd: *lang.Command) !void {
|
||||
var params = ParamList.init(self.allocator);
|
||||
defer params.deinit();
|
||||
|
@ -700,6 +710,58 @@ pub const Runner = struct {
|
|||
try self.multichorusCmd(pos, params);
|
||||
},
|
||||
|
||||
.Saturator => {
|
||||
const pos = try cmd.consumePosition();
|
||||
|
||||
try cmd.appendParam(¶ms, "bypass");
|
||||
try cmd.appendParam(¶ms, "level_in");
|
||||
try cmd.appendParam(¶ms, "level_out");
|
||||
try cmd.appendParam(¶ms, "mix");
|
||||
try cmd.appendParam(¶ms, "drive");
|
||||
try cmd.appendParam(¶ms, "blend");
|
||||
try cmd.appendParam(¶ms, "lp_pre_freq");
|
||||
try cmd.appendParam(¶ms, "hp_pre_freq");
|
||||
try cmd.appendParam(¶ms, "lp_post_freq");
|
||||
try cmd.appendParam(¶ms, "hp_post_freq");
|
||||
try cmd.appendParam(¶ms, "p_freq");
|
||||
try cmd.appendParam(¶ms, "p_level");
|
||||
try cmd.appendParam(¶ms, "p_q");
|
||||
try cmd.appendParam(¶ms, "pre");
|
||||
try cmd.appendParam(¶ms, "post");
|
||||
try self.saturatorCmd(pos, params);
|
||||
},
|
||||
|
||||
.VintageDelay => {
|
||||
const pos = try cmd.consumePosition();
|
||||
const PARAMS = [_][]const u8{
|
||||
"level_in",
|
||||
"level_out",
|
||||
"subdiv",
|
||||
"time_l",
|
||||
"time_r",
|
||||
"feedback",
|
||||
"amount",
|
||||
"mix_mode",
|
||||
"medium",
|
||||
"dry",
|
||||
"width",
|
||||
"fragmentation",
|
||||
"pbeats",
|
||||
"pfrag",
|
||||
"timing",
|
||||
"bpm",
|
||||
"ms",
|
||||
"hz",
|
||||
"bpm_host",
|
||||
};
|
||||
|
||||
inline for (PARAMS) |param| {
|
||||
try cmd.appendParam(¶ms, param);
|
||||
}
|
||||
|
||||
try self.vintagedelayCmd(pos, params);
|
||||
},
|
||||
|
||||
else => blk: {
|
||||
std.debug.warn("Unsupported command: {}\n", .{cmd.command});
|
||||
break :blk RunError.UnknownCommand;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue