[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Multiple time signatures - Scheduling with bar numbers?



Hi there,

2017-12-17 14:26 GMT-05:00  <daniel-mayer@xxxxxxxx>:
> .) consider Pspawner

Yes !
Thank you so very much Daniel !
However, I did rather use Pspawn over Pspawner as it seamed more
relevant to my need.
I will definitely use Pspawner some time around.
The provided MWE displays a multiple time signatures proof of concept.

One thing I would like to know is, how can I change the .beatsPerBar
inside a Pbind in a more elegant way?
I can change the \tempo, but not the .beatsPerBar of said tempo.

On a side note, it's very good to know that you can have 3.5 as .beatsPerBar

2017-12-15 16:29 GMT-05:00  <tedthetrumpet@xxxxxxxxx>:
> I think you can sequence Pdefs/Pbindefs using Psym

I read Psym many time but still haven't found a way to use it in my example.
Thanks for the input.
I did listen to most (all?) of your work on soundcloud : great work!

Good day
-- 
Pierre-Luc Gauthier

////////////////// MWE

s.boot;

(
SynthDef(\metronome, {
    arg freq=456, amp=1;
    var sig, env;
    env = Env.perc(0.01, 1/8);
    env = EnvGen.kr(env, doneAction:2);
    sig = SinOsc.ar(freq);
    sig = sig * env * amp;
    Out.ar(0, sig!2);
}).add;

t = TempoClock.new.permanent_(true);
t.tempo = 111/60;
)

(
Pdef(
    \metronome44, Pbind(
        \instrument, \metronome,
        \degree, 0,
        // \beatsPerBar, 4,
        \abcde, Pfunc({
            if (t.beatsPerBar != 4,
                {t.beatsPerBar = 4});
            (t.beatsPerBar.asString ++ " " ++
                t.bar.asString    ++ " " ++
                t.beatInBar.asString
            ).postln;
        }),
        \octave, Pseq([7,Pseq([5],3)]),
        \amp, Pseq([2/3,Pseq([1],3)]),
        \dur, 1,
));
Pdef(
    \metronome78, Pbind(
        \instrument, \metronome,
        \degree, 0,
        // \beatsPerBar, 3.5,
        \abcde, Pfunc({
            if (t.beatsPerBar != 3.5,
                {t.beatsPerBar = 3.5});
            ((t.beatsPerBar*2).asString ++ " " ++
                t.bar.asString    ++ " " ++
                (t.beatInBar*2).asString
            ).postln;
        }),
        \octave, Pseq([7,Pseq([5],6)]),
        \amp, Pseq([2/3,Pseq([1],6)]),
        \dur, 0.5,
));

p = Pspawn(Pbind(
    \pattern, Pseq([
        Pseq([\metronome44], 2),
        \metronome78,
    ],2),
    \delta, 0,
    \method, \seq,
)).play(t, quant:-1);
)
p.stop;
s.boot;

(
SynthDef(\metronome, {
	arg freq=456, amp=1;
	var sig, env;
	env = Env.perc(0.01, 1/8);
	env = EnvGen.kr(env, doneAction:2);
	sig = SinOsc.ar(freq);
	sig = sig * env * amp;
	Out.ar(0, sig!2);
}).add;

t = TempoClock.new.permanent_(true);
t.tempo = 111/60;
)

(
Pdef(
	\metronome44, Pbind(
		\instrument, \metronome,
		\degree, 0,
		// \beatsPerBar, 4,
		\abcde, Pfunc({
			if (t.beatsPerBar != 4,
				{t.beatsPerBar = 4});
			(t.beatsPerBar.asString ++ " " ++
				t.bar.asString	++ " " ++
				t.beatInBar.asString
			).postln;
		}),
		\octave, Pseq([7,Pseq([5],3)]),
		\amp, Pseq([2/3,Pseq([1],3)]),
		\dur, 1,
));
Pdef(
	\metronome78, Pbind(
		\instrument, \metronome,
		\degree, 0,
		// \beatsPerBar, 3.5,
		\abcde, Pfunc({
			if (t.beatsPerBar != 3.5,
				{t.beatsPerBar = 3.5});
			((t.beatsPerBar*2).asString ++ " " ++
				t.bar.asString	++ " " ++
				(t.beatInBar*2).asString
			).postln;
		}),
		\octave, Pseq([7,Pseq([5],6)]),
		\amp, Pseq([2/3,Pseq([1],6)]),
		\dur, 0.5,
));

p = Pspawn(Pbind(
	\pattern, Pseq([
		Pseq([\metronome44], 2),
		\metronome78,
	],2),
	\delta, 0,
	\method, \seq,
)).play(t, quant:-1);
)
p.stop;