Skip to content

Commit

Permalink
Add Amie AM synth
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperNiCd committed Oct 3, 2020
1 parent 49d5781 commit deb39cd
Show file tree
Hide file tree
Showing 4 changed files with 224 additions and 6 deletions.
216 changes: 216 additions & 0 deletions Amie.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
-- GLOBALS: app, os, verboseLevel, connect, tie
local app = app
local Class = require "Base.Class"
local Unit = require "Unit"
local Pitch = require "Unit.ViewControl.Pitch"
local GainBias = require "Unit.ViewControl.GainBias"
local Fader = require "Unit.ViewControl.Fader"
local Gate = require "Unit.ViewControl.Gate"
local Encoder = require "Encoder"
local ply = app.SECTION_PLY

local Amie = Class{}
Amie:include(Unit)

function Amie:init(args)
args.title = "Amie"
args.mnemonic = "AM"
Unit.init(self,args)
end

function Amie:onLoadGraph(channelCount)

--carrier
local carrier = self:createObject("SineOscillator","carrier")
local ctune = self:createObject("ConstantOffset","ctune")
local ctuneRange = self:createObject("MinMax","ctuneRange")
local cf0 = self:createObject("GainBias","cf0")
local cf0Range = self:createObject("MinMax","cf0Range")
local climgain = self:createObject("ConstantGain","climgain")
local climiter = self:createObject("Limiter","climiter")
local cfdbk = self:createObject("GainBias","cfdbk")
local cfdbkRange = self:createObject("MinMax","cfdbkRange")
connect(cfdbk,"Out",cfdbkRange,"In")

-- modulator
local modulator = self:createObject("SineOscillator","modulator")
local mRatio = self:createObject("GainBias","mRatio")
local mRatioRange = self:createObject("MinMax","mRatioRange")
local mRatioVCA = self:createObject("Multiply","mRatioVCA")
local mlimgain = self:createObject("GainBias","mlimgain")
local mlimiter = self:createObject("Limiter","mlimiter")
local mfdbk = self:createObject("GainBias","mfdbk")
local mfdbkRange = self:createObject("MinMax","mfdbkRange")
connect(mfdbk,"Out",mfdbkRange,"In")

-- AM VCA
local amvca = self:createObject("Multiply","amvca")
local amIndex = self:createObject("GainBias","amIndex")
local amIndexRange = self:createObject("MinMax","amIndexRange")

-- wet/dry mixer
local mixer = self:createObject("CrossFade","mixer")
local wet = self:createObject("GainBias","wet")
local wetRange = self:createObject("MinMax","wetRange")

-- output volume control
local vca = self:createObject("Multiply","vca")
local level = self:createObject("GainBias","level")
local levelRange = self:createObject("MinMax","levelRange")

--tuning
connect(ctune,"Out",ctuneRange,"In")
connect(ctune,"Out",carrier,"V/Oct")
connect(ctune,"Out",modulator,"V/Oct")
connect(cf0,"Out",carrier,"Fundamental")
connect(cf0,"Out",cf0Range,"In")
connect(mRatio,"Out",mRatioRange,"In")
connect(cf0,"Out",mRatioVCA,"Left")
connect(mRatio,"Out",mRatioVCA,"Right")
connect(mRatioVCA,"Out",modulator,"Fundamental")

-- audio path
connect(carrier,"Out",climgain,"In")
connect(climgain,"Out",climiter,"In")
connect(climiter,"Out",amvca,"Left")
connect(modulator,"Out",mlimgain,"In")
connect(mlimgain,"Out",mlimiter,"In")
connect(mlimiter,"Out",amvca,"Right")
connect(amvca,"Out",mixer,"A")
connect(climiter,"Out",mixer,"B")
connect(mixer,"Out",vca,"Left")
connect(wet,"Out",wetRange,"In")
connect(wet,"Out",mixer,"Fade")
connect(level,"Out",levelRange,"In")
connect(level,"Out",vca,"Right")
connect(vca,"Out",self,"Out1")

connect(cfdbk,"Out",carrier,"Feedback")
connect(mfdbk,"Out",modulator,"Feedback")


if channelCount==2 then
connect(vca,"Out",self,"Out2")
end

self:createMonoBranch("level",level,"In",level,"Out")
self:createMonoBranch("tune",ctune,"In",ctune,"Out")
self:createMonoBranch("f0",cf0,"In",cf0,"Out")
self:createMonoBranch("ratio",mRatio,"In",mRatio,"Out")
self:createMonoBranch("wet",wet,"In",wet,"Out")
self:createMonoBranch("cfdbk",cfdbk,"In",cfdbk,"Out")
self:createMonoBranch("mfdbk",mfdbk,"In",mfdbk,"Out")
end

local views = {
expanded = {"tune","freq","ratio","csat","cfdbk","msat","mfdbk","wet","level"},
collapsed = {},
}

local function linMap(min,max,superCoarse,coarse,fine,superFine)
local map = app.LinearDialMap(min,max)
map:setSteps(superCoarse,coarse,fine,superFine)
return map
end

local ratioMap = linMap(0,24,1,0.5,0.01,0.001)
local wetMap = linMap(0,1,1,0.1,0.01,0.001)
local fdbkMap = linMap(-1,1,1,0.1,0.01,0.001)
local driveMap = linMap(1,6,1,0.1,0.01,0.01)

function Amie:onLoadViews(objects,branches)
local controls = {}

controls.tune = Pitch {
button = "V/oct",
branch = branches.tune,
description = "V/oct",
offset = objects.ctune,
range = objects.ctuneRange
}

controls.freq = GainBias {
button = "f0",
description = "Fundamental",
branch = branches.f0,
gainbias = objects.cf0,
range = objects.cf0Range,
biasMap = Encoder.getMap("oscFreq"),
biasUnits = app.unitHertz,
initialBias = 27.5,
gainMap = Encoder.getMap("freqGain"),
scaling = app.octaveScaling
}

controls.ratio = GainBias {
button = "ratio",
description = "AM Ratio",
branch = branches.ratio,
gainbias = objects.mRatio,
biasMap = ratioMap,
range = objects.mRatioRange,
initialBias = 1.0,
}

controls.csat = Fader {
button = "car sat",
description = "Carrier Saturation",
param = objects.climgain:getParameter("Gain"),
map = driveMap,
initial = 1.0
-- units = app.unitDecibels,
}

controls.msat = Fader {
button = "mod sat",
description = "Modulator Saturation",
param = objects.mlimgain:getParameter("Gain"),
map = driveMap,
initial = 1.0
-- units = app.unitDecibels,
}

controls.cfdbk = GainBias {
button = "carFdbk",
description = "Carrier Feedback",
branch = branches.cfdbk,
gainbias = objects.cfdbk,
biasMap = fdbkMap,
range = objects.cfdbkRange,
initialBias = 0.0,
}

controls.mfdbk = GainBias {
button = "modFdbk",
description = "Modulator Feedback",
branch = branches.mfdbk,
gainbias = objects.mfdbk,
biasMap = fdbkMap,
range = objects.mfdbkRange,
initialBias = 0.0,
}


controls.wet = GainBias {
button = "wet",
description = "0 car 1 ringmod",
branch = branches.wet,
gainbias = objects.wet,
biasMap = wetMap,
range = objects.wetRange,
initialBias = 0.5,
}

controls.level = GainBias {
button = "level",
description = "Level",
branch = branches.level,
gainbias = objects.level,
range = objects.levelRange,
initialBias = 0.5,
}

return controls, views
end

return Amie
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This repo contains units for the Orthogonal Devices ER-301 Sound Computer. It c
* Rotary Speaker Simulator
* Phaser
* XFade
* Amie (Amplitude modulation synth)

For more details and discussion about these units, please visit:

Expand Down
7 changes: 6 additions & 1 deletion changelog.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
2029-09-27 Accents v0.5.03.1
2020-10-03 Accents v0.5.03.2
NEW UNIT: Amie
FIXED: Ladder BPF2 Bandwidth control will reach max with max gain and 10V input
FIXED: Corrected library units appearing in menu

2020-09-27 Accents v0.5.03.1
NEW UNIT: XFade
NEW UNIT: Ladder BPF2 - changes bandwidth (BW) controller from log to linear response

Expand Down
6 changes: 1 addition & 5 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ local units = {


{category="Filtering"},
{title="Comb Filter",moduleName="CombFilter",keywords="filter"},
{title="Ladder BPF",moduleName="BespokeBPF",keywords="filter"},
{title="Scorpio Vocoder", moduleName="Scorpio", keywords="filter, modulate"},

Expand All @@ -31,7 +30,6 @@ local units = {
{title="Voltage Bank 4",moduleName="VoltageBank4",keywords="mapping"},
{title="Voltage Bank 2",moduleName="VoltageBank2",keywords="mapping"},
{title="Octave CV Shifter", moduleName="OctaveCVShifter",keywords="mapping"},
{title="Inverse", moduleName="Inverse",keywords="mapping"},

{category="Timing"},
{title="Carousel Clock Divider",moduleName="CarouselClockDivider",keywords="timing"},
Expand All @@ -41,9 +39,8 @@ local units = {
{title="AB Switch", moduleName="ABSwitch",keywords="control"},
{title="Ladder BPF2",moduleName="LadderBPF",keywords="filter"},



{category="Synthesizers"},
{title="Amie",moduleName="Amie",keywords="oscillator"},
{title="Xoxoxo",moduleName="Xoxoxo",keywords="oscillator"},
{title="Xoxo",moduleName="Xoxo",keywords="oscillator"},
{title="Xo",moduleName="Xo",keywords="oscillator"},
Expand All @@ -54,7 +51,6 @@ local units = {
{title="Phaser", moduleName="Phaser4",keywords="effect"},
{title="Ensemble",moduleName="StereoEnsemble",keywords="modulate, pitch"},
{title="Flanger",moduleName="Flanger",keywords="modulate, pitch"},
{title="Dirt",moduleName="Dirt",keywords="distortion"}
}

return {
Expand Down

0 comments on commit deb39cd

Please sign in to comment.