add gverb cmd

This commit is contained in:
Luna 2020-01-26 00:03:15 -03:00
parent c73b7440a6
commit 299a39fc27
5 changed files with 35 additions and 0 deletions

View File

@ -276,3 +276,15 @@ other presets:
Fast Overdrive from SWH plugins.
- drive: 1..3, default 1
## `gverb split index roomsize revtime damping drylevel earlylevel taillevel`
GVerb algorithm from SWH plugins.
- roomsize (meters): 1..300, default 75.75
- revtime (reverb time, seconds): 0.1..30, default 7.575
- damping: 0..1, default 0.5
- inputbandwidth: 0..1, default 0.75
- drylevel (dB): -70..0, default 0
- earlylevel (dB): -70..0, default 0
- taillevel (dB): -70..0, default -17.5

3
examples/gverb.scri Normal file
View File

@ -0,0 +1,3 @@
load :0;
gverb 3 1 75.75 7.575 0.5 0.75 0 0 -17.5;
quicksave;

View File

@ -35,6 +35,7 @@ pub const CommandType = enum {
DynComp,
ThruZero,
Foverdrive,
Gverb,
Noise,
WildNoise,
@ -199,6 +200,7 @@ pub const Lang = struct {
_ = try self.keywords.put("talkbox", .TalkBox);
_ = try self.keywords.put("thruzero", .ThruZero);
_ = try self.keywords.put("foverdrive", .Foverdrive);
_ = try self.keywords.put("gverb", .Gverb);
// custom implementations (not lv2)
_ = try self.keywords.put("noise", .Noise);

View File

@ -29,6 +29,7 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
.DynComp => "dyncomp",
.ThruZero => "thruzero",
.Foverdrive => "foverdrive",
.Gverb => "gverb",
.Noise => "noise",
.WildNoise => "wildnoise",

View File

@ -339,6 +339,11 @@ pub const Runner = struct {
try image.runPlugin("http://drobilla.net/plugins/mda/ThruZero", pos, params);
}
fn gverbCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://plugin.org.uk/swh-plugins/gverb", pos, params);
}
fn runCommand(self: *Runner, cmd: *lang.Command) !void {
var params = ParamList.init(self.allocator);
defer params.deinit();
@ -612,6 +617,18 @@ pub const Runner = struct {
try self.foverdriveCmd(pos, params);
},
.Gverb => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "roomsize");
try cmd.appendParam(&params, "revtime");
try cmd.appendParam(&params, "damping");
try cmd.appendParam(&params, "inputbandwidth");
try cmd.appendParam(&params, "drylevel");
try cmd.appendParam(&params, "earlylevel");
try cmd.appendParam(&params, "taillevel");
try self.gverbCmd(pos, params);
},
else => blk: {
std.debug.warn("Unsupported command: {}\n", .{cmd.command});
break :blk RunError.UnknownCommand;