add multichorus cmd

This commit is contained in:
Luna 2020-01-26 14:03:01 -03:00
parent 127ea389fd
commit bc8ab98689
6 changed files with 53 additions and 1 deletions

View file

@ -22,6 +22,7 @@ glitch art "framework", ???????? language??? something?
- the Invada Studio plugins ( https://launchpad.net/invada-studio/ )
- abGate plugin
- MDA plugins
- Calf plugins
```bash
# build and install

View file

@ -312,8 +312,28 @@ GVerb algorithm from SWH plugins.
- t4d (tap 4 distance, inches): 0..4, default 3
- t4a\_db (tap 4 level, dB): -90..0, default -90
## `moddelay split index`
## `moddelay split index base`
> A delay whose tap can be modulated at audio rate.
- base (base delay, seconds): 0..1, default 1
## `multichorus split index min_delay mod_depth mod_rate stereo voices vphase amount dry freq freq2 q overlap level_in level_out lfo`
Calf Multi Chorus
- `min_delay` (ms): 0.1..10, default 5
- `mod_depth` (ms): 0.1..10, default 6
- `mod_rate` (hz): 0.1..20, default 0.1
- `stereo` (degrees): 0..360, default 180
- `voices`: 1..8, default 4
- `vphase` (inter-voice phase, degrees): 0..360, default 64
- `amount`: 0..4, default 0.5
- `dry`: 0..4, default 0.5
- `freq` (center frq 1, hz): 10..20000, default 100
- `freq2` (center frq 2, hz): 10..20000, default 5000
- `q` (???): 0.125..8, default 0.125
- `overlap`: 0..1, default 0.75
- `level_in` (Input Gain): 0.0156250..64, default 1
- `level_out` (Output Gain): 0.0156250..64, default 1
- `lfo` (toggle): 0..1, default 1

View file

@ -0,0 +1,3 @@
load :0;
multichorus 3 1 5 6 0.1 180 4 64 0.5 0.5 100 5000 0.125 0.75 1 1 1;
quicksave;

View file

@ -39,6 +39,7 @@ pub const CommandType = enum {
Invert,
TapeDelay,
ModDelay,
MultiChorus,
Noise,
WildNoise,
@ -207,6 +208,7 @@ pub const Lang = struct {
_ = try self.keywords.put("invert", .Invert);
_ = try self.keywords.put("tapedelay", .TapeDelay);
_ = try self.keywords.put("moddelay", .ModDelay);
_ = try self.keywords.put("multichorus", .MultiChorus);
// custom implementations (not lv2)
_ = try self.keywords.put("noise", .Noise);

View file

@ -33,6 +33,7 @@ pub fn printList(list: langs.CommandList, stream: var) !void {
.Invert => "invert",
.TapeDelay => "tapedelay",
.ModDelay => "moddelay",
.MultiChorus => "multichorus",
.Noise => "noise",
.WildNoise => "wildnoise",

View file

@ -359,6 +359,11 @@ pub const Runner = struct {
try image.runPlugin("http://plugin.org.uk/swh-plugins/modDelay", pos, params);
}
fn multichorusCmd(self: *Runner, pos: Position, params: ParamList) !void {
var image = try self.getImage();
try image.runPlugin("http://calf.sourceforge.net/plugins/MultiChorus", pos, params);
}
fn runCommand(self: *Runner, cmd: *lang.Command) !void {
var params = ParamList.init(self.allocator);
defer params.deinit();
@ -675,6 +680,26 @@ pub const Runner = struct {
try self.moddelayCmd(pos, params);
},
.MultiChorus => {
const pos = try cmd.consumePosition();
try cmd.appendParam(&params, "min_delay");
try cmd.appendParam(&params, "mod_depth");
try cmd.appendParam(&params, "mod_rate");
try cmd.appendParam(&params, "stereo");
try cmd.appendParam(&params, "voices");
try cmd.appendParam(&params, "vphase");
try cmd.appendParam(&params, "amount");
try cmd.appendParam(&params, "dry");
try cmd.appendParam(&params, "freq");
try cmd.appendParam(&params, "freq2");
try cmd.appendParam(&params, "q");
try cmd.appendParam(&params, "overlap");
try cmd.appendParam(&params, "level_in");
try cmd.appendParam(&params, "level_out");
try cmd.appendParam(&params, "lfo");
try self.multichorusCmd(pos, params);
},
else => blk: {
std.debug.warn("Unsupported command: {}\n", .{cmd.command});
break :blk RunError.UnknownCommand;