add invert cmd
This commit is contained in:
parent
299a39fc27
commit
8c3c5a3ac2
|
@ -288,3 +288,7 @@ GVerb algorithm from SWH plugins.
|
||||||
- drylevel (dB): -70..0, default 0
|
- drylevel (dB): -70..0, default 0
|
||||||
- earlylevel (dB): -70..0, default 0
|
- earlylevel (dB): -70..0, default 0
|
||||||
- taillevel (dB): -70..0, default -17.5
|
- taillevel (dB): -70..0, default -17.5
|
||||||
|
|
||||||
|
## `invert split index`
|
||||||
|
|
||||||
|
> A utility plugin that inverts the signal, also (wrongly) known as a 180 degree phase shift.
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
load :0;
|
||||||
|
invert 3 1;
|
||||||
|
quicksave;
|
|
@ -36,6 +36,7 @@ pub const CommandType = enum {
|
||||||
ThruZero,
|
ThruZero,
|
||||||
Foverdrive,
|
Foverdrive,
|
||||||
Gverb,
|
Gverb,
|
||||||
|
Invert,
|
||||||
|
|
||||||
Noise,
|
Noise,
|
||||||
WildNoise,
|
WildNoise,
|
||||||
|
@ -201,6 +202,7 @@ pub const Lang = struct {
|
||||||
_ = try self.keywords.put("thruzero", .ThruZero);
|
_ = try self.keywords.put("thruzero", .ThruZero);
|
||||||
_ = try self.keywords.put("foverdrive", .Foverdrive);
|
_ = try self.keywords.put("foverdrive", .Foverdrive);
|
||||||
_ = try self.keywords.put("gverb", .Gverb);
|
_ = try self.keywords.put("gverb", .Gverb);
|
||||||
|
_ = try self.keywords.put("invert", .Invert);
|
||||||
|
|
||||||
// custom implementations (not lv2)
|
// custom implementations (not lv2)
|
||||||
_ = try self.keywords.put("noise", .Noise);
|
_ = try self.keywords.put("noise", .Noise);
|
||||||
|
|
|
@ -30,6 +30,7 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
|
||||||
.ThruZero => "thruzero",
|
.ThruZero => "thruzero",
|
||||||
.Foverdrive => "foverdrive",
|
.Foverdrive => "foverdrive",
|
||||||
.Gverb => "gverb",
|
.Gverb => "gverb",
|
||||||
|
.Invert => "invert",
|
||||||
|
|
||||||
.Noise => "noise",
|
.Noise => "noise",
|
||||||
.WildNoise => "wildnoise",
|
.WildNoise => "wildnoise",
|
||||||
|
|
|
@ -344,6 +344,11 @@ pub const Runner = struct {
|
||||||
try image.runPlugin("http://plugin.org.uk/swh-plugins/gverb", pos, params);
|
try image.runPlugin("http://plugin.org.uk/swh-plugins/gverb", pos, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn invertCmd(self: *Runner, pos: Position, params: ParamList) !void {
|
||||||
|
var image = try self.getImage();
|
||||||
|
try image.runPlugin("http://plugin.org.uk/swh-plugins/inv", 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();
|
||||||
|
@ -629,6 +634,11 @@ pub const Runner = struct {
|
||||||
try self.gverbCmd(pos, params);
|
try self.gverbCmd(pos, params);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
.Invert => {
|
||||||
|
const pos = try cmd.consumePosition();
|
||||||
|
try self.gverbCmd(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;
|
||||||
|
|
Loading…
Reference in New Issue