add saturator, vintagedelay cmd

This commit is contained in:
Luna 2020-01-26 14:50:50 -03:00
parent bc8ab98689
commit 08d9923e75
6 changed files with 114 additions and 0 deletions

View file

@ -337,3 +337,43 @@ Calf Multi Chorus
- `level_in` (Input Gain): 0.0156250..64, default 1 - `level_in` (Input Gain): 0.0156250..64, default 1
- `level_out` (Output Gain): 0.0156250..64, default 1 - `level_out` (Output Gain): 0.0156250..64, default 1
- `lfo` (toggle): 0..1, default 1 - `lfo` (toggle): 0..1, default 1
## `saturator split index bypass level_in level_out mix drive blend lp_pre_freq hp_pre_fre lp_post_freq hp_post_freq p_freq p_level p_q pre post`
- `bypass` (toggle): 0..1, default 0
- `level_in` (Input Gain): 0.0156250..64, default 1
- `level_out` (Output Gain): 0.0156250..64, default 1
- `mix`: 0..1, default 1
- `drive` (saturation, coef): 0.1..10, default 5
- `blend` (coef): -10..10, default 10
- `lp_pre_freq` (lowpass, hz): 10..20000, default 20000
- `hp_pre_freq` (highpass, hz): 10..20000, default 10
- `lp_post_freq` (lowpass, hz): 10..20000, default 20000
- `hp_post_freq` (highpass, hz): 10..20000, default 10
- `p_freq` (Tone, hz): 80..8000, default 2000
- `p_level` (Amount): 0.0625..16, default 1
- `p_q` (???, coef): 0.1..10, default 1
- `pre` (Activate Pre, toggle): 0..1, default 0
- `post` (Activate Post, toggle): 0..1, default 0
## `vintagedelay split index ...`
- `level_in` (Input Gain): 0.0156250..64, default 1
- `level_out` (Output Gain): 0.0156250..64, default 1
- `subdiv` (int): 1..16, default 4
- `time_l` (int): 1..16, default 3
- `time_r` (int): 1..16, default 5
- `feedback`: 0..1, default 0.5
- `amount` (Wet): 0..4, default 0.25
- `mix_mode` (enum): Stereo=0, Ping-Pong=1, L then R=2, R then L=3, default 1
- `medium` (enum): Plain=0, Tape=1, Old Tape=2, default 1
- `dry` (dry): 0..4, default 1
- `width` (stereo width, strict): -1..1, default 1
- `fragmentation` (enum): Repeating=0, Pattern=1, default 0
- `pbeats` (Pattern Beats, int): 1..8, default 4
- `pfrag` (Pattern Fragmentation, int): 1..8, default 4
- `timing` (enum): BPM=0, ms=1, Hz=2, Sync=3, default 0
- `bpm`: 30..300, default 120
- `ms` (int): 10..2000, default 500
- `hz`: 0.01..100, default 2
- `bpm_host` (strict): 1..300, default 120

3
examples/saturator.scri Normal file
View file

@ -0,0 +1,3 @@
load :0;
saturator 3 1 0 1 1 1 5 10 20000 10 20000 10 2000 1 1 0 0;
quicksave;

View file

@ -0,0 +1,3 @@
load :0;
vintagedelay 3 1 1 1 4 3 5 0.5 0.25 1 1 1 1 0 4 4 0 120 500 2 120;
quicksave;

View file

@ -40,6 +40,8 @@ pub const CommandType = enum {
TapeDelay, TapeDelay,
ModDelay, ModDelay,
MultiChorus, MultiChorus,
Saturator,
VintageDelay,
Noise, Noise,
WildNoise, WildNoise,
@ -209,6 +211,8 @@ pub const Lang = struct {
_ = try self.keywords.put("tapedelay", .TapeDelay); _ = try self.keywords.put("tapedelay", .TapeDelay);
_ = try self.keywords.put("moddelay", .ModDelay); _ = try self.keywords.put("moddelay", .ModDelay);
_ = try self.keywords.put("multichorus", .MultiChorus); _ = try self.keywords.put("multichorus", .MultiChorus);
_ = try self.keywords.put("saturator", .Saturator);
_ = try self.keywords.put("vintagedelay", .VintageDelay);
// custom implementations (not lv2) // custom implementations (not lv2)
_ = try self.keywords.put("noise", .Noise); _ = try self.keywords.put("noise", .Noise);

View file

@ -34,6 +34,8 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
.TapeDelay => "tapedelay", .TapeDelay => "tapedelay",
.ModDelay => "moddelay", .ModDelay => "moddelay",
.MultiChorus => "multichorus", .MultiChorus => "multichorus",
.Saturator => "saturator",
.VintageDelay => "vintagedelay",
.Noise => "noise", .Noise => "noise",
.WildNoise => "wildnoise", .WildNoise => "wildnoise",

View file

@ -364,6 +364,16 @@ pub const Runner = struct {
try image.runPlugin("http://calf.sourceforge.net/plugins/MultiChorus", pos, params); try image.runPlugin("http://calf.sourceforge.net/plugins/MultiChorus", pos, params);
} }
fn saturatorCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://calf.sourceforge.net/plugins/Saturator", pos, params);
}
fn vintagedelayCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://calf.sourceforge.net/plugins/VintageDelay", 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();
@ -700,6 +710,58 @@ pub const Runner = struct {
try self.multichorusCmd(pos, params); try self.multichorusCmd(pos, params);
}, },
.Saturator => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "bypass");
try cmd.appendParam(&params, "level_in");
try cmd.appendParam(&params, "level_out");
try cmd.appendParam(&params, "mix");
try cmd.appendParam(&params, "drive");
try cmd.appendParam(&params, "blend");
try cmd.appendParam(&params, "lp_pre_freq");
try cmd.appendParam(&params, "hp_pre_freq");
try cmd.appendParam(&params, "lp_post_freq");
try cmd.appendParam(&params, "hp_post_freq");
try cmd.appendParam(&params, "p_freq");
try cmd.appendParam(&params, "p_level");
try cmd.appendParam(&params, "p_q");
try cmd.appendParam(&params, "pre");
try cmd.appendParam(&params, "post");
try self.saturatorCmd(pos, params);
},
.VintageDelay => {
const pos = try cmd.consumePosition();
const PARAMS = [_][]const u8{
"level_in",
"level_out",
"subdiv",
"time_l",
"time_r",
"feedback",
"amount",
"mix_mode",
"medium",
"dry",
"width",
"fragmentation",
"pbeats",
"pfrag",
"timing",
"bpm",
"ms",
"hz",
"bpm_host",
};
inline for (PARAMS) |param| {
try cmd.appendParam(&params, param);
}
try self.vintagedelayCmd(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;