add thruzero command
This commit is contained in:
parent
046e43a68c
commit
fa8740e0db
5 changed files with 31 additions and 0 deletions
|
@ -33,6 +33,7 @@ pub const CommandType = enum {
|
|||
RePsycho,
|
||||
TalkBox,
|
||||
DynComp,
|
||||
ThruZero,
|
||||
|
||||
Noise,
|
||||
WildNoise,
|
||||
|
@ -195,6 +196,7 @@ pub const Lang = struct {
|
|||
_ = try self.keywords.put("detune", .Detune);
|
||||
_ = try self.keywords.put("overdrive", .Overdrive);
|
||||
_ = try self.keywords.put("talkbox", .TalkBox);
|
||||
_ = try self.keywords.put("thruzero", .ThruZero);
|
||||
|
||||
// custom implementations (not lv2)
|
||||
_ = try self.keywords.put("noise", .Noise);
|
||||
|
|
|
@ -27,6 +27,7 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
|
|||
.RePsycho => "repsycho",
|
||||
.TalkBox => "talkbox",
|
||||
.DynComp => "dyncomp",
|
||||
.ThruZero => "thruzero",
|
||||
|
||||
.Noise => "noise",
|
||||
.WildNoise => "wildnoise",
|
||||
|
|
|
@ -329,6 +329,11 @@ pub const Runner = struct {
|
|||
try image.runPlugin("http://gareus.org/oss/lv2/darc#mono", pos, params);
|
||||
}
|
||||
|
||||
fn thruZeroCmd(self: *Runner, pos: Position, params: ParamList) !void {
|
||||
var image = try self.getImage();
|
||||
try image.runPlugin("http://drobilla.net/plugins/mda/ThruZero", pos, params);
|
||||
}
|
||||
|
||||
fn runCommand(self: *Runner, cmd: *lang.Command) !void {
|
||||
var params = ParamList.init(self.allocator);
|
||||
defer params.deinit();
|
||||
|
@ -587,6 +592,15 @@ pub const Runner = struct {
|
|||
try self.dynCompCmd(pos, params);
|
||||
},
|
||||
|
||||
.ThruZero => {
|
||||
const pos = try cmd.consumePosition();
|
||||
try cmd.appendParam(¶ms, "rate");
|
||||
try cmd.appendParam(¶ms, "mix");
|
||||
try cmd.appendParam(¶ms, "feedback");
|
||||
try cmd.appendParam(¶ms, "depth_mod");
|
||||
try self.thruZeroCmd(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