add pitchscaler cmd
This commit is contained in:
parent
f9898b2f11
commit
ab9eaa1400
4 changed files with 25 additions and 10 deletions
|
@ -19,6 +19,7 @@ pub const CommandType = enum {
|
|||
Phaser,
|
||||
Mbeq,
|
||||
Chorus,
|
||||
PitchScaler,
|
||||
};
|
||||
|
||||
pub const Command = struct {
|
||||
|
@ -126,6 +127,7 @@ pub const Lang = struct {
|
|||
_ = try self.keywords.put("mbeq", .Mbeq);
|
||||
_ = try self.keywords.put("phaser", .Phaser);
|
||||
_ = try self.keywords.put("chorus", .Chorus);
|
||||
_ = try self.keywords.put("pitchscaler", .PitchScaler);
|
||||
}
|
||||
|
||||
pub fn parse(self: *Lang, data: []const u8) !CommandList {
|
||||
|
|
|
@ -173,11 +173,7 @@ pub const Runner = struct {
|
|||
try image.runPlugin("http://plugin.org.uk/swh-plugins/lfoPhaser", position, params);
|
||||
}
|
||||
|
||||
fn mbeqCmd(
|
||||
self: *Runner,
|
||||
position: Position,
|
||||
bands: []const f32,
|
||||
) !void {
|
||||
fn mbeqCmd(self: *Runner, position: Position, bands: []const f32) !void {
|
||||
var image = try self.getImage();
|
||||
var params = ParamList.init(self.allocator);
|
||||
defer params.deinit();
|
||||
|
@ -193,15 +189,16 @@ pub const Runner = struct {
|
|||
try image.runPlugin("http://plugin.org.uk/swh-plugins/mbeq", position, params);
|
||||
}
|
||||
|
||||
fn chorusCmd(
|
||||
self: *Runner,
|
||||
pos: Position,
|
||||
params: ParamList,
|
||||
) !void {
|
||||
fn chorusCmd(self: *Runner, pos: Position, params: ParamList) !void {
|
||||
var image = try self.getImage();
|
||||
try image.runPlugin("http://plugin.org.uk/swh-plugins/multivoiceChorus", pos, params);
|
||||
}
|
||||
|
||||
fn pitchScalerCmd(self: *Runner, pos: Position, params: ParamList) !void {
|
||||
var image = try self.getImage();
|
||||
try image.runPlugin("http://plugin.org.uk/swh-plugins/pitchScaleHQ", pos, params);
|
||||
}
|
||||
|
||||
fn runCommand(self: *Runner, cmd: *lang.Command) !void {
|
||||
var params = ParamList.init(self.allocator);
|
||||
defer params.deinit();
|
||||
|
@ -267,6 +264,12 @@ pub const Runner = struct {
|
|||
try self.chorusCmd(pos, params);
|
||||
},
|
||||
|
||||
.PitchScaler => blk: {
|
||||
const pos = try cmd.consumePosition();
|
||||
try cmd.appendParam(¶ms, "mult", 2);
|
||||
try self.pitchScalerCmd(pos, params);
|
||||
},
|
||||
|
||||
else => blk: {
|
||||
std.debug.warn("Unsupported command: {}\n", cmd.command);
|
||||
break :blk RunError.UnknownCommand;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue