Question

I can set a scale like this:

~pp = Scale.phrygian(\pythagorean);

I can then create a Pbind which plays the scale like this:

(
Pbind(
    *[
        instrument: \default,
        scale: ~pp,
        degree: Pseq([0, 1, 2, 3, 4, 5, 6, 7], inf),
        amp: 0.5,
        dur: 0.5
    ]
).play;
)

But Synth.new doesn't seem to get it at all (just results in silence):

b = Synth.new(\default, [\scale: ~pp, \degree: 3, \amp, 0.5]);

Interestingly, if I remove the scale parameter:

b = Synth.new(\default, [\degree: 3, \amp, 0.5]);

then I get a note, but it's always the same note. It doesn't respond to the degree parameter.

Ultimately, I would like to be able to trigger notes from an external OSC device (my phone!). This means hooking up OSCFunc to listen out for certain triggers, and play notes from a scale when those OSC events occur. I thought I could use Synth.new inside OSCFunc to actually play the notes, but it doesn't seem to know about scales, so I'm a bit stuck.

Can anyone provide any advice about how to acheive this?

Was it helpful?

Solution

Have a good read of the Pattern Guide, in particular Pattern Guide 07: Value Conversions. It's a good tutorial. It will tell you that these magical conversions are not used everywhere in SuperCollider, but only when you use Event-based scheduling such as Patterns (e.g. your Pbind). The value conversions are actually defined in "the default Event", as described further in that tutorial article.

One consequence of all of this is that, if you want to launch just one note but you still want value conversions, you can do it with the Event style of playing notes, which creates an event using () and then calls .play on it:

  ~synth = (instrument: \default, scale: [0,2,4,5,7,9,11], degree: 12.rand, amp: 0.5).play;

  ~synth = (instrument: \default, scale: [0,3,6,9], degree: 12.rand, amp: 0.5).play;

This still returns a Synth object. See the Event helpfile for more on this way of doing it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top