Home | ER-101 | ER-102 | ER-301 | Wiki | Contact

Middle Layer SDK (aka patching with Lua)

feedback

#161

Let’s say I want to update a parameter value at the sample rate. Specifically, I’d like to update the threshold parameter of the Comparator object at the sample rate rather than the frame rate. Is that possible? My testing leads me to believe that a ParameterAdapter will allow you to connect a sample rate (Outlet) signal to it, but the parameter is still only updated at the frame rate?


#162

No. Parameters are frame-rate only and that is their purpose. In other, DSP environments they are known as the control rate layer. The DSP object designer has to always spend some time thinking about what inputs will be sample rate (Inlets) and which will be frame rate (Parameters). The choice usually deeply impacts the way the object’s internal DSP algorithm is written.

As for achieving the effect of a Comparator threshold updated at sample rate, how about keeping the threshold constant and adding an offset (via the Sum object)?


#163

Hi @odevices - quick question on the Schroeder Allpass unit. Is it using the standard delay block? If so, is there a way to ensure that the internal feedback is set to -inf, rather than the usual -35.90dB or so?

I’ve put this in line in the FDN patch that Joe and I are looking at, and any gain above 0.060 seems to be howling, which makes me think it’s set to the latter (above) rather than former. Cheers!


#164

The internal feedback gain defaults to zero.

Are you sure you don’t mean 0.6?


#165

Thanks for the fast reply! I’m sure, it’s 0.060 not 0.60. I set the unit outside my chain, and no problems there; I will have to assume that it’s an issue with the FDN not being lossless for now! Will have a hunt around and report back.


#166

Also using only relatively prime delay times? On a related note make sure you have explicitly allocated buffer space for each delay. Actual delay time will be clamped to the allocated buffer size.


#167

I noticed something similar in a different context. I was trying to build a phaser effect (4 stage), which worked, but when I tried feeding the output back into the input, it went from not noticeable at all to out of control in a hurry. Still trying to figure it out. :slight_smile:


#168

The Middle Layer API has been refactored slightly in v0.4.04. Here is a summary of the changes:

  • REFACTOR: onLoadGraph(channelCount) > Use ‘self’ in place of ‘pUnit’
  • REFACTOR: ViewControl.Comparator --> ViewControl.Gate
  • REFACTOR: ViewControl.InputComparator --> ViewControl.InputGate
  • REFACTOR: ViewControl.PitchControl --> ViewControl.Pitch
  • RENAME: edge --> comparator
  • REFACTOR: onLoadViews(objects,branches) … return controls, views
  • REFACTOR: onLoadMenu(objects,branches) … return controls, menu, (sub)
  • REFACTOR: self:addBranch(…) --> self:create(Mono|Stereo)Branch(“tune”, tune, “In”, tune,“Out”)

Here are the updated examples:
testlib-v0.4.04.zip (4.7 KB)
builtins-v0.4.04.zip (104.5 KB)

and the doxygen docs:
er-301-app-doxygen-v0.4.04.zip (4.8 MB)


#169

I am a little perplexed by this. The Timed Gate bespoke unit loads fine in 0.4.03, but fails to load in 0.3.25. What’s maybe more interesting still is that I get slightly different errors on the 48 and 96k versions, right after:

X:/Chain/ChainBase.lua:301: in function 'GlobalChains.GlobalChain.loadUnit'

At any rate, the error traces back to the unit init, so not quite sure what’s going on. Trying to think of what might have changed between these versions but drawing a blank. The Voltage Bank, which was the unit I made before this, loads fine in 0.3 and 0.4.

Hoping you see something here and can give me a hint!

Line 18 in the unit file is:

Unit.init(self,args)

0.3.25 96k

---ERROR REPORT BEGIN
Time Since Boot: 18.787s
Firmware Version: 0.3.25 (stable)
Boot Count: 258
Mount Count: 1
Error Message: Failed to construct unit: TimedGate
X:/Unit/init.lua:67: Unit(Timed Gate).init: Failed to compile the graph.
stack traceback:
	[C]: in function 'error'
	x:/startup/on-load-app-module.lua:38: in field 'error'
	X:/Unit/init.lua:67: in function 'Unit.init'
	1:/ER-301/libs/Joe-s-Bespoke-ER-301-Units/TimedGate.lua:18: in function 'Joe-s-Bespoke-ER-301-Units.TimedGate.init'
	X:/Base/Class.lua:78: in function <X:/Base/Class.lua:76>
	[C]: in function 'xpcall'
	X:/Unit/Factory/init.lua:106: in function 'Unit.Factory.instantiate'
	X:/Chain/ChainBase.lua:301: in function 'GlobalChains.GlobalChain.loadUnit'
	(...tail calls...)
	X:/Chain/MonitorControl.lua:66: in local 'x'
	X:/Base/Observable.lua:50: in function 'SourceChooser.CollapsedHeader.emitSignal'
	...
	X:/Base/Widget.lua:151: in function 'SourceChooser.CollapsedHeader.sendUpHelper'
	X:/Base/Widget.lua:141: in function 'SourceChooser.CollapsedHeader.sendUp'
	X:/Context.lua:192: in function 'Context.notify'
	X:/Application.lua:142: in upvalue 'notify'
	X:/Application.lua:235: in upvalue 'dispatch'
	X:/Application.lua:318: in function 'Application.loop'
	x:/startup/start.lua:54: in function <x:/startup/start.lua:47>
	[C]: in function 'xpcall'
	x:/startup/start.lua:57: in main chunk
	[C]: in function 'dofile'
	[string "dofile('x:/startup/start.lua')"]:1: in main chunk
---ERROR REPORT END

0.3.25 48k

---ERROR REPORT BEGIN
Time Since Boot: 35.191s
Firmware Version: 0.3.25 (stable)
Boot Count: 259
Mount Count: 1
Error Message: Failed to construct unit: TimedGate
X:/Unit/init.lua:67: Unit(Timed Gate).init: Failed to compile the graph.
stack traceback:
	[C]: in function 'error'
	x:/startup/on-load-app-module.lua:38: in field 'error'
	X:/Unit/init.lua:67: in function 'Unit.init'
	1:/ER-301/libs/Joe-s-Bespoke-ER-301-Units/TimedGate.lua:18: in function 'Joe-s-Bespoke-ER-301-Units.TimedGate.init'
	X:/Base/Class.lua:78: in function <X:/Base/Class.lua:76>
	[C]: in function 'xpcall'
	X:/Unit/Factory/init.lua:106: in function 'Unit.Factory.instantiate'
	X:/Chain/ChainBase.lua:301: in function 'GlobalChains.GlobalChain.loadUnit'
	(...tail calls...)
	X:/Chain/EmptySection.lua:42: in local 'x'
	X:/Base/Observable.lua:50: in function 'Chain.MarkMenu.emitSignal'
	...
	X:/Base/Widget.lua:151: in function 'Chain.MarkMenu.sendUpHelper'
	X:/Base/Widget.lua:141: in function 'Chain.MarkMenu.sendUp'
	X:/Context.lua:192: in function 'Context.notify'
	X:/Application.lua:142: in upvalue 'notify'
	X:/Application.lua:235: in upvalue 'dispatch'
	X:/Application.lua:318: in function 'Application.loop'
	x:/startup/start.lua:54: in function <x:/startup/start.lua:47>
	[C]: in function 'xpcall'
	x:/startup/start.lua:57: in main chunk
	[C]: in function 'dofile'
	[string "dofile('x:/startup/start.lua')"]:1: in main chunk
---ERROR REPORT END

#170

Does your TimedGate unit have a feedback loop in its graph? Support for feedback loops was enabled in v0.4.02.


#171

It does not (at least that I’m aware of).


#172

I believe it does though.

  connect(one,"Out",skewedsin,"Level")
  connect(self,"In1",retrigSum,"Left")
  connect(retrigSum,"Out",trig,"In")
  connect(trig,"Out",skewedsin,"Trigger")
  connect(skewedsin,"Out",gain,"Left")
  connect(thirtyK,"Out",gain,"Right")
  connect(gain,"Out",limiter,"In")
  connect(limiter,"Out",self,"Out1")
  connect(limiter,"Out",invertVCA,"Left")
  connect(negOne,"Out",invertVCA,"Right")
  connect(invertVCA,"Out",feedbackVCA,"Left")
  connect(feedbackConst,"Out",feedbackVCA,"Right")
  connect(feedbackVCA,"Out",retrigSum,"Right")  -- < feedback here

#173

Haha, you are right. Geesh, forgot how that one was built quickly. Perhaps the fact that I named the variable feedback should have been my first clue. :blush: OK, so Timed Gate is a 0.4 only unit.

Here’s another error. This one from FMOperator (just downloaded the ported testlib posted today) on 0.4.25 48k.

Time Since Boot: 701.535s
Firmware Version: 0.4.05 (unstable)
Boot Count: 88
Mount Count: 3
Error Message: Failed to construct unit: FMOperator
X:/Unit/ViewControl/GainBias.lua:83: .init: branch is missing.
stack traceback:
	[C]: in function 'error'
	x:/startup/on-load-app-module.lua:38: in field 'error'
	X:/Unit/ViewControl/GainBias.lua:83: in function 'Unit.ViewControl.GainBias.init'
	X:/Base/Class.lua:78: in upvalue 'GainBias'
	1:/ER-301/libs/testlib/FMOperator.lua:105: in function 'testlib.FMOperator.onLoadViews'
	X:/Unit/init.lua:71: in function 'Unit.init'
	1:/ER-301/libs/testlib/FMOperator.lua:18: in function 'testlib.FMOperator.init'
	X:/Base/Class.lua:78: in function <X:/Base/Class.lua:76>
	[C]: in function 'xpcall'
	X:/Unit/Factory/init.lua:106: in function 'Unit.Factory.instantiate'
	...
	X:/Base/Widget.lua:151: in function 'testlib.FMOperator.sendUpHelper'
	X:/Base/Widget.lua:141: in function 'testlib.FMOperator.sendUp'
	X:/Base/Context.lua:221: in function 'Base.Context.notify'
	X:/Application.lua:127: in upvalue 'notify'
	X:/Application.lua:234: in upvalue 'dispatch'
	X:/Application.lua:331: in function 'Application.loop'
	x:/startup/start.lua:54: in function <x:/startup/start.lua:47>
	[C]: in function 'xpcall'
	x:/startup/start.lua:57: in main chunk
	[C]: in function 'dofile'
	[string "dofile('x:/startup/start.lua')"]:1: in main chunk

#174

Oopsie. Branch creation has been refactored from v0.4.04 and there was one that I forgot in that unit.

testlib-v0.4.05.zip (4.7 KB)


V0.4.x Firmware Workout: Goofing off never felt this hard
#175

All fixed!


#176

Might be user error but the 4.05 countdown unit doesn’t seem to increment or decrement?


#177

Looks like we have 2 versions of the Countdown unit. One in testlib and the other in builtins. I guess I will take it out of the testlib.


#178

This is done now.

testlib-v0.4.06.zip (2.5 KB)


#179

I was searching the forum to understand what to change to port the FM operator to 0.4 but I found you already did :stars: