Harry Partch's 43-note scale

View: New views
12 Messages — Rating Filter:   Alert me  

Harry Partch's 43-note scale

by G-Wohl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Has anybody ever used Harry Partch's beautiful scale in a supercollider piece before?

If not, is there any way one can use this scale in supercollider without having to figure out each individual frequency of each individual note?

Thanks!

--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
Alternate Email: andrew@...
IU Email: andgrath@...
AIM: Gwohl1
_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Harry Partch's 43-note scale [LONG]

by Mark Ballora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>Has anybody ever used Harry Partch's beautiful scale in a
>supercollider piece before?
>
>If not, is there any way one can use this scale in supercollider
>without having to figure out each individual frequency of each
>individual note?
>
>Thanks!
>
>--
>Andrew Grathwohl
>G-Wohl Productions
><http://www.gwohlproductions.com>www.gwohlproductions.com
>Cell: 203-331-6688
>Alternate Email:
><mailto:andrew@...>andrew@...
>IU Email: <mailto:andgrath@...>andgrath@...
>AIM: Gwohl1

I created this backdrop of shifting tones from his scale for a piece.
I defined the ratios and multiplied them by a fundamental.

~p1=1.round(1); // 1/1
~p2=1.0125.round(1.0125); // 81/80
~p3=1.03125.round(1.03125); // 33/32
~p4=1.05.round(1.05); // 21/20
~p5=1.06667.round(1.06667); // 16/15
~p6=1.09091.round(1.09091); // 12/11
~p7=1.1.round(1.1); // 11/10
~p8=1.11111.round(1.11111); // 10/9
~p9=1.125.round(1.125); // 9/8
~p10=1.14286.round(1.14286);// 8/7
~p11=1.16667.round(1.16667);// 7/6
~p12=1.18519.round(1.18519);// 32/27
~p13=1.2.round(1.2); // 6/5
~p14=1.22222.round(1.22222);// 11/9
~p15=1.25.round(1.25); // 5/4
~p16=1.27273.round(1.27273);// 14/11
~p17=1.28571.round(1.28571);// 9/7
~p18=1.3125.round(1.3125);  // 21/16
~p19=1.33333.round(1.33333);// 4/3
~p20=1.35.round(1.35); // 27/20
~p21=1.375.round(1.375); // 11/8
~p22=1.4.round(1.4); // 7/5
~p23=1.42857.round(1.42857);// 10/7
~p24=1.45455.round(1.45455);// 16/11
~p25=1.48148.round(1.48148);// 40/27
~p26=1.5.round(1.5); // 3/2
~p27=1.52381.round(1.52381);// 32/21
~p28=1.55556.round(1.55556);// 14/9
~p29=1.57143.round(1.57143);// 11/7
~p30=1.6.round(1.6); // 8/5
~p31=1.63636.round(1.63636);// 18/11
~p32=1.66667.round(1.66667);// 5/3
~p33=1.6875.round(1.6875); // 27/16
~p34=1.71429.round(1.71429);// 12/7
~p35=1.75.round(1.75); // 7/4
~p36=1.77778.round(1.77778);// 16/9
~p37=1.8.round(1.8); // 9/5
~p38=1.81818.round(1.81818);// 20/11
~p39=1.83333.round(1.83333);// 11/6
~p40=1.875.round(1.875); // 15/8
~p41=1.90476.round(1.90476);// 40/21
~p42=1.93939.round(1.93939);// 64/33
~p43=1.97531.round(1.97531);// 160/81
~p44=2.round(2); // 2/1

~fundlist=[~p1, ~p2, ~p3, ~p4, ~p5, ~p6, ~p7, ~p8, ~p9, ~p10, ~p11,
~p12, ~p13, ~p14, ~p15, ~p16, ~p17];
~p1list=[~p18, ~p19, ~p20, ~p22, ~p24, ~p25, ~p26, ~p27, ~p28, ~p29,
~p30, ~p33, ~p43];


~nlist=[2000, 2001, 2002, 2003];
~currentnode=~nlist.choose;
~lastnode=~currentnode;

~partchBackdrop=Task({ var harmchoice;
                decay=0.35;
                fund=220;
                p1list=[~p18, ~p19, ~p20, ~p22, ~p24, ~p25, ~p26,
~p27, ~p28, ~p29, ~p30, ~p33, ~p43];
                p2list=[~p11, ~p12, ~p13, ~p16, ~p20, ~p23, ~p26,
~p27, ~p31, ~p33, ~p35, ~p40, ~p43, ~p44];
                p3list=[~p16, ~p21, ~p26, ~p27, ~p28, ~p34];
                p4list=[~p15, ~p18, ~p21, ~p22, ~p28, ~p29];
                p5list=[~p16, ~p17, ~p18, ~p19, ~p22, ~p23, ~p29, ~p30];
                p6list=[~p14, ~p16, ~p21, ~p22, ~p23, ~p24, ~p27,
~p30, ~p31, ~p38, ~p43];
                p7list=[~p6, ~p16, ~p18, ~p19, ~p20, ~p21, ~p24,
~p25, ~p31, ~p32];
                p8list=[~p7, ~p14, ~p16, ~p22, ~p25, ~p31, ~p32];
                p9list=[~p18, ~p19, ~p20, ~p21, ~p22, ~p26, ~p29, ~p32, ~p33];
                p10list=[~p16, ~p17, ~p18, ~p19, ~p20, ~p21, ~p22,
~p23, ~p27, ~p32, ~p33, ~p34, ~p35];
                p11list=[~p20, ~p21, ~p22, ~p24, ~p28, ~p32, ~p34, ~p35, ~p36];
                p12list=[~p19, ~p20, ~p21, ~p22, ~p25, ~p29, ~p33,
~p34, ~p35, ~p36];
                p13list=[~p19, ~p21, ~p22, ~p23, ~p30, ~p33, ~p36, ~p37, ~p38];
                p14list=[~p20, ~p21, ~p24, ~p27, ~p31, ~p37, ~p39];
                p15list=[~p32, ~p35, ~p40];
                p16list=[~p17, ~p23, ~p30, ~p32, ~p33, ~p41];
                p17list=[~p23, ~p30, ~p40, ~p42];
                p18list=[~p29, ~p35, ~p41, ~p42, ~p43];
                p19list=[~p20, ~p32, ~p36, ~p43, ~p44];
                p20list=[~p21, ~p33, ~p37, ~p43, ~p44];
                p21list=[~p31, ~p38, ~p39];
                p22list=[~p34, ~p35];
                p23list=[~p32, ~p41];
                p24list=[~p38, ~p41];
                p25list=[~p38, ~p43];
                p26list=[~p44, ~p37, ~p40];
                p27list=[~p35, ~p37];
                p28list=[~p38];
                p30list=[~p36, ~p40, ~p42, ~p44];
                p31list=[~p42];
                p33list=[~p43];
                p34list=[~p41];
                p35list=[~p1, ~p6, ~p7, ~p17, ~p18, ~p22, ~p23, ~p24, ~p30];
                p36list=[~p3, ~p4, ~p5, ~p8, ~p12, ~p18, ~p19, ~p20, ~p25];
                p37list=[~p4, ~p5, ~p6, ~p7, ~p8, ~p9, ~p12, ~p13, ~p19, ~p20];
                p38list=[~p4, ~p6, ~p9, ~p16, ~p20];
                p39list=[~p3, ~p4, ~p5, ~p6, ~p7, ~p8, ~p9, ~p14, ~p20, ~p21];
                p40list=[~p4, ~p5, ~p6, ~p7, ~p8, ~p9, ~p10, ~p15, ~p21, ~p22];
                p41list=[~p6, ~p7, ~p8, ~p15, ~p23];
                p42list=[~p10, ~p11, ~p23, ~p24];
                p43list=[~p1, ~p24, ~p25];
                p44list=p1list*0.5;

                masterlist=[~p1, ~p2, ~p3, ~p4, ~p5, ~p6, ~p7, ~p8,
~p9, ~p10, ~p11, ~p12, ~p13, ~p14,
             ~p15, ~p16, ~p17, ~p18, ~p19, ~p20, ~p21, ~p22, ~p23,
~p24, ~p25, ~p26,
             ~p28, ~p29, ~p30, ~p31, ~p32, ~p33, ~p34, ~p35, ~p36,
~p37, ~p38, ~p39,
             ~p40, ~p41, ~p42, ~p43, ~p44];
           
          consonancelist=[ p1list, p2list, p3list, p4list, p5list,
p6list, p7list,
          p8list, p9list, p10list, p11list, p12list,
p13list, p14list,
          p15list, p16list, p17list, p18list, p19list,
p20list, p21list,
          p22list, p23list, p24list, p25list, p26list,
p27list, p28list,
                        p30list, p31list, p33list, p34list, p35list,
p36list, p37list,
                        p38list, p39list, p40list, p41list, p42list,
p43list, p44list ];

                //harmchoice=#[17, 10, 11, 19, 13, 7];
                harmchoice=#[5, 7, 11, 10, 17];
                currentFundIndex=(~fundlist.size).rand;
                osc2index=0;
                osc2freq=0;
                osc3freq=0;
                osc3index=0;

                inf.do({ arg i; var f, hm1, hm2, thisIndex,
nextIndex, p1, p2, p3, a1, a2, a3, f1, f2, f3, maxLev, percattack;
                                p1=1.0.rand2;
                                p2=1.0.rand2;
                                p3=1.0.rand2;
                                a1=rrand(0.4, 0.6);
                                a2=rrand(0.1, 0.2);
                                a3=rrand(0.1, 0.26);
                                hm1=harmchoice.choose;
                                hm2=harmchoice.choose;
                                f1=rrand(0.2, 0.5);
                                f2=rrand(0.2, 0.5);
                                f3=rrand(0.2, 0.5);
                                attack=exprand(0.45, 0.8);
                                //maxLev=rrand(0.3, 0.6);
                                percattack=0.1;

                                while ( { ~lastnode==~currentnode },
{ ~currentnode=~nlist.choose;});
                                ~lastnode=~currentnode;


                                // Choose a node (synth) to change
this time through
                                if ( (i>3), {n=~currentnode;
maxLev=rrand(0.3, 0.6);},
                                                   { if ( (i==0),
{n=2000;  maxLev=0.07; },
                                                   
                { if ( (i==1), {n=2001; maxLev=0.07; },
                                                   
                                      { if ( (i==2), {n=2002;
maxLev=0.07; }, {n=2003; maxLev=0.07; ~lastnode=2003;}
                                                   
                                             ) }
                                                   
                        )}
                                                   
                )}
                                                   );
                                //n.postln;
                                //("current node:  "++~currentnode).postln;
                                //("last node:  "++~lastnode).postln;
(" ").postln;
                                         
                                if ( (n==2000),
                                        {
                                        if ( (currentFundIndex==0),
                                                { thisIndex=[
                                                                2, 2, 2, 2,
                                                                3, 3, 3,
                                                                4, 4,
                                                                5, 5,
                                                                6, 6,
                                                                7, 8,
9, 10, 11, 12, 13, 14, 15].choose; },
                                                { thisIndex=[
                                                                -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
                                                                2, 2, 2, 2,
                                                                3, 3, 3,
                                                                4, 4,
                                                                5, 5,
                                                                6,
6].choose; });

 
        //("currentFundIndex="++currentFundIndex).postln;
                                        //("thisIndex="++thisIndex).postln;
                                        nextIndex=currentFundIndex+thisIndex;
                                        if (
(nextIndex>~fundlist.size), { nextIndex=(nextIndex%(~fundlist.size))
});
                                        //("nextIndex="++nextIndex).postln;
                                        f=fund*(~fundlist.wrapAt(nextIndex));
 
        currentFundIndex=masterlist.indexOf(~fundlist.wrapAt(nextIndex));
 
        //("currentFundIndex="++currentFundIndex).postln;
                                        s.sendMsg("/n_set", 2000, "gate", 0);
                            (decay+0.1).wait;
                                        //nextIndex.postln;
                                        //f.postln;
                                        s.sendMsg("/s_new",
"threeSines", 2000, 1, 0,
 
        "freq", f,
 
        "a1", a1, "a2", a2, "a3", a3,
 
        "lfo1", f1, "lfo2", f2, "lfo3", f3,
 
        "harmMult1", hm1,
 
        "harmMult2", hm2,
 
        "p1", p1, "p2", p2, "p3", p3,
                                       
        "attack", attack,
                                       
        "envMax", maxLev,
                                       
        "cutoff", rrand(f, f*2),
                                       
        "percattack", percattack
                                      );
                                      },
                                    {  if ( (n==2001),
                                                        {
osc2index=consonancelist.at(currentFundIndex).size.rand;
                                     
osc2freq=fund*(consonancelist.at(currentFundIndex).at(osc2index));
                                     
s.sendMsg("/n_set", 2001, "gate", 0);
                                       (decay+0.1).wait;
                                     
s.sendMsg("/s_new", "threeSines", 2001, 1, 0,
                                     
                                "freq", osc2freq,
                                     
                                "a1", a1, "a2", a2, "a3", a3,
 
                                "lfo1", f1, "lfo2", f2, "lfo3", f3,
 
                                "harmMult1", hm1,
                                     
                                "harmMult2", hm2,
                                     
                                "p1", p1, "p2", p2, "p3", p3,
                                       
                                "attack", attack,
                                       
                                "envMax", maxLev,
                                       
                      "cutoff", rrand(osc2freq, osc2freq*2),
                                       
                      "percattack", percattack
                                       
                                );
                                      },
                                      { if ( (n==2002),
                                       
        { osc3index=consonancelist.at(osc2index).size.rand;
                                       
 
osc3freq=osc2freq*(consonancelist.at(osc2index).at(osc3index));
                                       
          if ( (osc2index>34), { sentfreq=osc3freq*([0.5, 1].choose)
}, { sentfreq=osc3freq });
                                       
          s.sendMsg("/n_set", 2002, "gate", 0);
                                       
          (decay+0.1).wait;
                                       
          s.sendMsg("/s_new", "threeSines", 2002, 1, 0,
                                       
                                         "freq", sentfreq,
                                       
                                         "a1", a1, "a2", a2, "a3", a3,
 
                                         "lfo1", f1, "lfo2", f2,
"lfo3", f3,
 
                                         "harmMult1", hm1,
                                       
                                         "harmMult2", hm2,
                                       
                                         "p1", p1, "p2", p2, "p3", p3,
                                       
                                         "attack", attack,
                                       
                                         "envMax", maxLev,
                                       
                               "cutoff", rrand(sentfreq, sentfreq*2),
                                       
                               "percattack", percattack
                                       
                                     );
                                      },
                                       
        { osc4index=consonancelist.at(osc3index).size.rand;
                                       
 
osc4freq=osc3freq*(consonancelist.at(osc3index).at(osc4index));
                                       
          osc4freq=osc4freq*([1, 0.5].choose);
                                       
          s.sendMsg("/n_set", 2003, "gate", 0);
                                       
          (decay+0.1).wait;
                                       
          s.sendMsg("/s_new", "threeSines", 2003, 1, 0,
                                       
                               "freq", osc4freq,
                                       
                               "a1", a1, "a2", a2, "a3", a3,
                                       
                               "lfo1", f1, "lfo2", f2, "lfo3", f3,
                                       
                               "harmMult1", hm1,
                                       
                               "harmMult2", hm2,
                                       
                               "p1", p1, "p2", p2, "p3", p3,
                                       
                               "attack", attack,
                                       
                                         "envMax", maxLev,
                                       
                               "cutoff", rrand(osc4freq, osc4freq*2),
                                       
                                         "percattack", percattack
                                       
                               );
                                       })
                                       });
                                       
             
                                     });
                                         if ( (i>3), {
duration=([1.0, 1.5, 2.0, 2.0, 2.0, 2.5, 3.0, 3.5, 4.0, 3.5,
3.5].choose)+attack },
                                                            {
duration=0.03/*rrand(0.4, 0.6)*/});
                     duration.wait;
        })
});

~stopPartch = {
                        s.sendBundle(0.0, ["/n_set", 2000, "gate", 0],
                                ["/n_set", 2001, "decay", 3.0, "gate", 0],
                                ["/n_set", 2002, "decay", 3.0, "gate", 0],
                                ["/n_set", 2003, "decay", 3.0, "gate", 0]);
s.sendBundle(3.0, ["/n_free", 2000],
                                ["/n_free", 2001],
                                ["/n_free", 2002],
                                ["/n_free", 2003]);
s.sendBundle(3.1, [~partchBackdrop.stop;~partchBackdrop.reset;]);
              // ~partchBackdrop.stop;
              // ~partchBackdrop.reset;
              // [2000, 2001, 2002, 2003].do({ arg item;
s.sendMsg("/n_set", item, "gate", 0); s.sendMsg("/n_free", item) });
               };

>_______________________________________________
>sc-users mailing list
>sc-users@...
>http://lists.create.ucsb.edu/mailman/listinfo/sc-users

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Harry Partch's 43-note scale

by Tim Walters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Grathwohl wrote:
> Has anybody ever used Harry Partch's beautiful scale in a supercollider
> piece before?
>
> If not, is there any way one can use this scale in supercollider without
> having to figure out each individual frequency of each individual note?

I posted a Scale class to the developers' list last week, which will
probably see the light of day in some form eventually (although others
have interesting, different ideas for how it should work).

In the meantime you can use the attached files. Once the class is loaded
you can get Partch's Otonalities and Utonalities, or create your own
scales, using his tuning, in a fairly straightforward way:

Pbind(
        \degree, Pseq([0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, \rest], inf),
        \scale, Scale.partch_o1,
        \dur, 0.25
).play;

I've haven't written a help file yet, but the attached demo file gives
plenty of usage examples. Feedback on the class is welcome.

--

Tim Walters | The Doubtful Palace | http://doubtfulpalace.com

Scale {

        var <degrees, <descDegrees, <stepsPerOctave, <tuning, <>name, lastIndex = 0,
                setStepsNextTuning = false;
       
        *new { | degrees, tuning, descDegrees |
                // can't use arg defaults because nils are passed in by doesNotUnderstand
                // nils in tuning handled after stepsPerOctave determined
                // nil for descDegrees is OK
                ^super.new.init(degrees ? \ionian, tuning, descDegrees);
        }
       
        init { | inDegrees, inTuning, inDescDegrees |
                // Degrees may or may not set the stepsPerOctave
                this.degrees_(inDegrees);
                // Tuning will use stepsPerOctave if set; if not
                // will guess based on scale contents
                this.tuning_(inTuning);
                this.descDegrees_(inDescDegrees ? inDegrees);
                stepsPerOctave = stepsPerOctave ? tuning.size;
                ^this.checkForMismatch
        }
       
        checkForMismatch {
                (stepsPerOctave != tuning.size).if({
                        (
                                "Scale steps per octave " ++ stepsPerOctave ++
                                " does not match tuning size " ++
                                tuning.size ++ ": using default tuning"
                        ).warn;
                        tuning = Tuning.default(stepsPerOctave);
                });
                ^this
        }
       
        degrees_ { | inDegrees |
                var key;
                inDegrees.isKindOf(SequenceableCollection).if({ degrees = inDegrees.asArray;
                        (degrees != degrees.asInteger).if({
                                "Truncating non-integer scale degrees.".warn;
                                degrees = degrees.asInteger;
                        });
                        name = "scale" ++ UniqueID.next.asString;
                        setStepsNextTuning = true;
                }, {
                        key = inDegrees ? \ionian;
                        #degrees, descDegrees, stepsPerOctave = ScaleInfo.at(key);
                        name = key.asString
                })
        }
       
        descDegrees_ { | inDescDegrees |
                inDescDegrees.isKindOf(SequenceableCollection).if({
                        descDegrees = inDescDegrees.asArray;
                }, {
                        ^descDegrees = ScaleInfo.descDegrees(inDescDegrees)
                });
        }
       
        tuning_ { | inTuning |
                var targetSteps;
                targetSteps = setStepsNextTuning.if({ this.guessSPO }, { stepsPerOctave });
                inTuning.isKindOf(Tuning).if({
                        tuning = inTuning;
                }, {
                        tuning = inTuning.notNil.if({
                                Tuning.new(inTuning, targetSteps);
                        }, {
                                Tuning.default(targetSteps);
                        })
                });
                setStepsNextTuning.if({ setStepsNextTuning = false; stepsPerOctave = tuning.size });
        }
       
        guessSPO {
                // most common flavors of ET
                // pick the smallest one that contains all scale degrees
                var etTypes = #[12, 19, 24, 53, 128];
                ^etTypes[etTypes.indexInBetween(degrees.maxItem).ceil];
        }
       
        scale_ { | degrees, tuning, descDegrees |
                degrees.notNil.if({ this.degrees_(degrees) });
                tuning.notNil.if({ this.tuning_(tuning) });
                this.descDegrees_(descDegrees ? degrees);
        }
       
        asArray {
                ^this.semitones
        }
       
        asADArray {
                ^this.semitones(false) ++ this.semitones(true).reverse.drop(1)
        }
       
        adDegrees {
                ^degrees ++ (descDegrees ? degrees).reverse.drop(1)
        }
       
        adRatios {
                ^this.asADArray.midiratio
        }
       
        asFloatArray {
                var array, fa;
                array = this.asArray;
                ^FloatArray.new(array.size).addAll(array);
        }
       
        size {
                ^degrees.size
        }
       
        semitones { |desc = false|
                desc.if({
                        ^descDegrees !? descDegrees.collect({ |x| tuning.wrapAt(x) });
                },{
                        this.checkForMismatch;
                        ^degrees.collect({ |x| tuning.wrapAt(x) });
                })
        }
       
        cents { |desc = false|
                ^this.semitones * 100
        }
       
        ratios {
                ^this.semitones.midiratio
        }
       
        descending {
                |index|
                ^descDegrees.notNil && (index < lastIndex)
        }
       
        at { |index|
                ^this.semitones(this.descending(index)).at(index) <! ( lastIndex = index )
        }
       
        wrapAt { |index|
                ^this.semitones(this.descending(index)).wrapAt(index) <! ( lastIndex = index )
        }
       
        degreeToRatio { |degree, octave = 0|
                ^this.ratios.at(degree) * (2 ** octave);
        }
       
        degreeToFreq { |degree, rootFreq, octave|
                ^this.degreeToRatio(degree, octave) * rootFreq;
        }
       
        *choose { |size, tuning|
                // this is a bit pretzely, but allows steps and tuning to be constrained
                // independently, while still making sure everything matches up
                var randomScale, randomTuning, steps, selectFunc;
                randomTuning = tuning !? tuning.isKindOf(Tuning).if({ tuning }, { Tuning.new(tuning) });
                selectFunc = size.isNil.if({
                        randomTuning.isNil.if({
                                { true }
                        }, {
                                { |k| ScaleInfo.stepsPerOctave(k) == randomTuning.size }
                        })
                }, {
                        { |k| ScaleInfo.degrees(k).size == size }
                });
                randomScale = ScaleInfo.choose(selectFunc);
                randomTuning = randomScale.isNil.if({
                        ("No scales matching criteria " ++ [size, tuning].asString ++ " available.").warn;
                        \et12
                }, {
                        randomTuning ? Tuning.choose(ScaleInfo.stepsPerOctave(randomScale))
                });
                ^super.new.init(randomScale ? \ionian, randomTuning)
        }
       
        *doesNotUnderstand { |selector, args|
                ^(ScaleInfo.includesKey(selector)).if({
                        this.new(selector, args)
                }, {
                        super.doesNotUnderstand(selector, args)
                })
        }
       
        doesNotUnderstand { |selector, args|
                var target;
                target = this.semitones;
                ^target.respondsTo(selector).if({
                        target.perform(selector, args)
                }, {
                        super.doesNotUnderstand(selector, args)
                })
        }
       
        *names {
                ^ScaleInfo.names
        }

}

Tuning {

        var <tuning, <>name;
       
        *new { | tuning, stepsPerOctave |
                ^super.new.init(tuning ? \et12, stepsPerOctave ? 12);
        }
       
        *default { | stepsPerOctave |
                var defaultTuning;
                defaultTuning = TuningInfo.default(stepsPerOctave);
                ^super.new.init(defaultTuning ? this.calcDefault(stepsPerOctave), stepsPerOctave).
                        name_(defaultTuning ? this.defaultName(stepsPerOctave))
        }
       
        *et { |stepsPerOctave|
                ^super.new.init(this.calcET(stepsPerOctave)).name_(this.etName);
        }
       
        *calcET { | stepsPerOctave |
                ^(0..(stepsPerOctave - 1)) * (12/stepsPerOctave)
        }
       
        *calcDefault { | stepsPerOctave |
                ^this.calcET(stepsPerOctave)
        }
       
        *choose { |size = 12|
                ^super.new.init(TuningInfo.choose(size))
        }
       
        *defaultName { |stepsPerOctave|
                ^this.etName(stepsPerOctave)
        }
       
        *etName { |stepsPerOctave|
                ^"et" ++ stepsPerOctave.asString
        }
       
        init { | inTuning, inStepsPerOctave |
                ^this.tuning_(inTuning, inStepsPerOctave);
        }
               
        tuning_ { | inTuning, inStepsPerOctave = 12 |
                var newTuning;
                inTuning.isKindOf(SequenceableCollection).if({
                        tuning = inTuning.asArray;
                        name = "tuning" ++ UniqueID.next.asString;
                }, {
                        newTuning = TuningInfo.at(inTuning.asSymbol);
                        newTuning.notNil.if({
                                tuning = newTuning;
                                name = inTuning.asString;
                        }, {
                                ("Unknown tuning: " ++ inTuning).warn;
                                tuning = this.class.calcDefault(inStepsPerOctave);
                                name = this.class.defaultName(inStepsPerOctave);
                        })
                });
        }

        cents_ { |cents|
                ^this.tuning_(cents / 100)
        }
       
               
        ratios {
                ^tuning.midiratio
        }
       
        ratioAt {
                |index|
                ^this.ratios.at(index)
        }
       
        semitones {
                ^tuning
        }
       
        asArray {
                ^this.semitones
        }
       
        asFloatArray {
                ^FloatArray.newClear(tuning.size).addAll(tuning);
        }
       
        size {
                ^tuning.size;
        }
       
        *doesNotUnderstand { |selector, args|
                ^(TuningInfo.includesKey(selector)).if({
                        this.new(selector, args)
                }, {
                        super.doesNotUnderstand(selector, args)
                })
        }
       
        doesNotUnderstand { |selector, args|
                ^tuning.respondsTo(selector).if({
                        tuning.perform(selector, args)
                }, {
                        super.doesNotUnderstand(selector, args)
                })
        }
       
        *names {
                ^TuningInfo.names
        }
}

ScaleInfo {

        classvar dict;
        *initClass {
       
                dict = IdentityDictionary[
                       
                        // TWELVE TONES PER OCTAVE
                        // 5 note scales
                        \minorPentatonic -> [ #[0,3,5,7,10], nil, 12 ],
                        \majorPentatonic -> [ #[0,2,4,7,9], nil, 12 ],
                        \ritusen -> [ #[0,2,5,7,9], nil, 12 ], // another mode of major pentatonic
                        \egyptian -> [ #[0,2,5,7,10], nil, 12 ], // another mode of major pentatonic
                       
                        \kumoi -> [ #[0,2,3,7,9], nil, 12 ],
                        \hirajoshi -> [ #[0,2,3,7,8], nil, 12 ],
                        \iwato -> [ #[0,1,5,6,10], nil, 12 ], // mode of hirajoshi
                        \chinese -> [ #[0,4,6,7,11], nil, 12 ], // mode of hirajoshi
                        \indian -> [ #[0,4,5,7,10], nil, 12 ],
                        \pelog -> [ #[0,1,3,7,8], nil, 12 ],
                       
                        \prometheus -> [ #[0,2,4,6,11], nil, 12 ],
                        \scriabin -> [ #[0,1,4,7,9], nil, 12 ],
                       
                        // han chinese pentatonic scales
                        \gong -> [ #[0,2,4,7,9], nil, 12 ],
                        \shang -> [ #[0,2,5,7,10], nil, 12 ],
                        \jiao -> [ #[0,3,5,8,10], nil, 12 ],
                        \zhi -> [ #[0,2,5,7,9], nil, 12 ],
                        \yu -> [ #[0,3,5,7,10], nil, 12 ],
                       
                       
                        // 6 note scales
                        \whole -> [ (0,2..10), nil, 12 ],
                        \augmented -> [ #[0,3,4,7,8,11], nil, 12 ],
                        \augmented2 -> [ #[0,1,4,5,8,9], nil, 12 ],
                       
                        // Partch's Otonalities and Utonalities
                        \partch_o1 -> [ #[0,8,14,20,25,34], nil, 43 ],
                        \partch_o2 -> [ #[0,7,13,18,27,35], nil, 43 ],
                        \partch_o3 -> [ #[0,6,12,21,29,36], nil, 43 ],
                        \partch_o4 -> [ #[0,5,15,23,30,37], nil, 43 ],
                        \partch_o5 -> [ #[0,10,18,25,31,38], nil, 43 ],
                        \partch_o6 -> [ #[0,9,16,22,28,33], nil, 43 ],
                        \partch_u1 -> [ #[0,9,18,23,29,35], nil, 43 ],
                        \partch_u2 -> [ #[0,8,16,25,30,36], nil, 43 ],
                        \partch_u3 -> [ #[0,7,14,22,31,37], nil, 43 ],
                        \partch_u4 -> [ #[0,6,13,20,28,38], nil, 43 ],
                        \partch_u5 -> [ #[0,5,12,18,25,33], nil, 43 ],
                        \partch_u6 -> [ #[0,10,15,21,27,34], nil, 43 ],
                       
                        // hexatonic modes with no tritone
                        \hexMajor7 -> [ #[0,2,4,7,9,11], nil, 12 ],
                        \hexDorian -> [ #[0,2,3,5,7,10], nil, 12 ],
                        \hexPhrygian -> [ #[0,1,3,5,8,10], nil, 12 ],
                        \hexSus -> [ #[0,2,5,7,9,10], nil, 12 ],
                        \hexMajor6 -> [ #[0,2,4,5,7,9], nil, 12 ],
                        \hexAeolian -> [ #[0,3,5,7,8,10], nil, 12 ],
                       
                        // 7 note scales
                        \major -> [ #[0,2,4,5,7,9,11], nil, 12 ],
                        \ionian -> [ #[0,2,4,5,7,9,11], nil, 12 ],
                        \dorian -> [ #[0,2,3,5,7,9,10], nil, 12 ],
                        \phrygian -> [ #[0,1,3,5,7,8,10], nil, 12 ],
                        \lydian -> [ #[0,2,4,6,7,9,11], nil, 12 ],
                        \mixolydian -> [ #[0,2,4,5,7,9,10], nil, 12 ],
                        \aeolian -> [ #[0,2,3,5,7,8,10], nil, 12 ],
                        \minor -> [ #[0,2,3,5,7,8,10], nil, 12 ],
                        \locrian -> [ #[0,1,3,5,6,8,10], nil, 12 ],
                       
                        \harmonicMinor -> [ #[0,2,3,5,7,8,11], nil, 12 ],
                        \harmonicMajor -> [ #[0,2,4,5,7,8,11], nil, 12 ],
                       
                        \melodicMinor -> [ #[0,2,3,5,7,9,11], #[0,2,3,5,7,8,10], 12 ],
                        \melodicMajor -> [ #[0,2,4,5,7,8,10], nil, 12 ],
                       
                        \bartok -> [ #[0,2,4,5,7,8,10], nil, 12 ], // jazzers call this the hindu scale
                       
                        // raga modes
                        \todi -> [ #[0,1,3,6,7,8,11], nil, 12 ], // maqam ahar kurd
                        \purvi -> [ #[0,1,4,6,7,8,11], nil, 12 ],
                        \marva -> [ #[0,1,4,6,7,9,11], nil, 12 ],
                        \bhairav -> [ #[0,1,4,5,7,8,11], nil, 12 ],
                        \ahirbhairav -> [ #[0,1,4,5,7,9,10], nil, 12 ],
                       
                        \superLocrian -> [ #[0,1,3,4,6,8,10], nil, 12 ],
                        \romanianMinor -> [ #[0,2,3,6,7,9,10], nil, 12 ], // maqam nakriz
                        \hungarianMinor -> [ #[0,2,3,6,7,8,11], nil, 12 ],      
                        \neapolitanMinor -> [ #[0,1,3,5,7,8,11], nil, 12 ],
                        \enigmatic -> [ #[0,1,4,6,8,10,11], nil, 12 ],
                        \spanish -> [ #[0,1,4,5,7,8,10], nil, 12 ],
                       
                        // modes of whole tones with added note ->
                        \leadingWhole -> [ #[0,2,4,6,8,10,11], nil, 12 ],
                        \lydianMinor -> [ #[0,2,4,6,7,8,10], nil, 12 ],
                        \neapolitanMajor -> [ #[0,1,3,5,7,9,11], nil, 12 ],
                        \locrianMajor -> [ #[0,2,4,5,6,8,10], nil, 12 ],
                       
                        // 8 note scales
                        \diminished -> [ #[0,1,3,4,6,7,9,10], nil, 12 ],
                        \diminished2 -> [ #[0,2,3,5,6,8,9,11], nil, 12 ],
                       
                        // 12 note scales
                        \chromatic -> [ (0..11), nil, 12 ],
                       
                        // TWENTY-FOUR TONES PER OCTAVE
                       
                        // maqam ajam
                        \ajam -> [ #[0,4,8,10,14,18,22], nil, 24 ],
                        \jiharkah -> [ #[0,4,8,10,14,18,21], nil, 24 ],
                        \shawqAfza -> [ #[0,4,8,10,14,16,22], nil, 24 ],
                       
                        // maqam sikah
                        \sikah -> [ #[0,3,7,11,14,17,21], #[0,3,7,11,13,17,21], 24 ],
                        \huzam -> [ #[0,3,7,9,15,17,21], nil, 24 ],
                        \iraq -> [ #[0,3,7,10,13,17,21], nil, 24 ],
                        \bastanikar -> [ #[0,3,7,10,13,15,21], nil, 24 ],
                        \mustar -> [ #[0,5,7,11,13,17,21], nil, 24 ],
                       
                        // maqam bayati
                        \bayati -> [ #[0,3,6,10,14,16,20], nil, 24 ],
                        \karjighar -> [ #[0,3,6,10,12,18,20], nil, 24 ],
                        \husseini -> [ #[0,3,6,10,14,17,21], nil, 24 ],
                       
                        // maqam nahawand
                        \nahawand -> [ #[0,4,6,10,14,16,22], #[0,4,6,10,14,16,20], 24 ],
                        \farahfaza -> [ #[0,4,6,10,14,16,20], nil, 24 ],
                        \murassah -> [ #[0,4,6,10,12,18,20], nil, 24 ],
                        \ushaqMashri -> [ #[0,4,6,10,14,17,21], nil, 24 ],
                       
                        // maqam rast
                        \rast -> [ #[0,4,7,10,14,18,21], #[0,4,7,10,14,18,20], 24 ],
                        \suznak -> [ #[0,4,7,10,14,16,22], nil, 24 ],
                        \nairuz -> [ #[0,4,7,10,14,17,20], nil, 24 ],
                        \yakah -> [ #[0,4,7,10,14,18,21], #[0,4,7,10,14,18,20], 24 ],
                        \mahur -> [ #[0,4,7,10,14,18,22], nil, 24 ],
                       
                        // maqam hijaz
                        \hijaz -> [ #[0,2,8,10,14,17,20], #[0,2,8,10,14,16,20], 24 ],
                        \zanjaran -> [ #[0,2,8,10,14,18,20], nil, 24 ],
                       
                        // maqam hijazKar
                        \zanjaran -> [ #[0,2,8,10,14,16,22], nil, 24 ],
                       
                        // maqam saba
                        \saba -> [ #[0,3,6,8,12,16,20], nil, 24 ],
                        \zamzam -> [ #[0,2,6,8,14,16,20], nil, 24 ],
                       
                        // maqam kurd
                        \kurd -> [ #[0,2,6,10,14,16,20], nil, 24 ],
                        \kijazKarKurd -> [ #[0,2,8,10,14,16,22], nil, 24 ],
                       
                        // maqam nawa Athar
                        \nawaAthar -> [ #[0,4,6,12,14,16,22], nil, 24 ],
                        \nikriz -> [ #[0,4,6,12,14,18,20], nil, 24 ],
                        \atharKurd -> [ #[0,2,6,12,14,16,22], nil, 24 ],
                ];
        }
       
        *doesNotUnderstand { |selector, args|
                ^dict.perform(selector, args)
        }
       
        *getParam {
                |name, index|
                ^this.includesKey(name.asSymbol).if({
                        dict.at(name).at(index)
                }, {
                        ("Unknown scale: " ++ name.asString).warn;
                        nil
                })
        }
       
        *descDegrees {
                |name|
                ^this.getParam(name, 1) ? this.getParam(name, 0)
        }
       
        *degrees {
                |name|
                ^this.getParam(name, 0)
        }
       
        *stepsPerOctave {
                |name|
                ^this.getParam(name, 2)
        }
       
        *choose {
                |selectFunc|
                ^dict.keys.select(selectFunc ? { true }).choose;
        }
       
        *names {
                ^dict.keys.asArray.sort.asString
        }
}

TuningInfo {

        classvar dict, defaults;
       
        *initClass {
                defaults = IdentityDictionary[
                        43 -> \partch
                ];
               
                dict = IdentityDictionary[

                        //TWELVE-TONE TUNINGS
                        \et12 -> (0..11),

                        //pythagorean
                        \pythagorean -> [1, 256/243, 9/8, 32/27, 81/64, 4/3, 729/512, 3/2,
                                128/81, 27/16, 16/9, 243/128].ratiomidi,
                       
                        //5-limit tritone
                        \just -> [1, 16/15, 9/8, 6/5, 5/4, 4/3, 45/32, 3/2, 8/5, 5/3, 9/5, 15/8].ratiomidi,
                       
                        //septimal tritone
                        \sept1 -> [1, 16/15, 9/8, 6/5, 5/4, 4/3, 7/5, 3/2, 8/5, 5/3, 9/5, 15/8].ratiomidi,
                       
                        //septimal tritone and minor seventh
                        \sept2 -> [1, 16/15, 9/8, 6/5, 5/4, 4/3, 7/5, 3/2, 8/5, 5/3, 7/4, 15/8].ratiomidi,
               
                        //meantone, 1/4 syntonic comma
                        \mean4 -> #[0, 0.755, 1.93, 3.105, 3.86, 5.035, 5.79, 6.965, 7.72, 8.895, 10.07, 10.82],
               
                        //meantone, 1/5 Pythagorean comma
                        \mean5 -> #[0, 0.804, 1.944, 3.084, 3.888, 5.028, 5.832, 6.972, 7.776, 8.916, 10.056, 10.86],
               
                        //meantone, 1/6 Pythagorean comma
                        \mean6 -> #[0, 0.86, 1.96, 3.06, 3.92, 5.02, 5.88, 6.98, 7.84, 8.94, 10.04, 10.9],
                        //Kirnberger III
                        \kirnberger -> [1, 256/243, (5.sqrt)/2, 32/27, 5/4, 4/3, 45/32, 5 ** 0.25,
                                128/81, (5 ** 0.75)/2, 16/9, 15/8].ratiomidi,
               
                        //Werckmeister III
                        \werckmeister -> #[0, 0.92, 1.93, 2.94, 3.915, 4.98, 5.9, 6.965, 7.93, 8.895, 9.96, 10.935],
                        //Vallotti
                        \vallotti -> #[0, 0.94135, 1.9609, 2.98045, 3.92180, 5.01955, 5.9218, 6.98045,
                                7.9609, 8.94135, 10, 10.90225],
                               
                        //Young
                        \young -> #[0, 0.9, 1.96, 2.94, 3.92, 4.98, 5.88, 6.98, 7.92, 8.94, 9.96, 10.9],
                               
                        //Mayumi Reinhard
                        \reinhard -> [1, 14/13, 13/12, 16/13, 13/10, 18/13, 13/9, 20/13, 13/8, 22/13,
                                13/7, 208/105].ratiomidi,
                               
                        //Wendy Carlos Harmonic
                        \wcHarm -> [1, 17/16, 9/8, 19/16, 5/4, 21/16, 11/8, 3/2, 13/8, 27/16, 7/4, 15/8].ratiomidi,
                       
                        //Wendy Carlos Super Just
                        \wcSJ -> [1, 17/16, 9/8, 6/5, 5/4, 4/3, 11/8, 3/2, 13/8, 5/3, 7/4, 15/8].ratiomidi,
                       
                        //MORE THAN TWELVE-TONE ET
                        \et19 -> ((0 .. 18) * 12/19),
                        \et22 -> ((0 .. 21) * 6/11),
                        \et24 -> ((0 .. 23) * 0.5),
                        \et31 -> ((0 .. 30) * 12/31),
                        \et41 -> ((0 .. 40) * 12/41),
                        \et53 -> ((0 .. 52) * 12/53),
               
                        //NON-TWELVE-TONE JI
                        //Ben Johnston
                        \johnston -> [1, 25/24, 135/128, 16/15, 10/9, 9/8, 75/64, 6/5, 5/4, 81/64, 32/25,
                                4/3, 27/20, 45/32, 36/25, 3/2, 25/16, 8/5, 5/3, 27/16, 225/128, 16/9, 9/5,
                                15/8, 48/25].ratiomidi,
                               
                        //Harry Partch
                        \partch -> [1, 81/80, 33/32, 21/20, 16/15, 12/11, 11/10, 10/9, 9/8, 8/7, 7/6,
                                32/27, 6/5, 11/9, 5/4, 14/11, 9/7, 21/16, 4/3, 27/20, 11/8, 7/5, 10/7, 16/11,
                                40/27, 3/2, 32/21, 14/9, 11/7, 8/5, 18/11, 5/3, 27/16, 12/7, 7/4, 16/9, 9/5,
                                20/11, 11/6, 15/8, 40/21, 64/33, 160/81].ratiomidi,
                               
                        //Jon Catler
                        \catler -> [1, 33/32, 16/15, 9/8, 8/7, 7/6, 6/5, 128/105, 16/13, 5/4, 21/16,
                                4/3, 11/8, 45/32, 16/11, 3/2, 8/5, 13/8, 5/3, 27/16, 7/4, 16/9, 24/13, 15/8].ratiomidi,
                               
                        //John Chalmers
                        \chalmers -> [1, 21/20, 16/15, 9/8, 7/6, 6/5, 5/4, 21/16, 4/3, 7/5, 35/24, 3/2,
                                63/40, 8/5, 5/3, 7/4, 9/5, 28/15, 63/32].ratiomidi,
                               
                        //Lou Harrison
                        \harrison -> [1, 16/15, 10/9, 8/7, 7/6, 6/5, 5/4, 4/3, 17/12, 3/2, 8/5, 5/3,
                                12/7, 7/4, 9/5, 15/8].ratiomidi,
               
                        //sruti
                        \sruti -> [1, 256/243, 16/15, 10/9, 9/8, 32/27, 6/5, 5/4, 81/64, 4/3, 27/20,
                                45/32, 729/512, 3/2, 128/81, 8/5, 5/3, 27/16, 16/9, 9/5, 15/8, 243/128].ratiomidi,
               
                        //HARMONIC SERIES -- length arbitary
                        \harmonic -> (1 .. 24).ratiomidi,
               
                        //NO OCTAVE
                        //Bohlen-Pierce
                        \bp -> ((0 .. 12) * (3.ratiomidi/13)),
                       
                        //Wendy Carlos scales -- length arbitrary
                        \wcAlpha -> ((0 .. 127) * 0.78),
                        \wcBeta -> ((0 .. 127) * 0.638),
                        \wcGamma -> ((0 .. 255) * 0.351)
                ];
        }

        *choose { |size|
                ^dict.keys.select({ |t| dict[t].size == size }).choose;
        }

        *names {
                ^dict.keys.asArray.sort.asString
        }
       
        *default { |stepsPerOctave|
                ^defaults[stepsPerOctave]
        }

        *doesNotUnderstand { |selector, args|
                ^dict.perform(selector, args)
        }
}

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

ScaleDemo.rtf (4K) Download Attachment

Parent Message unknown Re: Harry Partch's 43-note scale [LONG]

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Just a general suggestion... whenever you find yourself writing:

~p1 = ...;
~p2 = ...;
etc.

... you'll be much better served by an array.

p = [1, 81/80, etc.];

Then, instead of

>                 p1list=[~p18, ~p19, ~p20, ~p22, ~p24, ~p25, ~p26,
>  ~p27, ~p28, ~p29, ~p30, ~p33, ~p43];

You could do

p1list = p[[17, 18, 19, 21, 23, 24, 25, 26, 27, 28, 29, 32, 42]];

It does mean thinking from 0 rather than 1 but isn't that a much cleaner syntax?
hjh

On Wed, Mar 5, 2008 at 11:05 PM, Mark Ballora <ballora@...> wrote:
>  I created this backdrop of shifting tones from his scale for a piece.
>  I defined the ratios and multiplied them by a fundamental.
>
>  ~p1=1.round(1);                 // 1/1
>  ~p2=1.0125.round(1.0125);       // 81/80
>  ~p3=1.03125.round(1.03125); // 33/32

--
James Harkins /// dewdrop world
jamshark70@...
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman
_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Harry Partch's 43-note scale [LONG]

by Mark Ballora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you for the suggestion.
I wrote this four years ago. Was this form of array definition in
effect back then?

gratefully - Mark

>Just a general suggestion... whenever you find yourself writing:
>
>~p1 = ...;
>~p2 = ...;
>etc.
>
>... you'll be much better served by an array.
>
>p = [1, 81/80, etc.];
>
>Then, instead of
>
>>                  p1list=[~p18, ~p19, ~p20, ~p22, ~p24, ~p25, ~p26,
>>   ~p27, ~p28, ~p29, ~p30, ~p33, ~p43];
>
>You could do
>
>p1list = p[[17, 18, 19, 21, 23, 24, 25, 26, 27, 28, 29, 32, 42]];
>
>It does mean thinking from 0 rather than 1 but isn't that a much
>cleaner syntax?
>hjh
>
>On Wed, Mar 5, 2008 at 11:05 PM, Mark Ballora <ballora@...> wrote:
>>   I created this backdrop of shifting tones from his scale for a piece.
>>   I defined the ratios and multiplied them by a fundamental.
>>
>>   ~p1=1.round(1);                 // 1/1
>>   ~p2=1.0125.round(1.0125);       // 81/80
>>   ~p3=1.03125.round(1.03125); // 33/32
>
>--
>James Harkins /// dewdrop world
>jamshark70@...
>http://www.dewdrop-world.net
>
>"Come said the Muse,
>Sing me a song no poet has yet chanted,
>Sing me the universal."  -- Whitman
>_______________________________________________
>sc-users mailing list
>sc-users@...
>http://lists.create.ucsb.edu/mailman/listinfo/sc-users

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Harry Partch's 43-note scale

by Michael Hairston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The class looks interesting. Does it support non-octave-repeating scales?

i.e., [0,3,5,8,13,16,19] in 12-tone equal temperament?



On Thu, Mar 6, 2008 at 2:36 AM, Tim Walters <walters@...> wrote:
Andrew Grathwohl wrote:
> Has anybody ever used Harry Partch's beautiful scale in a supercollider
> piece before?
>
> If not, is there any way one can use this scale in supercollider without
> having to figure out each individual frequency of each individual note?

I posted a Scale class to the developers' list last week, which will
probably see the light of day in some form eventually (although others
have interesting, different ideas for how it should work).


_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Harry Partch's 43-note scale

by Sylvain Le Beux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,

I don't mean to be rude, but is this not a little competing with Jascha
Narveson SC class interface with the scala library ?
I get in touch with the scala lib from an ixi tutorial lying at
devel.goto10, and there is here a link to a scales' library with
contains more than 3500 differents historical (or not) scales. By the
way the archive contains at least 14 Partch's scales and two for
43-notes ...
So I guess from what I've seen quickly that your class had some more
methods, but wouldn't if be better if this can be merged into JN class
... just a thought.
For those interested to know about that :  the scale zip archive lies
here (bottom of the page) :
<http://www.xs4all.nl/~huygensf/scala/downloads.html>
and Jascha Class interfacing with it lies here :
<http://jnarveson.web.wesleyan.edu/sc/SCL/SCL.zip>

Best

slb


Tim Walters a écrit :

> Andrew Grathwohl wrote:
>> Has anybody ever used Harry Partch's beautiful scale in a
>> supercollider piece before?
>>
>> If not, is there any way one can use this scale in supercollider
>> without having to figure out each individual frequency of each
>> individual note?
>
> I posted a Scale class to the developers' list last week, which will
> probably see the light of day in some form eventually (although others
> have interesting, different ideas for how it should work).
>
> In the meantime you can use the attached files. Once the class is
> loaded you can get Partch's Otonalities and Utonalities, or create
> your own scales, using his tuning, in a fairly straightforward way:
>
> Pbind(
>     \degree, Pseq([0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, \rest], inf),
>     \scale, Scale.partch_o1,
>     \dur, 0.25
> ).play;
>
> I've haven't written a help file yet, but the attached demo file gives
> plenty of usage examples. Feedback on the class is welcome.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> sc-users mailing list
> sc-users@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Harry Partch's 43-note scale

by Tim Walters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> The class looks interesting. Does it support non-octave-repeating scales?
>
> i.e., [0,3,5,8,13,16,19] in 12-tone equal temperament?

Yes, with a two-octave tuning table, like this:

(
s.waitForBoot({
        a = Scale.new([0,3,5,8,13,16,19], (0..23));

        p = { |scale|
                Pbind(
                        \note, PdegreeToKey(
                                Pseq([0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, \rest], inf),
                                scale,
                                24
                        ),
                        \dur, 1.0
                ).play;
        };

        q = p.value(a);
})
)

Note that using the \degree key to Pbind doesn't do the right thing,
because it assumes one-octave scales. That's equally true whether you use
an array or my class.

--
Tim Walters | http://doubtfulpalace.com


_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Harry Partch's 43-note scale

by Tim Walters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I don't mean to be rude, but is this not a little competing with Jascha
> Narveson SC class interface with the scala library ?

Yes, I was unaware of this until I posted my class to the developer list.
I'll be looking at his class and seeing what the best overall solution is
(might just be his class for all I know so far). Clearly Scala support is
a good thing.

--
Tim Walters | http://doubtfulpalace.com


_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

reading and parsing a binary UDP stream

by Denis Fitzpatrick-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can I use Supercollider to read and parse a binary stream of data sent
via UDP?


This stream would come from a device (Facelab4 :
http://www.seeingmachines.com/) giving head position, gaze, and pupil
diameter in real time, and would be used to, well, synthesize sound,
which would possibly be very cool. I see that Supercollider uses UDP or
TCP to communicate between its client and server, but don’t know that
that implies the task I just described would necessarily be doable or
easy. Any thoughts or code snippets would be much appreciated.


Denis Fitzpatrick

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: reading and parsing a binary UDP stream

by Sebastian Heinz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You probably need something in between that parses your UDP packets  
and builds usable OSC messages out of it. The OSC message could then  
contain the three values for position, gaze, and pupil diameter. Once  
having that, the rest is easy. SuperCollider responds to these  
incoming messages and uses the values for whatever you like.

Am 07.03.2008 um 05:48 schrieb Denis Fitzpatrick:

> Can I use Supercollider to read and parse a binary stream of data sent
> via UDP?
>
>
> This stream would come from a device (Facelab4 :
> http://www.seeingmachines.com/) giving head position, gaze, and pupil
> diameter in real time, and would be used to, well, synthesize sound,
> which would possibly be very cool. I see that Supercollider uses UDP  
> or
> TCP to communicate between its client and server, but don’t know that
> that implies the task I just described would necessarily be doable or
> easy. Any thoughts or code snippets would be much appreciated.
>
>
> Denis Fitzpatrick
>
> _______________________________________________
> sc-users mailing list
> sc-users@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Harry Partch's 43-note scale [LONG]

by nonprivate :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi mark,
i tried to give your patch a burn, but apart from the email messing with
the formatting, there seem to be about 50 or so variables that don't get
defined ...?

Mark Ballora wrote:

>> Has anybody ever used Harry Partch's beautiful scale in a
>> supercollider piece before?
>>
>> If not, is there any way one can use this scale in supercollider
>> without having to figure out each individual frequency of each
>> individual note?
>>
>> Thanks!
>>
>> --
>> Andrew Grathwohl
>> G-Wohl Productions
>> <http://www.gwohlproductions.com>www.gwohlproductions.com
>> Cell: 203-331-6688
>> Alternate Email:
>> <mailto:andrew@...>andrew@...
>> IU Email: <mailto:andgrath@...>andgrath@...
>> AIM: Gwohl1
>>    
>
> I created this backdrop of shifting tones from his scale for a piece.
> I defined the ratios and multiplied them by a fundamental.
>
> ~p1=1.round(1); // 1/1
> ~p2=1.0125.round(1.0125); // 81/80
> ~p3=1.03125.round(1.03125); // 33/32
> ~p4=1.05.round(1.05); // 21/20
> ~p5=1.06667.round(1.06667); // 16/15
> ~p6=1.09091.round(1.09091); // 12/11
> ~p7=1.1.round(1.1); // 11/10
> ~p8=1.11111.round(1.11111); // 10/9
> ~p9=1.125.round(1.125); // 9/8
> ~p10=1.14286.round(1.14286);// 8/7
> ~p11=1.16667.round(1.16667);// 7/6
> ~p12=1.18519.round(1.18519);// 32/27
> ~p13=1.2.round(1.2); // 6/5
> ~p14=1.22222.round(1.22222);// 11/9
> ~p15=1.25.round(1.25); // 5/4
> ~p16=1.27273.round(1.27273);// 14/11
> ~p17=1.28571.round(1.28571);// 9/7
> ~p18=1.3125.round(1.3125);  // 21/16
> ~p19=1.33333.round(1.33333);// 4/3
> ~p20=1.35.round(1.35); // 27/20
> ~p21=1.375.round(1.375); // 11/8
> ~p22=1.4.round(1.4); // 7/5
> ~p23=1.42857.round(1.42857);// 10/7
> ~p24=1.45455.round(1.45455);// 16/11
> ~p25=1.48148.round(1.48148);// 40/27
> ~p26=1.5.round(1.5); // 3/2
> ~p27=1.52381.round(1.52381);// 32/21
> ~p28=1.55556.round(1.55556);// 14/9
> ~p29=1.57143.round(1.57143);// 11/7
> ~p30=1.6.round(1.6); // 8/5
> ~p31=1.63636.round(1.63636);// 18/11
> ~p32=1.66667.round(1.66667);// 5/3
> ~p33=1.6875.round(1.6875); // 27/16
> ~p34=1.71429.round(1.71429);// 12/7
> ~p35=1.75.round(1.75); // 7/4
> ~p36=1.77778.round(1.77778);// 16/9
> ~p37=1.8.round(1.8); // 9/5
> ~p38=1.81818.round(1.81818);// 20/11
> ~p39=1.83333.round(1.83333);// 11/6
> ~p40=1.875.round(1.875); // 15/8
> ~p41=1.90476.round(1.90476);// 40/21
> ~p42=1.93939.round(1.93939);// 64/33
> ~p43=1.97531.round(1.97531);// 160/81
> ~p44=2.round(2); // 2/1
>
> ~fundlist=[~p1, ~p2, ~p3, ~p4, ~p5, ~p6, ~p7, ~p8, ~p9, ~p10, ~p11,
> ~p12, ~p13, ~p14, ~p15, ~p16, ~p17];
> ~p1list=[~p18, ~p19, ~p20, ~p22, ~p24, ~p25, ~p26, ~p27, ~p28, ~p29,
> ~p30, ~p33, ~p43];
>
>
> ~nlist=[2000, 2001, 2002, 2003];
> ~currentnode=~nlist.choose;
> ~lastnode=~currentnode;
>
> ~partchBackdrop=Task({ var harmchoice;
> decay=0.35;
> fund=220;
> p1list=[~p18, ~p19, ~p20, ~p22, ~p24, ~p25, ~p26,
> ~p27, ~p28, ~p29, ~p30, ~p33, ~p43];
> p2list=[~p11, ~p12, ~p13, ~p16, ~p20, ~p23, ~p26,
> ~p27, ~p31, ~p33, ~p35, ~p40, ~p43, ~p44];
> p3list=[~p16, ~p21, ~p26, ~p27, ~p28, ~p34];
> p4list=[~p15, ~p18, ~p21, ~p22, ~p28, ~p29];
> p5list=[~p16, ~p17, ~p18, ~p19, ~p22, ~p23, ~p29, ~p30];
> p6list=[~p14, ~p16, ~p21, ~p22, ~p23, ~p24, ~p27,
> ~p30, ~p31, ~p38, ~p43];
> p7list=[~p6, ~p16, ~p18, ~p19, ~p20, ~p21, ~p24,
> ~p25, ~p31, ~p32];
> p8list=[~p7, ~p14, ~p16, ~p22, ~p25, ~p31, ~p32];
> p9list=[~p18, ~p19, ~p20, ~p21, ~p22, ~p26, ~p29, ~p32, ~p33];
> p10list=[~p16, ~p17, ~p18, ~p19, ~p20, ~p21, ~p22,
> ~p23, ~p27, ~p32, ~p33, ~p34, ~p35];
> p11list=[~p20, ~p21, ~p22, ~p24, ~p28, ~p32, ~p34, ~p35, ~p36];
> p12list=[~p19, ~p20, ~p21, ~p22, ~p25, ~p29, ~p33,
> ~p34, ~p35, ~p36];
> p13list=[~p19, ~p21, ~p22, ~p23, ~p30, ~p33, ~p36, ~p37, ~p38];
> p14list=[~p20, ~p21, ~p24, ~p27, ~p31, ~p37, ~p39];
> p15list=[~p32, ~p35, ~p40];
> p16list=[~p17, ~p23, ~p30, ~p32, ~p33, ~p41];
> p17list=[~p23, ~p30, ~p40, ~p42];
> p18list=[~p29, ~p35, ~p41, ~p42, ~p43];
> p19list=[~p20, ~p32, ~p36, ~p43, ~p44];
> p20list=[~p21, ~p33, ~p37, ~p43, ~p44];
> p21list=[~p31, ~p38, ~p39];
> p22list=[~p34, ~p35];
> p23list=[~p32, ~p41];
> p24list=[~p38, ~p41];
> p25list=[~p38, ~p43];
> p26list=[~p44, ~p37, ~p40];
> p27list=[~p35, ~p37];
> p28list=[~p38];
> p30list=[~p36, ~p40, ~p42, ~p44];
> p31list=[~p42];
> p33list=[~p43];
> p34list=[~p41];
> p35list=[~p1, ~p6, ~p7, ~p17, ~p18, ~p22, ~p23, ~p24, ~p30];
> p36list=[~p3, ~p4, ~p5, ~p8, ~p12, ~p18, ~p19, ~p20, ~p25];
> p37list=[~p4, ~p5, ~p6, ~p7, ~p8, ~p9, ~p12, ~p13, ~p19, ~p20];
> p38list=[~p4, ~p6, ~p9, ~p16, ~p20];
> p39list=[~p3, ~p4, ~p5, ~p6, ~p7, ~p8, ~p9, ~p14, ~p20, ~p21];
> p40list=[~p4, ~p5, ~p6, ~p7, ~p8, ~p9, ~p10, ~p15, ~p21, ~p22];
> p41list=[~p6, ~p7, ~p8, ~p15, ~p23];
> p42list=[~p10, ~p11, ~p23, ~p24];
> p43list=[~p1, ~p24, ~p25];
> p44list=p1list*0.5;
>
> masterlist=[~p1, ~p2, ~p3, ~p4, ~p5, ~p6, ~p7, ~p8,
> ~p9, ~p10, ~p11, ~p12, ~p13, ~p14,
>              ~p15, ~p16, ~p17, ~p18, ~p19, ~p20, ~p21, ~p22, ~p23,
> ~p24, ~p25, ~p26,
>              ~p28, ~p29, ~p30, ~p31, ~p32, ~p33, ~p34, ~p35, ~p36,
> ~p37, ~p38, ~p39,
>              ~p40, ~p41, ~p42, ~p43, ~p44];
>            
>           consonancelist=[ p1list, p2list, p3list, p4list, p5list,
> p6list, p7list,
>           p8list, p9list, p10list, p11list, p12list,
> p13list, p14list,
>           p15list, p16list, p17list, p18list, p19list,
> p20list, p21list,
>           p22list, p23list, p24list, p25list, p26list,
> p27list, p28list,
> p30list, p31list, p33list, p34list, p35list,
> p36list, p37list,
> p38list, p39list, p40list, p41list, p42list,
> p43list, p44list ];
>
> //harmchoice=#[17, 10, 11, 19, 13, 7];
> harmchoice=#[5, 7, 11, 10, 17];
> currentFundIndex=(~fundlist.size).rand;
> osc2index=0;
> osc2freq=0;
> osc3freq=0;
> osc3index=0;
>
> inf.do({ arg i; var f, hm1, hm2, thisIndex,
> nextIndex, p1, p2, p3, a1, a2, a3, f1, f2, f3, maxLev, percattack;
> p1=1.0.rand2;
> p2=1.0.rand2;
> p3=1.0.rand2;
> a1=rrand(0.4, 0.6);
> a2=rrand(0.1, 0.2);
> a3=rrand(0.1, 0.26);
> hm1=harmchoice.choose;
> hm2=harmchoice.choose;
> f1=rrand(0.2, 0.5);
> f2=rrand(0.2, 0.5);
> f3=rrand(0.2, 0.5);
> attack=exprand(0.45, 0.8);
> //maxLev=rrand(0.3, 0.6);
> percattack=0.1;
>
> while ( { ~lastnode==~currentnode },
> { ~currentnode=~nlist.choose;});
> ~lastnode=~currentnode;
>
>
> // Choose a node (synth) to change
> this time through
> if ( (i>3), {n=~currentnode;
> maxLev=rrand(0.3, 0.6);},
>   { if ( (i==0),
> {n=2000;  maxLev=0.07; },
>  
> { if ( (i==1), {n=2001; maxLev=0.07; },
>  
>      { if ( (i==2), {n=2002;
> maxLev=0.07; }, {n=2003; maxLev=0.07; ~lastnode=2003;}
>  
>             ) }
>  
> )}
>  
> )}
>   );
> //n.postln;
> //("current node:  "++~currentnode).postln;
> //("last node:  "++~lastnode).postln;
> (" ").postln;
>  
> if ( (n==2000),
> {
> if ( (currentFundIndex==0),
> { thisIndex=[
> 2, 2, 2, 2,
> 3, 3, 3,
> 4, 4,
> 5, 5,
> 6, 6,
> 7, 8,
> 9, 10, 11, 12, 13, 14, 15].choose; },
> { thisIndex=[
> -1,
> -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
> 2, 2, 2, 2,
> 3, 3, 3,
> 4, 4,
> 5, 5,
> 6,
> 6].choose; });
>
>  
> //("currentFundIndex="++currentFundIndex).postln;
> //("thisIndex="++thisIndex).postln;
> nextIndex=currentFundIndex+thisIndex;
> if (
> (nextIndex>~fundlist.size), { nextIndex=(nextIndex%(~fundlist.size))
> });
> //("nextIndex="++nextIndex).postln;
> f=fund*(~fundlist.wrapAt(nextIndex));
>  
> currentFundIndex=masterlist.indexOf(~fundlist.wrapAt(nextIndex));
>  
> //("currentFundIndex="++currentFundIndex).postln;
> s.sendMsg("/n_set", 2000, "gate", 0);
>   (decay+0.1).wait;
> //nextIndex.postln;
> //f.postln;
> s.sendMsg("/s_new",
> "threeSines", 2000, 1, 0,
>  
> "freq", f,
>  
> "a1", a1, "a2", a2, "a3", a3,
>  
> "lfo1", f1, "lfo2", f2, "lfo3", f3,
>  
> "harmMult1", hm1,
>  
> "harmMult2", hm2,
>  
> "p1", p1, "p2", p2, "p3", p3,
>      
> "attack", attack,
>      
> "envMax", maxLev,
>      
> "cutoff", rrand(f, f*2),
>      
> "percattack", percattack
>     );
>     },
>    {  if ( (n==2001),
> {
> osc2index=consonancelist.at(currentFundIndex).size.rand;
>    
> osc2freq=fund*(consonancelist.at(currentFundIndex).at(osc2index));
>    
> s.sendMsg("/n_set", 2001, "gate", 0);
>      (decay+0.1).wait;
>    
> s.sendMsg("/s_new", "threeSines", 2001, 1, 0,
>    
> "freq", osc2freq,
>    
> "a1", a1, "a2", a2, "a3", a3,
>  
> "lfo1", f1, "lfo2", f2, "lfo3", f3,
>  
> "harmMult1", hm1,
>    
> "harmMult2", hm2,
>    
> "p1", p1, "p2", p2, "p3", p3,
>      
> "attack", attack,
>      
> "envMax", maxLev,
>      
>              "cutoff", rrand(osc2freq, osc2freq*2),
>      
>              "percattack", percattack
>      
> );
>     },
>     { if ( (n==2002),
>      
> { osc3index=consonancelist.at(osc2index).size.rand;
>      
>  
> osc3freq=osc2freq*(consonancelist.at(osc2index).at(osc3index));
>      
>  if ( (osc2index>34), { sentfreq=osc3freq*([0.5, 1].choose)
> }, { sentfreq=osc3freq });
>      
>  s.sendMsg("/n_set", 2002, "gate", 0);
>      
>  (decay+0.1).wait;
>      
>  s.sendMsg("/s_new", "threeSines", 2002, 1, 0,
>      
>         "freq", sentfreq,
>      
>         "a1", a1, "a2", a2, "a3", a3,
>  
>         "lfo1", f1, "lfo2", f2,
> "lfo3", f3,
>  
>         "harmMult1", hm1,
>      
>         "harmMult2", hm2,
>      
>         "p1", p1, "p2", p2, "p3", p3,
>      
>         "attack", attack,
>      
>         "envMax", maxLev,
>      
>                       "cutoff", rrand(sentfreq, sentfreq*2),
>      
>                       "percattack", percattack
>      
>             );
>     },
>      
> { osc4index=consonancelist.at(osc3index).size.rand;
>      
>  
> osc4freq=osc3freq*(consonancelist.at(osc3index).at(osc4index));
>      
>  osc4freq=osc4freq*([1, 0.5].choose);
>      
>  s.sendMsg("/n_set", 2003, "gate", 0);
>      
>  (decay+0.1).wait;
>      
>  s.sendMsg("/s_new", "threeSines", 2003, 1, 0,
>      
>                       "freq", osc4freq,
>      
>                       "a1", a1, "a2", a2, "a3", a3,
>      
>                       "lfo1", f1, "lfo2", f2, "lfo3", f3,
>      
>                       "harmMult1", hm1,
>      
>                       "harmMult2", hm2,
>      
>                       "p1", p1, "p2", p2, "p3", p3,
>      
>                       "attack", attack,
>      
>         "envMax", maxLev,
>      
>                       "cutoff", rrand(osc4freq, osc4freq*2),
>      
>         "percattack", percattack
>      
>                       );
>      })
>      });
>      
>    
>    });
> if ( (i>3), {
> duration=([1.0, 1.5, 2.0, 2.0, 2.0, 2.5, 3.0, 3.5, 4.0, 3.5,
> 3.5].choose)+attack },
>    {
> duration=0.03/*rrand(0.4, 0.6)*/});
>    duration.wait;
> })
> });
>
> ~stopPartch = {
> s.sendBundle(0.0, ["/n_set", 2000, "gate", 0],
> ["/n_set", 2001, "decay", 3.0, "gate", 0],
> ["/n_set", 2002, "decay", 3.0, "gate", 0],
> ["/n_set", 2003, "decay", 3.0, "gate", 0]);
> s.sendBundle(3.0, ["/n_free", 2000],
> ["/n_free", 2001],
> ["/n_free", 2002],
> ["/n_free", 2003]);
> s.sendBundle(3.1, [~partchBackdrop.stop;~partchBackdrop.reset;]);
>               // ~partchBackdrop.stop;
>               // ~partchBackdrop.reset;
>               // [2000, 2001, 2002, 2003].do({ arg item;
> s.sendMsg("/n_set", item, "gate", 0); s.sendMsg("/n_free", item) });
>                };
>
>  
>> _______________________________________________
>> sc-users mailing list
>> sc-users@...
>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>>    
>
> _______________________________________________
> sc-users mailing list
> sc-users@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>
>  

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users