add thruzero command

This commit is contained in:
Luna 2020-01-25 23:32:24 -03:00
parent 046e43a68c
commit fa8740e0db
5 changed files with 31 additions and 0 deletions

View file

@ -258,3 +258,14 @@ other presets:
- gain\_min (dB): -20..40 - gain\_min (dB): -20..40
- gain\_max (dB): -20..40 - gain\_max (dB): -20..40
- rms (signal level, dB): -80..10 - rms (signal level, dB): -80..10
## `thruzero split index
> Tape flanger and ADT
> This plug simulates tape-flanging, where two copies of a signal cancel out completely as the tapes pass each other. It can also be used for other "modulated delay" effects such as phasing and simple chorusing.
- rate (modulation rate, set to minimum for static comb filtering): 0..1, default 0.3
- mix (wet/dry mix, set to 50% for complete cancelling): 0..1, default 0.47
- feedback (add positive or negative feedback for harsher or "ringing" sound): 0..1, default 0.3
- depth_mod (modulation depth, set to less than 100% to limit build up of low frequencies with feedback): 0..1, default 1

3
examples/thruzero.scri Normal file
View file

@ -0,0 +1,3 @@
load :0;
thruzero 3 1 0.3 0.47 0.3 1;
quicksave;

View file

@ -33,6 +33,7 @@ pub const CommandType = enum {
RePsycho, RePsycho,
TalkBox, TalkBox,
DynComp, DynComp,
ThruZero,
Noise, Noise,
WildNoise, WildNoise,
@ -195,6 +196,7 @@ pub const Lang = struct {
_ = try self.keywords.put("detune", .Detune); _ = try self.keywords.put("detune", .Detune);
_ = try self.keywords.put("overdrive", .Overdrive); _ = try self.keywords.put("overdrive", .Overdrive);
_ = try self.keywords.put("talkbox", .TalkBox); _ = try self.keywords.put("talkbox", .TalkBox);
_ = try self.keywords.put("thruzero", .ThruZero);
// custom implementations (not lv2) // custom implementations (not lv2)
_ = try self.keywords.put("noise", .Noise); _ = try self.keywords.put("noise", .Noise);

View file

@ -27,6 +27,7 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
.RePsycho => "repsycho", .RePsycho => "repsycho",
.TalkBox => "talkbox", .TalkBox => "talkbox",
.DynComp => "dyncomp", .DynComp => "dyncomp",
.ThruZero => "thruzero",
.Noise => "noise", .Noise => "noise",
.WildNoise => "wildnoise", .WildNoise => "wildnoise",

View file

@ -329,6 +329,11 @@ pub const Runner = struct {
try image.runPlugin("http://gareus.org/oss/lv2/darc#mono", pos, params); 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 { fn runCommand(self: *Runner, cmd: *lang.Command) !void {
var params = ParamList.init(self.allocator); var params = ParamList.init(self.allocator);
defer params.deinit(); defer params.deinit();
@ -587,6 +592,15 @@ pub const Runner = struct {
try self.dynCompCmd(pos, params); try self.dynCompCmd(pos, params);
}, },
.ThruZero => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "rate");
try cmd.appendParam(&params, "mix");
try cmd.appendParam(&params, "feedback");
try cmd.appendParam(&params, "depth_mod");
try self.thruZeroCmd(pos, params);
},
else => blk: { else => blk: {
std.debug.warn("Unsupported command: {}\n", .{cmd.command}); std.debug.warn("Unsupported command: {}\n", .{cmd.command});
break :blk RunError.UnknownCommand; break :blk RunError.UnknownCommand;