diff --git a/doc/README.md b/doc/README.md index b3cc13c..5611dc3 100644 --- a/doc/README.md +++ b/doc/README.md @@ -23,8 +23,7 @@ where in the file you want the plugin to be ran. so, if you did `plugin 3 1...`, it would split the file in 3, then get the part that is of index 1 (starting at 0). -**Keep in mind parts can start from either top or bottom of the image, -it depends of the file format** +**Keep in mind parts start from the bottom of the file.** ## `load path_or_arg` @@ -260,7 +259,7 @@ other presets: - gain\_max (dB): -20..40 - rms (signal level, dB): -80..10 -## `thruzero split index rate mix feedback depth_mod` +## `thruzero split index > Tape flanger and ADT @@ -270,21 +269,3 @@ other presets: - 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 - -## `foverdrive split index drive` - -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 diff --git a/examples/foverdrive.scri b/examples/foverdrive.scri deleted file mode 100644 index a4ac785..0000000 --- a/examples/foverdrive.scri +++ /dev/null @@ -1,3 +0,0 @@ -load :0; -foverdrive 3 1 100; -quicksave; diff --git a/examples/gverb.scri b/examples/gverb.scri deleted file mode 100644 index f9aced0..0000000 --- a/examples/gverb.scri +++ /dev/null @@ -1,3 +0,0 @@ -load :0; -gverb 3 1 75.75 7.575 0.5 0.75 0 0 -17.5; -quicksave; diff --git a/src/lang.zig b/src/lang.zig index 60bf549..67cbfcc 100644 --- a/src/lang.zig +++ b/src/lang.zig @@ -34,8 +34,6 @@ pub const CommandType = enum { TalkBox, DynComp, ThruZero, - Foverdrive, - Gverb, Noise, WildNoise, @@ -199,8 +197,6 @@ pub const Lang = struct { _ = try self.keywords.put("overdrive", .Overdrive); _ = 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); @@ -225,6 +221,69 @@ pub const Lang = struct { } } + // NOTE this is fallback since std.AutoHashMap does not follow + // pointers anymore (in master). + fn oldGetCommand(self: *Lang, stmt: []const u8) ?CommandType { + const commands = [_][]const u8{ + "noop", + "load", + "quicksave", + "runqs", + "amp", + "rflanger", + "eq", + "phaser", + "mbeq", + "chorus", + "pitchscaler", + "reverb", + "highpass", + "delay", + "vinyl", + "revdelay", + "noise", + "wildnoise", + "write", + "embed", + "rotate", + }; + + const command_types = [_]CommandType{ + .Noop, + .Load, + .Quicksave, + .RunQS, + + .Amp, + .RFlanger, + .Eq, + .Phaser, + .Mbeq, + .Chorus, + .PitchScaler, + .Reverb, + .Highpass, + .Delay, + .Vinyl, + .RevDelay, + + .Noise, + .WildNoise, + .Write, + .Embed, + + .Rotate, + }; + + std.debug.assert(commands.len == command_types.len); + + for (commands) |command, idx| { + if (std.mem.eql(u8, stmt, command)) return command_types[idx]; + } + + return null; + } + fn expectAny(self: *Lang, count: usize, args: ArgList) !void { if (args.len != count) { self.doError("expected {} arguments, found {}", .{ count, args.len }); diff --git a/src/printer.zig b/src/printer.zig index 1fb6c68..b02f226 100644 --- a/src/printer.zig +++ b/src/printer.zig @@ -28,8 +28,6 @@ pub fn printList(list: langs.CommandList, stream: var) !void { .TalkBox => "talkbox", .DynComp => "dyncomp", .ThruZero => "thruzero", - .Foverdrive => "foverdrive", - .Gverb => "gverb", .Noise => "noise", .WildNoise => "wildnoise", diff --git a/src/runner.zig b/src/runner.zig index 451dac5..ab02cd5 100644 --- a/src/runner.zig +++ b/src/runner.zig @@ -329,21 +329,11 @@ pub const Runner = struct { try image.runPlugin("http://gareus.org/oss/lv2/darc#mono", pos, params); } - fn foverdriveCmd(self: *Runner, pos: Position, params: ParamList) !void { - var image = try self.getImage(); - try image.runPlugin("http://plugin.org.uk/swh-plugins/foverdrive", 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 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(); @@ -611,24 +601,6 @@ pub const Runner = struct { try self.thruZeroCmd(pos, params); }, - .Foverdrive => { - const pos = try cmd.consumePosition(); - try cmd.appendParam(¶ms, "drive"); - try self.foverdriveCmd(pos, params); - }, - - .Gverb => { - const pos = try cmd.consumePosition(); - try cmd.appendParam(¶ms, "roomsize"); - try cmd.appendParam(¶ms, "revtime"); - try cmd.appendParam(¶ms, "damping"); - try cmd.appendParam(¶ms, "inputbandwidth"); - try cmd.appendParam(¶ms, "drylevel"); - try cmd.appendParam(¶ms, "earlylevel"); - try cmd.appendParam(¶ms, "taillevel"); - try self.gverbCmd(pos, params); - }, - else => blk: { std.debug.warn("Unsupported command: {}\n", .{cmd.command}); break :blk RunError.UnknownCommand;