There are no issues with doneAction and norns in particular.

You probably already know this, but doneAction is a way for ugens included in a SynthDef to trigger certain kinds of actions (ie. free a synth on when an envelope has been released).

The difference between PolySub and Ack is that in the former synth voice nodes are automatically freed upon audio signal silence whereas in the latter synth nodes are always explicitly freed in sclang code (here: https://github.com/monome/dust/blob/master/lib/sc/Engine_Ack.sc#L516). But as you can see from comments and todos, I eventually want to have self-freeing synth nodes in Ack.

1 Like

@shreeswifty mod edit: put your log inside a [details] tag (please use this in the future with multi-page logs so the thread stays quickly readable, thanks!)

3 Likes

I’d like to know more about the decision to use Lua rather than sclang? Understanding those motivations may give me some insight into the overall direction and method that the core team has in mind.

1 Like

3 posts were merged into an existing topic: Norns on Raspberry pi + Blokas PiSound

quick question: when using require to load a lua class from lib/lua, is it possible to force norns to re-evaluate the lib script? seems like running the main script from maiden doesn’t re-run the scripts pulled in with require, they’re cached somehow right.

its a hack, but this works

function unrequire(name) 
   package.loaded[name] = nil
   _G[name] = nil
end

maybe we should put this in lua utils

pretty sure i was running into the same issues we discussed in this thread:

like this one:

i think we’ve talked about this a bit. but in a nutshell:

  • sclang is cool, but weird, and maybe a hard / dangerous way to get into programming for the inexperienced
  • maybe more importantly, we don’t necessarily want to be wedded to scsynth. we want people to be able to implement other audio backends if they want.

ultimately this wasn’t an obvious decision to make and we went back and forth, but i think it makes sense in the end.

4 Likes

Some concern I’ve heard in “hallway conversations” amounts to a notion that it may be more difficult to create abstractions in Lua than in a more structured language (as sclang is, with its smalltalk heritage).

But I get the idea of wanting to support multiple audio engines.

It feels like Lua really is a linch-pin the norns ecosystem. We could replace other bits and it’d still be norns, but take Lua away, and it isn’t really norns any more. If this really is the case, it might be a good idea to address some of the concerns around whether it will be possible to make the kind of “composition of control” abstractions that some folks are eager to pursue.

I don’t personally have any hunches about this, nor am I taking any sides, just reporting on some observations of conversations about concerns. I haven’t written large amounts of Lua before (and certainly not in anger) so I really don’t have the same worries that I’ve heard from some other folks.

i don’t buy that. lua is like javsacvript if you substitute tables for objects, and supports all the abstractions you want. functions are first order objects and you can do functional programming. tables can be used as prototypes and you can do OOP. it has “weak” dynamic typing kinda like JS.

it’s bare bones and you have to roll your own systems for various kinds of abstraction, but it’s not particularly limited.

like i said, i like sclang. but it’s clunky in many ways, very hard to extend with C primitives when necessary, and its a big messy project. we might want to drop it altogether at some point (opinions welcome)

you’re right, it needs work to build out the lua environment that norns relies on. i have confidence that this will happen in good stead with the community here.

[rephrased, don’t wanna start a religious war]

for more experienced developers it doesn’t seem too onerous to use lua. for newcomers it seems more friendly than pretty much any other option besides javascript. (i’ll just add that this wasn’t really my decision and i am just conveying my impression of our collective reasoning.)

8 Likes

Oh, I don’t know. There are definitely some old farts with mad skills and strong language preferences in the world. I’m not one of them, but they’re around.

Confidence + Competency + Planning = Results

FWIW, is there a backlog of enhancements/bugs a PM-type like me could peer at with my PM hat on?

mod edit @shreeswifty i deleted your post above that was nearly identical to your post another thread (and that thread is the right place)

Ok, I have done some reading on the SC github discussions and it looks like this issue is going to be a constant pain (at least from the perspective of a noob): The punchline is that there is undefined behavior for doneAction when gate high and gate low occur in the same block (faster than SC server’s control rate). Since there is no guarantee that Matron will pass Crone messages at a digestible rate, we will need to account for this behavior in every SC script, i.e. don’t use doneActions in uGens with Matron-facing control signals. Or we will need some sort of message buffer…

This looks like a promising resource: Synchronous and Asynchronous Execution

Each of the repos has a healthy issue list, for example norns and maiden. In a few instances there are tags to try and quickly distinguish between bugs, enhancements, etc.

What does not currently exist is a formalized roadmap of where each of the components is heading. Additionally one area which was discussed (prior to release) but not resolved was how to best track and coordinate changes across each of the components that come together in an “update”.

Thanks for the links, I will go and peer at those repos.

As someone who has functioned as a product owner in both the commercial and non-profit worlds, I can safely say that roadmaps are better thought of as verbs than nouns. The process of sorting what should be done in the context of what must be done is always fruitful, and through that discussion all manner of things get discovered (e.g., to what extent should back-end work be done before a particular script gets added, or what scripts should be released together in order to maximize end-user happiness) that can play a role in making release decisions.

TBH right now this isn’t mission critical - there’s plenty of low-hanging fruit in the queue. But soooon.

As for tracking and coordinating changes across each of the components, that gets easier if you’ve got a plan ahead of time plus a vigorous QA process to match it.

EDIT:

A few things jump out on review of the issue list that will help with the PM side of this adventure:

  1. Amend naming of bugs and enhancements to make them more descriptive while retaining brevity
  2. Propose a controlled vocabulary around tags for functional product areas for consistency (e.g., tape, menu)
  3. Propose a format for describing releases and a tagging system to support this
  4. Consistent use of bug vs enhancement vs new feature vs research tags
  5. Adopt a way to identify show-stopper bugs vs occasional/minor bugs (e.g., a priority system)
  6. Create master list for scripts

FWIW the maiden queue seems to have a higher level of rigor around tagging than the norns queue.

6 Likes

Crone / individual engines could fix this by scheduling note end events (e.g. .set(\gate, 0) with latency rather than immediately (which is generally though not always how Synths are scheduled). This effectively becomes a minimum note duration. For example, in Engine_PolySub:

	removeVoice { arg id;
		if(true, { //voices[id].notNil, {
			s.makeBundle(s.latency, {
   				voices[id].set(\gate, 0);
			});
			//voices.removeAt(id);
		});
	}

The latency-minimizing version of this would track the note start time, and only use additional latency if the \gate=0 is within some “minimum note duration” window.
The perfect-perfect-reliability version would do something like this (e.g. don’t stop until you know it’s started):

if (voices[id].isRunning) { 
	voices[id].set(\gate) 
} { 
	voices[id].addDependant({ 
		|n, m| 
		if (m == \n_go) { voices[id].set(\gate) } 
	})
}

There’s may be one or two narrow cases of this problem that can be fixed in the server, but at the end of the day it’s represents a true ambiguity: the \gate value (or any value for that matter…) has been set to both 1 and 0 at the same logical time. Does this mean my gated envelope started and ended (and thus should e.g. free’d), or does it mean I’ve simply set my gate to zero by idempotence, and the envelope has not started at all?

3 Likes

Ha! Well that is just a quirk of history and special attention given by @ppqq - he and @jlmitch5 pitched in early so I had started to tag stuff in advance of onboarding additional folks.

2 Likes

@bobbcorr
thanks for taking a look, that is great advice. messines of norns issue list is basically on me - the dangers of spending a long time without collaborators; brian and i used it as an unstructured to-do list for too long and it is now neither well-organized, well-documented or comprehensive.

as @ngwese and @ppqq have pointed out, we need both a guide to usage for the issue page, and better use of meta-issues and milestones.

i will try and spend a little more time with a… “lead-dev?” hat on as well, making things more useful, now that the thing is public.

@scztt
thanks, that is a great tip and makes perfect sense. will clean it up. PRs also always welcome

1 Like

I’ve got a norns coming in batch 2 - I’ll probably need a solution to this in order to integrate my own synths at that point anyway, so I’d be happy to push a more generalized solution back to Crone if it hasn’t already been addressed by then.

norns events clarification.

encoder n = 1…3
delta , is this just -1 or 1, or is a larger range supported?
(I can see processing later which seems to calculate velocity/sensitivity, so im assuming digital encoders with just -1/1)

keys n = 1…3
data = 0 or 1 (for key up/ key down respectively)

as far as i can see there is no data thinning etc, prior to it hitting the lua layer.

do the keys have any debouce, i.e. are you ignoring key events if they are under a certain time threshold?

im trying to tune the feel on the push2, which is working but feeling… the encoders currently are too fast, and the button too sluggish :slight_smile:

really only if you know or have any thoughts, otherwise im fine reading the code
(im pretty familiar with the low level matron stuff now :wink: )

see lua/encoders.lua for acceleration on the lua side

keys are debounced in hardware (standard RC) and i’m not sure the kernel module is doing any soft debounce. no lua debounce.

are you attaching the push2 controls via osc?