it can be done, here’s something i made a while ago with a really, really stupid trick to generate samples with arbitrary iterated function (single-sample buffer, arbitrary impulse, and Duty.ar! the impulse can run at the samplerate (i think? certainly at nyquist) i think just Dfsm and Duty.ar would work nicely together)

	SynthDef.new(\cubicMapVoice, {
		arg buf, out=0, level=1.0,
			atk=0.001, rel=0.1, gate=1,
			hz=110, oct=1, a=3.4,
			lpf_hz_mul=2, lpf_hz_add=0;
		var x, y, duty, env, output;
		duty = 1.0 / (hz * oct);
		x = Dbufrd(buf);
		x = (a*x*x*x) + ((1.0-a)*x); // cubic oscillator.
		y = Dbufwr(x, buf);
		output = Duty.ar(duty, 0, y);
		output = LPF.ar(output, hz * lpf_hz_mul + lpf_hz_add);
		env = EnvGen.ar(Env.asr(atk, 1.0, rel), gate:gate, doneAction:2);
		Out.ar(out, (env * output * level).dup);	
	}).send(s);

this is, of course, super inefficient.

actually probably a little funky because of sclang’s virtual terminal wonkiness (?) jack-stdin definitely the way to go i think

1 Like

It’s academic, but I’m not sure I follow, I don’t understand what sclang would have to do with it? Wouldn’t we be able to write a UGen in C++ and use popen or similar?

In practice I’m sure there are a ton of reasons why it’s a terrible idea and will cause the server to crash constantly, but I always did love playing with BitWiz on my phone…

1 Like

you’re right, i’m being dumb, definitely popen in the ugen, and this is a terrible idea anyway

1 Like

You probably can’t use popen in a ugen directly - it’s almost certainly not realtime safe. Stdin data would have to be read from a different thread and heavily buffered, but it would be possible. It would be significantly easier to simply dump bytebeat’s output to an audio file and read it in (which I believe could be done as the file is still growing, using the DiskIn UGen).

I just checked and Dtag doesn’t work at demand rate because it prints to stdout, which obviously balloons when run at sample rate (speaking of not real-time safe…). That’s probably easily fixable, if someone wants to write a bug against it.

2 Likes

If you could use a FIFO it would be perfect. It would be pretty easy to wrap the entire process of compiling the C, creating the FIFO, etc in a pseudo-UGen.

1 Like

It’s totally possible that sleexyz’s bytebeat example in sclang is much more performant than the same thing written in straight C (a lot of core UGens are more optimized than anything but carefully hand-coded vectorized C), so if the bitshift/logic/math ops in sclang can produce the desired output, it’s probably a lot easier AND faster than cobbling together a different workflow.
Though you don’t get the visceral thrill of dumping out audio directly from main(). :slight_smile:

3 Likes

–quietly looks into ordering “popen the ugen” bumper stickers–

24 Likes

oooh boy I hadn’t even considered the possibility of running shlisp on norns

WOW

2 Likes

would anyone be interested in a small minimal chess app for norns? it will be a while til i have the money to even get a norns but i thought it might be cool to have a chess (or go??) game running in the back ground that you could play with folks… i am a dork i know :stuck_out_tongue:

8 Likes

Or, you know, a chess app that makes sounds… https://github.com/acarabott/chessMusic

4 Likes

why not?

worst case scenario i might learn from reverse engineering your code

A musical go game occured to me, although I’m not sure how it would map to musical events. All for anything that does interesting things with networked norns.

would be cool to scan sections of a go game’s state for sequence info or just to seed random stuff!

1 Like

Ah, but composer Haskell Small does: See his composition A Game of Go for two pianos, 1987. Video:

8 Likes

I’m just gonna leave these here… :wink:

11 Likes

all this reminds me that the “new thing” thread originated as a request for a modern 256 grid batch…

I wonder if norns could revitalize some interest for a larger grid again?

8 Likes

very interesting! i did an interactive piece for Go a long time back, details here: http://chailight.com/2011/07/16/invisible-territory/

My approach at the time was kind of literal and I feel like there was a lot more that could be done with records of Go games - specific patterns triggering different musical events. I could probably dig up the code I wrote for reading Go game records into Max if anyone is interested in playing with this kind of thing.

Back to norns though, it does make me think of whether it would be feasible to connect a camera and do somethihg with that other form of CV (as in computer vision, not control voltage)

it’s long been a goal of mine to have a piece that you can compose by playing a physical game. I’m not across Super Collider yet, but I’m guessing there might already be some support for camera input, like there is in Max/MSP? Something to investigate …

1 Like

i know i’m definitely excited to try out the new and improved mlr with my 256—i imagine others might be as well

3 Likes

This is relevant to my interests.

Yup

2 Likes