Apologies, yes I am using the Player script! Looks like I mixed up the titles:)

I haven’t used a keyboard with other scripts. I will test it later on today, good idea.
I am not very experienced in maiden but I am happy to give this a try as well.

I’d like to borrow some of the UI elements for my own synth from this library. I’m going through timber_engine.lua and there’s a lot of what looks like OOP conventions…but everything is just a table!?! @markeats would you have any advice about how you decided on these conventions for the UI? At first glance it looks like there’s a deeper OO system than I imagined.

bloody hell this is awesome. Only loaded it to play with Orca but goodness me this has a lot of potential

thank you!

(thank you as well for the UI work on. this - more to “borrow” for my own scripts :slight_smile: )

2 Likes

Well timber_engine.lua isn’t the most pleasant place to hang out in terms of conventions and structure. Each UI page is a class and they live in Timber.UI which seemed convenient(?) and make use of a lot of stuff outside of themselves (in Timber or params), so very half-baked OOP. There are likely better ways to structure this that I’d be happy to get input on.
And yes, it’s tables all the way down :slight_smile:

1 Like

Interesting. I didn’t understand how Lua does classes until now. It’s very similar to how javascript does prototypes. I’m looking to add envelope editing screens, so I’ll start there.

1 Like

2 posts were merged into an existing topic: Norns: scripting

I’ve been dreaming of a special purpose library that extends the UI core lib that provides “synth UI stuff” like envelope/lfo graphs, filter dials and modulation matrices. Timber is a good start and I think it can be abstracted in a reasonable way.

4 Likes

Timber is using envgraph.lua, filtergraph.lua and graph.lua (for LFO visuals) so most of this is already available in the norns lib.

3 Likes

There are definitely a lot of cool libraries available. I haven’t looked at the graph libs enough to know whether it would make sense to build an additional abstraction on top of those, but I do like the idea of developing more lua libraries in general so that there could eventually be a sort of “framework” for easy script development. Or maybe the existing libraries are enough for this purpose already, and developing more of a framework would go against leaving norns as an “open ended” device.

I dont know, just thinking/typing out loud. Perhaps this is a good topic for another thread…

Trying to use Timber, but am getting errors from a fresh clone.

keys

### SCRIPT ERROR: init
/home/we/dust/code/timber/lib/timber_engine.lua:780: attempt to call a nil value (field 'loadSample')
stack traceback:
	/home/we/norns/lua/core/norns.lua:185: in field 'loadSample'
	/home/we/dust/code/timber/lib/timber_engine.lua:780: in field 'action'
	/home/we/norns/lua/core/params/file.lua:39: in function 'core/params/file.bang'
	/home/we/norns/lua/core/params/file.lua:26: in function 'core/params/file.set'
	(...tail calls...)
	/home/we/dust/code/timber/lib/timber_engine.lua:166: in function 'timber/lib/timber_engine.load_sample'
	/home/we/dust/code/timber/keys.lua:413: in function 'init'
	/home/we/norns/lua/core/script.lua:71: in function 'core/script.init'
	[C]: in function 'xpcall'
	/home/we/norns/lua/core/norns.lua:186: in field 'try'
	/home/we/norns/lua/core/engine.lua:83: in function </home/we/norns/lua/core/engine.lua:82>

player, after clicking k3

/home/we/dust/code/timber/lib/timber_engine.lua:271: attempt to call a nil value (field 'clearSamples')
stack traceback:
	/home/we/dust/code/timber/lib/timber_engine.lua:271: in function 'timber/lib/timber_engine.clear_samples'
	/home/we/dust/code/timber/player.lua:94: in upvalue 'load_folder'
	/home/we/dust/code/timber/player.lua:562: in function 'fileselect.callback'
	/home/we/norns/lua/lib/fileselect.lua:49: in function 'fileselect.exit'
	/home/we/norns/lua/lib/fileselect.lua:103: in function 'fileselect.key'
	/home/we/norns/lua/core/menu.lua:164: in function </home/we/norns/lua/core/menu.lua:141>

Strangely, I cannot open issues on this github repo.

that’s weird. both errors look like engine commands table isn’t successfully populated.

is this after doing some experiments with dynamic engine loading or something?

has anyone ever seen that before? (i haven’t, but Timber has a lot of commands.)

update: while doing something else, cleaned up some bad-looking stuff in engine.load low-level callback definition, which could conceivably cause something like this (script init function to be evaluated before engine command table is actually populated.) worth a try:

[ https://github.com/monome/norns/pull/846 ]

Just to check: is the engine being found at all? Ie, do you see it listed in the REPL after a restart?

It’s working now! I swear I did a ;restart after installing it.
I guess it needed a full reboot. Both errors are gone, and Timer is amazing.
Thank you for this, and sorry for not testing more carefully.

1 Like

Timber is now my favourite library, excellent work @markeats!

9 Likes

Beta 4 is up now, only two small changes but one of them is important to note:

  • Breaking change! engine.noteOn argument order has changed. It is now engine.noteOn(id, freq, vel, sampleId)
    ie, sampleId has moved to the end. I think this will make engine interchangeability a little more straightforward. Tagging @its_your_bedtime as Orca will need updating.
  • Default amp envelope attack is now 0 (was 3ms).

@neauoire thank you! Always great to see/hear what people are doing with these! :smiley:

7 Likes

So what is Timber’s engine id #?

Sorry not sure I understand that question, what are you referring to?

I assumed that the above ‘breaking change’ would effect the order of the sample trigger command in Orca. For example, within Orca, will ’ (timber engine) still go in this order: --sample octave note level position–? Where does the new --id, freq, Vel, sample id-- order that you reference come into play? Is it built into the Orca code iteself, not something we deal with on the user interface/programming side?

Oh right yeah the above is a Lua script change that has since been made in orca.

Yep, that slowly dawned on my walnut brain. Thanks!

1 Like