Skip to content
Permalink
0518a54264
Go to file
 
 
Cannot retrieve contributors at this time
65 lines (55 sloc) 1.56 KB
--- BitcrusherPedal
-- @classmod BitcrusherPedal
local ControlSpec = require "controlspec"
local UI = require "ui"
local Pedal = include("lib/ui/pedals/pedal")
local Controlspecs = include("lib/ui/pedals/controlspecs")
local BitcrusherPedal = Pedal:new()
-- Must match this pedal's .sc file's *id
BitcrusherPedal.id = "bitcrusher"
function BitcrusherPedal:new(bypass_by_default)
local i = Pedal:new(bypass_by_default)
setmetatable(i, self)
self.__index = self
i.sections = {
{"Bits & Samples", "Tone & Gate"},
i:_default_section(),
}
i:_complete_initialization()
return i
end
function BitcrusherPedal:name(short)
return short and "BITZ" or "Bitcrusher"
end
function BitcrusherPedal.params()
local id_prefix = BitcrusherPedal.id
local bitrate_control = {
id = id_prefix .. "_bitrate",
name = "Bit Rate",
type = "control",
controlspec = ControlSpec.new(4, 16, "lin", 0.25, 12, "bits"),
}
local samplerate_control = {
id = id_prefix .. "_samplerate",
name = "Sample Rate",
type = "control",
controlspec = ControlSpec.new(1000, 48000, "lin", 1000, 48000, "Hz"),
}
local tone_control = {
id = id_prefix .. "_tone",
name = "Tone",
type = "control",
controlspec = Controlspecs.CONTROL_SPEC_MIX,
}
local gate_control = {
id = id_prefix .. "_gate",
name = "Noise Gate",
type = "control",
controlspec = Controlspecs.CONTROL_SPEC_MIX,
}
return {
{{bitrate_control, samplerate_control}, {tone_control, gate_control}},
Pedal._default_params(id_prefix),
}
end
return BitcrusherPedal