add many experimental plugins

This commit is contained in:
Luna 2020-01-25 18:52:45 -03:00
parent 9a6caa2453
commit 7c4dead5cf
11 changed files with 172 additions and 3 deletions

View file

@ -27,6 +27,11 @@ pub const CommandType = enum {
Vinyl,
RevDelay,
Gate,
Detune,
Overdrive,
Degrade,
RePsycho,
TalkBox,
Noise,
WildNoise,
@ -186,12 +191,17 @@ pub const Lang = struct {
_ = try self.keywords.put("vinyl", .Vinyl);
_ = try self.keywords.put("revdelay", .RevDelay);
_ = try self.keywords.put("gate", .Gate);
_ = try self.keywords.put("detune", .Detune);
_ = try self.keywords.put("overdrive", .Overdrive);
_ = try self.keywords.put("talkbox", .TalkBox);
// custom implementations (not lv2)
_ = try self.keywords.put("noise", .Noise);
_ = try self.keywords.put("wildnoise", .WildNoise);
_ = try self.keywords.put("write", .Write);
_ = try self.keywords.put("embed", .Embed);
_ = try self.keywords.put("degrade", .Degrade);
_ = try self.keywords.put("repsycho", .RePsycho);
// even more custom
_ = try self.keywords.put("rotate", .Rotate);

View file

@ -21,6 +21,11 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
.Vinyl => "vinyl",
.RevDelay => "revdelay",
.Gate => "gate",
.Detune => "detune",
.Overdrive => "overdrive",
.Degrade => "Degrade",
.RePsycho => "repsycho",
.TalkBox => "talkbox",
.Noise => "noise",
.WildNoise => "wildnoise",

View file

@ -299,6 +299,31 @@ pub const Runner = struct {
try image.runPlugin("http://hippie.lt/lv2/gate", pos, params);
}
fn detuneCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://drobilla.net/plugins/mda/Detune", pos, params);
}
fn overdriveCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://drobilla.net/plugins/mda/Overdrive", pos, params);
}
fn degradeCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://drobilla.net/plugins/mda/Degrade", pos, params);
}
fn repsychoCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://drobilla.net/plugins/mda/RePsycho", pos, params);
}
fn talkboxCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://drobilla.net/plugins/mda/TalkBox", pos, params);
}
fn runCommand(self: *Runner, cmd: *lang.Command) !void {
var params = ParamList.init(self.allocator);
defer params.deinit();
@ -493,6 +518,54 @@ pub const Runner = struct {
try self.gateCmd(pos, params);
},
.Detune => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "detune");
try cmd.appendParam(&params, "mix");
try cmd.appendParam(&params, "output");
try cmd.appendParam(&params, "latency");
try self.detuneCmd(pos, params);
},
.Overdrive => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "drive");
try cmd.appendParam(&params, "muffle");
try cmd.appendParam(&params, "output");
try self.overdriveCmd(pos, params);
},
.Degrade => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "headroom");
try cmd.appendParam(&params, "quant");
try cmd.appendParam(&params, "rate");
try cmd.appendParam(&params, "post_filt");
try cmd.appendParam(&params, "non_lin");
try cmd.appendParam(&params, "output");
try self.degradeCmd(pos, params);
},
.RePsycho => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "tune");
try cmd.appendParam(&params, "fine");
try cmd.appendParam(&params, "decay");
try cmd.appendParam(&params, "thresh");
try cmd.appendParam(&params, "hold");
try cmd.appendParam(&params, "mix");
try cmd.appendParam(&params, "quality");
try self.repsychoCmd(pos, params);
},
.TalkBox => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "wet");
try cmd.appendParam(&params, "dry");
try cmd.appendParam(&params, "carrier");
try cmd.appendParam(&params, "quality");
try self.talkboxCmd(pos, params);
},
else => blk: {
std.debug.warn("Unsupported command: {}\n", .{cmd.command});
break :blk RunError.UnknownCommand;