

// Don't touch!

~klezmer = Buffer.readChannel(s, "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/granular/Cantorial/Acheinu_Kol_Beit_Israel.wav", channels:[0]);


b = Buffer.read(s,"/Users/eli/Sounds/scaudio/groh/metal/metalPipe/metalPipeLow02.aiff");

(
x = {
	var sig;
	sig = GrainBuf.ar(
		numChannels: 2,
		trigger: Impulse.kr(2),
		dur: 1,
		sndbuf: b,
		rate: \trnsp.kr(0).midiratio,
		pos: 0.1,
		interp: 2,
		pan: 0,
		envbufnum: -1,
		maxGrains: 512
	);
	// sig = sig * 10;
}.play;
)

x.set(\trnsp, 12)
x.free;

(
{
	var sig;
	sig = GrainBuf.ar(
		1,
		Dust.ar(40),
		0.8,
		~klezmer,
		1,
		1.25,
		2,
		0,
		-1,
		512
	);

	sig = sig!2;
}.play;
)






~klezmer = Buffer.readChannel(s, "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/granular/Cantorial/Acheinu_Kol_Beit_Israel.wav", channels:[0]);
~klezmer = Buffer.readChannel(s, "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/granular/Cantorial/Cantor_Samuel_Malavsky_Zechor.wav", channels:[0]);
~klezmer = Buffer.readChannel(s, "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/granular/yiddish_chuasdel.wav", channels:[0]);



(
// MIDI sequencing by MIDI file

var m1, m2, x1, x2;

// Read each MIDI file separately
m1 = SimpleMIDIFile.read("/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/trax/01-borrowed flesh/midi/fuzzy gameboy.mid");
m2 = SimpleMIDIFile.read("/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/trax/01-borrowed flesh/midi/pad organ.mid");

// Play both MIDI sequences simultaneously
x1 = m1.p(\granular).play;
x2 = m2.p(\granular).play;

// Store them in a global variable so you can stop them later
~midiPlayers = [x1, x2];
)