This script generates an evolving bass and synth lead arpeggio mixed with a simple hi-hats beat.

(
/** Synth 1 */
{
	var b1, notes, env, filtenv, scale1, octaves, scale_selector, 
    octave_selector, sig, filt, effects, longenv, sub, gridspace;

	gridspace = 0.5;

	b1 = Impulse.ar(gridspace);
	env = EnvGen.ar(Env.perc(2, 3), b1);
	filtenv = EnvGen.ar(Env.perc(1, 3), b1);

	longenv = EnvGen.ar(Env([0, 1, 0.5], [240, 480]), Impulse.ar(0));

	scale1 = Demand.kr(Impulse.kr(1), 0,
		Dseq([
			Dseq([
        Dseq([[36, 38, 39, 41, 43, 44, 46]], 4), 
        Dseq([[32, 32+12,32, 32+12,32, 32+12,32, 32+12]], 2)], 4),
			Dseq([
				Dseq([[36+7, 36+12+7,36+7, 36+12+7,36+7, 36+12+7,36+7, 36+12+7]], 4),
				Dseq([[32+7, 32+12+7,32+7, 32+12+7,32+7, 32+12+7,32+7, 32+12+7]], 2)
			], 1)
		], inf)
	);
	octaves = [0, 1, 0, 2];
	//
	scale_selector = Demand.kr(Impulse.kr(gridspace), 0, Dseq([scale1[0], scale1[4], scale1[0], scale1[6]], inf));
	octave_selector = Demand.kr(Impulse.kr(gridspace/2), 0, Dseq([octaves[0], octaves[0], octaves[1], octaves[0], octaves[2], octaves[0], octaves[3]], inf));

	notes = scale_selector + (octave_selector * 12);

	sig = Pulse.ar((notes).midicps, 0.5, env) +
	Pulse.ar((notes + 12).midicps + 0.2, 0.5, env) +
	Pulse.ar((notes+12).midicps - 0.3, mul: env * 1) +
	Pulse.ar((notes+24).midicps + 0.5, mul: env * 0.5) +
	Pulse.ar((notes+12).midicps - 0.8, mul: env * 0.5) + BrownNoise.ar(1);
	sig = LeakDC.ar(sig) * Pulse.ar(4, 0.5);
	filt = BPF.ar(sig, (notes.midicps / 3) * SinOsc.ar(0.1, 0.2, 2, 4), [SinOsc.ar(0.3, 0, 0.1, 0.5), SinOsc.ar(0.33, 0.1, 0.1, 0.5)], longenv);
	effects = GVerb.ar(
		CombC.ar(filt * 0.5, [0.25, 0.75], [0.25, 0.75], 20)
		,100, 6);

	Pan2.ar(filt + effects, 0, 0.4)
}.play;

/** Bass line */
{
	var b1, notes, env, filtenv, scale1, octaves, scale_selector, octave_selector, sig, filt, effects, longenv, sub;

	b1 = Impulse.ar(8);
	env = EnvGen.ar(Env.perc(0.0001, 0.3), b1);
	filtenv = EnvGen.ar(Env.perc(0.001, 0.3), b1);

	longenv = EnvGen.ar(Env([0, 1, 0.5], [60, 120]), Impulse.ar(0));

	scale1 = Demand.kr(Impulse.kr(1), 0,
		Dseq([
			Dseq([Dseq([[36, 38, 39, 41, 43, 44, 46]], 4), Dseq([[32, 32+12,32, 32+12,32, 32+12,32, 32+12]], 2)], 4),
			Dseq([
				Dseq([[36+7, 36+12+7,36+7, 36+12+7,36+7, 36+12+7,36+7, 36+12+7]], 4),
				Dseq([[32+7, 32+12+7,32+7, 32+12+7,32+7, 32+12+7,32+7, 32+12+7]], 2)
			], 1)
		], inf)
	);
	octaves = [0, 1, 0, 2];
	//
	scale_selector = Demand.kr(Impulse.kr(8), 0, Dseq([scale1[0], scale1[4], scale1[0], scale1[6]], inf));
	octave_selector = Demand.kr(Impulse.kr(4), 0, Dseq([octaves[0], octaves[0], octaves[1], octaves[0], octaves[2], octaves[0], octaves[3]], inf));

	notes = scale_selector + (octave_selector * 12);

	sig = Saw.ar(notes.midicps, env) +
	Saw.ar((notes - 12).midicps, env) +
	SinOsc.ar((notes-12).midicps, mul: env * 1) +
	SinOsc.ar((notes-24).midicps, mul: env * 0.5) +
	SinOsc.ar((notes+12).midicps, mul: env * 0.5);
	sig = LeakDC.ar(sig);
	filt = RLPF.ar(sig, longenv * notes.midicps * SinOsc.ar(0.1, 0.2, 2, 4), [SinOsc.ar(0.3, 0, 0.1, 0.5), SinOsc.ar(0.33, 0.1, 0.1, 0.5)]);
	effects = CombC.ar(filt * 0.5, [0.25, 0.5], [0.25, 0.5], 20);

	Pan2.ar(filt + effects, 0, 0.4)
}.play;

/** Hats */
{
	var sig, env, b1, openhat_values, amp_values, in, local, fx1grid, fx2grid;

	b1 = Impulse.kr(8);
	openhat_values=Demand.kr(b1, 0,
		Dseq([
			Dseq([0.01, 0.02, 0.1, 0.01, 0.005, 0.01, 0.1, 0.02, 0.03], 4),
			Dseq([0.01, 0.02, 0.2, 0.01, 0.01, 0.3, 0.02, 0.03], 1),
		], inf)
	);
	amp_values = Demand.kr(b1, 0, Dseq([1, 0.1, 0.3, 0.8, 0.3], inf));

	fx1grid = Demand.kr(b1, 0, Dseq([0, 0, 0, 0, 0, 0.5, 0, 0, 0], inf));
	fx2grid = Demand.kr(b1, 0, Dseq([0, 1, 0, 0, 0, 0, 0], inf));

	env = EnvGen.ar(Env.perc(0.01, openhat_values), b1);

	sig = WhiteNoise.ar(env * amp_values * 0.5);

	sig = LPF.ar(sig, SinOsc.ar(0.05, 0, 300, 10000));
	sig = sig + FreeVerb.ar(sig, mix: 0.6, room: 2, damp: 0.1, mul: fx2grid);

	Pan2.ar(
		sig +
		CombC.ar(
			sig +
			CombC.ar(sig, [0.01, 0.02], [0.01, 0.02], 0.5, fx1grid),
			[0.25, 0.75], [0.25, 0.75], 2
		)
	)
}.play;
)