Right then…

Is now a good time to discuss potential issues with the existence of the lib folder? Or would it be better to wait a week or so for the the dust (hmmmm!) to settle?

(Also, is this the best thread to discuss architectural issues, or is this more of an app support thread?)

@stripes @HateNames In full agreement, as I’m in a similar position. Started mucking about with Python last week, but I feel like I need to focus my programming learning on something that will be more directly applicable to either work or music. Would love a “First Steps” kind of thread!

1 Like

@stripes @HateNames @Olivier my intention for the norns studies will be similar to TT, where no programming knowledge is assumed. they will unfold over time— will have the first one ready later this week, and i’m not yet certain how long the series will need to be. glad you all are interested!!

29 Likes

Amazing - can’t wait to see this unfold. As someone who just got into TT and followed along with the studies, I’m sure these will be great. I’ll likely dive into Lua first, but perhaps - in time - I’ll dive into SC as well. Such is the power of Norns!

2 Likes

hello
i grabbed the github dust
i am wondering is there a way to run these scripts on linux64 without the Norns it self?
I have built SuperCollider 3.9.1 and i poked around and found Victor Bombi’s Lua2SC but i did not find anything i could successfully build for linux there.

I would love to get some stuff working on the Desktop if theres a few hints for me

2 Likes

yes, it requires the main norns repo which is going to be public soon.

1 Like

i had this thing which some people may be interested in
it’s a Lua Basics video series
Meta Tables are discussed
Lua’s customization and scripting features
Overlays for World Of Warcraft and Adobe Lightroom etc…
i am re-listening while i vacuum :slight_smile:

7 Likes

so i grabbed the Eclipse Lua Development Tools here
http://www.eclipse.org/ldt/

then i installed LuaRocks and peeked here
https://luarocks.org/labels/audio

Any hints as to how we could include the Patterns library in our CroneEngine? I have a synth in SC that I have been controlling via Patterns. I’m imagining creating a LUA interface that changes the values of the pattern. What’s the best way to go about this?

there are very few limitations as to what you can do in a CroneEngine. you can use Patterns or any other sclang feature, whether it’s a good idea or not.

we have not yet published the repo containing the base classes, but of course they are in the filesystem on your norns and you can examine them in the usual ways.

in advance of more proper documentation / tutorials, here is a sort of template:

Engine_Foo : CroneEngine {

   var <baz_poll;
   var <baz_seq;

// this is your constructor. the 'context' arg is a CroneAudioContext. 
// it provides input and output busses and groups. 
// see its implementation for details.
	*new { arg context, doneCallback;
		^super.new(context, doneCallback);
	}

// this is called when the engine is actually loaded by a script. 
// you can assume it will be called in a Routine,
//  and you can use .sync and .wait methods.
	alloc {

// this is how you add "commands", 
// which is how the lua interpreter controls the engine. 
// the format string is analogous to an OSC message format string, 
// and the 'msg' argument contains data.
		this.addCommand("foo", "f", { arg msg; postln( msg[1]); });

/// this is how you add a "poll", which is how to send data back to lua, 
// triggering a callback.
// by default, a poll is periodically evaluated with a given function.
// this function just returns a random number.
                this.addPoll("bar", { 1.0.rand });

/// here is a non-periodic poll, which we can arbitrarily trigger.
// notice that it has no function argument.
                baz_poll = this.addPoll("baz", periodic:false);

// this Routine triggers the "baz" poll with another random number,
// at a random interval.
// (i would have used Pseq here for demonstration, but i've forgotten how!)
                baz_seq = Routine { inf.do {
                    baz_poll.update(1.0.rand); 
                    (0.1 + 1.0.rand).wait;
	            } }.play;
	free {
             // here you should free resources (e.g. Synths, Buffers &c) 
// and stop processes (e.g. Routines, Tasks &c)
               baz_seq.stop;
	}
}
3 Likes

Overall, I’m impressed by how much heavy-lifting the LUA side of things does. SC is mostly for audio and the control side is really left up to LUA. Which makes me wonder how the control from LUA is connected to SC. For example, could you have a single SynthDef playing and then have Buses connecting data from LUA to SC so that you can have smooth control changes in the sound? As usually if you instantiate a synth in SC, you won’t get smooth parameter changes without a Bus object mapped to an argument.

1 Like

This is very helpful! Thank you. Yeah, it will be interesting to see how best to adapt old patches to work with Norns and I expect this will widen my horizons for my programming in the future.

of course.

// CroneEngine_TestSine
// dumbest possible test: a single, mono sinewave
Engine_TestSine : CroneEngine {
	var <synth;

	*new { arg context, doneCallback;
		^super.new(context, doneCallback);
	}

	alloc {
		synth = {
			arg out, hz=220, amp=0.5, amplag=0.02, hzlag=0.01;
			var amp_, hz_;
			amp_ = Lag.ar(K2A.ar(amp), amplag);
			hz_ = Lag.ar(K2A.ar(hz), hzlag);
			Out.ar(out, (SinOsc.ar(hz_) * amp_).dup);
		}.play(args: [\out, context.out_b], target: context.xg);

		this.addCommand("hz", "f", { arg msg;
			synth.set(\hz, msg[1]);
		});

		this.addCommand("amp", "f", { arg msg;
			synth.set(\amp, msg[1]);
		});
	}

	free {
		synth.free;
	}
}

here the smoothing is done in the synthdef. but it could be on a Bus with a separate synth. the PolySub engine in earthesea and so on, uses shared control buses for the multiple synth voices.

3 Likes

6 posts were merged into an existing topic: Norns: maiden

hiya, after implementing the ack sample player engine for norns and looking into making sample start / end / loop point parameters real-time modulatable with loop windowing/crossfading i found this: http://sccode.org/1-51A

haven’t tried it yet, but looks great. what license is this code under? would you mind us using it or parts of it for “ack” ?

5 Likes

Yes of course feel free to use that code (there’s no license). I was trying to make something a little bit like abelton’s simpler sampler in SC…

3 Likes

(moderator edit: moved some posts to Norns: maiden)

2 Likes

hi everybody

i spent most of yesterday evening exploring the scripts and lib folders in attempt to better understand norns . it really beautiful how this system has been arranged!

there is still plenty for me to dissect but i’ll ask a few questions:

  • where can i find Engine_SoftCut.sc?
  • also if i’d like to teach myself how to add live input recording to a sampling instrument should i be searching in sc or lua scripts of existing apps?
1 Like

it is in the main norns repo, that’s yet to be published (with the required ugens). upd: now moved to dust.

both! but supercollider docs on buffers and recording ugens won’t hurt either.

1 Like

thanks

i guess that’s where PolySub is hidden also
can’t wait to see all of these amazing engines ya’ll prepared for us!