new user: handling degrees & shifting scales

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

new user: handling degrees & shifting scales

bloodymortimer
Hi readers.

so, usual story, just trying to get a bit of a strategic overview here
before i reinvent somebody's wheel ...

I'm comfortable (potentially even pleased ...) with the idea that i can
create Patterns based on Scale degree & shift the scales around underneath
the scalar interval sequences.

The forseeable issue is basically 'what happens when i change scale &
subsequently the degree information is different for the previously played
note?'

There are 2 clear but related instances when this will occur under some kind
of scalar alteration: (& the context is trying to do all this within a Pbind
based scenario ... for the time being at least ...)

1) Say i move from C major to E major & the previous note was an A / 69. The
degree has infact shifted from index position 5 to index position 3 (or -2
...). Can i advise the Pattern of this prior to its next update?

2) as above, but where the note was say, F, i need to adjust the degree to a
fractional value, reflecting a chromatic / outside note.

In browsing the discussion archive, i see this is a valid (if not
necessarily unproblematic) approach, but in a situation where degree 3 has
become degree 0.5 (0.1 ?) i guess do i not only need to 'set' the Degree
value afresh, i need to interrupt the Pattern supplying the /degree Stream &
tell it to perform some sort of chromatic course correction as a priority
with its next motion (for example ...)

the logically simple solution to 1) could be simply to define all my scales
as modes, all relative to 0 / "C" as the root ... so C Phrygian becomes the
effective replacement for Ab (same collection, different order, but with now
with universal degree consistency...) but the issue at 2 would still remain
...

I welcome thoughts & advice based on experience & brief operational examples
are certainly welcome, as i learnt some good things from the previous
discussion.

It may be that greater familiarity with the basic vocab of the various
pattern generators is sufficient to achieve all this, but then again i might
also be saving myself days of frustration by writing this mail.

many thanks.

(p.s: a one liner: is there a way i can get a list of all the default Synth
available to me in the 'Library'? I'm reasonably confident there must be
other pre-defined Synths that come with the standard installation
distribution beyond /default ...)






--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
@bloodymortimer
Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

daniel-mayer

Am 09.02.2018 um 22:35 schrieb [hidden email]:

There are 2 clear but related instances when this will occur under some kind
of scalar alteration: (& the context is trying to do all this within a Pbind
based scenario ... for the time being at least ...)

1) Say i move from C major to E major & the previous note was an A / 69. The
degree has infact shifted from index position 5 to index position 3 (or -2
...). Can i advise the Pattern of this prior to its next update?

2) as above, but where the note was say, F, i need to adjust the degree to a
fractional value, reflecting a chromatic / outside note.



What you are imagining is a kind of "degree recalculator", that, given a scale an a degree, calculates how the determined (absolute) pitch can be written as a degree based on another scale. Although this is certainly doable, I'd expect a lot of complications, just follow these github discussions, which are adressing just a part of the work that would have to be done for the described scenario.


Now my thought would be: why wanting such ?

If you want to subordinate a melodic line to a current scale / mode, you wouldn't need to know any kind of (possibly problematic) representation in a past mode. If it's about releasing nodes of past scales as in your earlier request I'd definitely base the releasing on a non-relative bookkeeping, e.g. midinotes instead of degrees.

Also note the Pattern framework doesn't handle rotated Scales (there might exist extensions that do that, but I 'm not aware of them right now). And there has been a debate on the wording of scales and modes ...

But the good news is that you can actually - with nearly no effort as you don't use tunings - drop the given framework of Scale class and also degree key, adapt to your prefered conventions and name the stuff as you like.


(
~scale = [0, 2, 4, 5, 7, 9, 10];
~base = 0;

p = Pbind(
\dur, 0.2,
// these two are "custom keys"
// Pstutter ensures changes to come after loop
\shiftedScale, Pstutter(7, Pfunc { ((~scale + ~base) % 12).sort }),
\myDegree, Pseq([0, 3, 1, 4, 2, 5, 6], inf),
\midinote, Pfunc { |ev| ev[\shiftedScale][ev[\myDegree]] + 60 }
);

b = Pbind(
\dur, 1.4,
\amp, [0.2, 0.2, 0.03, 0.03, 0.03],
\midinote, Pfunc { ~base } + [24, 36, 72, 76, 84]
);

x = Ppar([p, b]).trace.play
)

// change on the fly

~base = 4

~base = -4

~base = -1

~base = 3

~base = 0

x.stop


(p.s: a one liner: is there a way i can get a list of all the default Synth
available to me in the 'Library'? I'm reasonably confident there must be
other pre-defined Synths that come with the standard installation
distribution beyond /default ...)


I'm afraid no, but there are collections of SynthDefs floating around in the web:



Greetings

Daniel

-----------------------------
http://daniel-mayer.at
-----------------------------





Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

bloodymortimer
Thanks Daniel,

I'm a bit uncertain about the construction of this function
\midinote, Pfunc { |ev| ev[\shiftedScale][ev[\myDegree]] + 60 }

i understand that the previous \shiftedScale & \myDegree are accessible, but
what's ev & where is it being passed from? (maybe i missed something obvious
...)

> Now my thought would be: why wanting such ?

warning: this is not a short answer ... ; )

i guess one of the 'vaccuums' in my 'would-be creative process' that i hope
Supercollider can fill is that i want to have a more 'exploration of
materials' based approach, more in line with my (luddite) understanding of
more 'serious' instrumental composition ... & i want the computer to be the
tool that helps me explore this world more effectively & efficiently, as
well as utilise it's generative potential as part of the process.

i want to be able to catalogue & develop & generate this material in a way
that is not fixed-timeline dependent ... arrangement should come later ...
or, let's say that another way: 'a more flexible & generative Ableton Live
with a capacity to supply variation & development of motivic & thematic
ideas' ... a 'flexible musical sketchbook', with a database of ideas in
development, & (the part that has eluded me to this point) that's
interactive & real-time accessible ... (at some point publishing & editing
to MIDI will probably be desirable, just to be able to push notes around in
a GUI friendly way .. but for all sorts of reasons, including effective
parameter control, i feel MIDI is pretty limited. It's good if you want to
control instruments that sound & / or mechanically operate like keyboards
...)

More specifically: i like the idea of developing a catalog of 'interval
sequences', & exploring applying them not only over different modal
contexts, but contexts where using secondary / remote keys can be explored
within musical sentences, but the intervallic trajectories execute as
expected despite the fact that 1 or more scale tones might be subject to
'alterations' mid stream (some chromatic motion in the underlying
voice-leading for example ...)

i have been able to prototype such a process in Python before (one of the
upshots can also be that it deals with & knows about enharmonic equivalence
... it can spot the difference between an augmented 6 & a flat 7 for example
... by reference to the scale degrees...) but i suspect Python is more
suited to such a task than Supercollider in terms of ease of exploration,
particularly 'on the fly' Class development it seems. & i guess in a way
this consideration ('how tricky is it?') was at the heart of my question. &
indeed, you confirm 'that's not trivial'.

the latest twist in the tale however is that my definition of dissonances
here (in a harmonic world that more or less has it's eye increasingly on
Ravel for harmonic reference, thanks to a bit of reading i have been doing
lately) is that b9s are really my only potential dissonance i am likely to
apply stepwise resolution to as a general rule or principle.

Recasting the modes in the way i am describing (perhaps the analogy is truer
in suggesting the modes themselves are the 'casts', & the molten metal is
the interval sequences that i pour into them ...) means that some notes that
might not have been subject to dissonance handling in certain modes may
actually require it in others due to flattening of the interval of a 2nd ...
so perhaps i do need to have a fairly close marriage between this 'material
library' i am envisaging, & the modal context in which my phrases are being
situated ... theres is after all, a fairly easy way to do 'modal
transposition' in Supercollider, as long as you stay 'in mode' ...

a big waffle, but i'm prepared to throw it out there ... & it does answer
your question, 'well, why?' ...

the 'drifty textures thing' that you helped me with is really a different
'beast'. Sort of a 'creative plan B', although potentially yes i hope to get
to a point where that kind of thing can be incorporated as a texture in the
'meatier' context i am describing ... but it's very much 'it's own world' at
present ... (& yes you are right in that both concepts involve 'scene
changes' in underlying modal / scalar collections, & figured bass subsets
thereof ...)

Hope you're not sorry you asked, but I throw this out there as clearly i
must not be the only person who has arrived in this community motivated by
these kind of thoughts ...

Long story short: Perhaps i will stick to using Python for more complex
generative techniques to produce data sets that SC can then be unleashed
upon to deliver, roam & explore ...

please jump in on this anyone who also has thought about & explored similar
directions ...




--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
@bloodymortimer
Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

bloodymortimer
OK, i have switched off the accompaniment & slowed it down. i can hear what's
going on a bit more clearly now (although yes, a nice working simple example
of Ppar, thank you ...)

this is pretty much what i'm after. i just have to rethink my designs a bit
to accommodate & expand on this now central idea ...

Thanks again Daniel, your input has been 'mission critical' thus far, &
definitely appreciated ...

At some point i can see that authoring a few of my own classes might still
be desirable ... but from glancing at some references to that topic, i see
that it's not something you really do in an 'ad hoc' way ...




--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
@bloodymortimer
Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

daniel-mayer
In reply to this post by bloodymortimer

Am 10.02.2018 um 22:55 schrieb [hidden email]:

Thanks Daniel,

I'm a bit uncertain about the construction of this function
\midinote, Pfunc { |ev| ev[\shiftedScale][ev[\myDegree]] + 60 }


Sorry, I didn't explain that, it's a very useful syntax:
the Pfunc's Function takes over the current Event as argument.
That way you can access all data of the current Event (that was calculated in order before) and use it in the Pfunc.
Pkey does similar, but Pfunc is a bit more flexible.



i understand that the previous \shiftedScale & \myDegree are accessible, but
what's ev & where is it being passed from? (maybe i missed something obvious
...)

Now my thought would be: why wanting such ?

warning: this is not a short answer ... ; )




i have been able to prototype such a process in Python before (one of the
upshots can also be that it deals with & knows about enharmonic equivalence
... it can spot the difference between an augmented 6 & a flat 7 for example
... by reference to the scale degrees...) but i suspect Python is more
suited to such a task than Supercollider in terms of ease of exploration,
particularly 'on the fly' Class development it seems. & i guess in a way
this consideration ('how tricky is it?') was at the heart of my question. &
indeed, you confirm 'that's not trivial'.


All what you say sounds reasonable, I didn't want to disencourage you. It's just, my impression was that you're grasping for something which isn't fully covered by SC's built-in classes and using some of these class methods or something derived from them might complicate the situation.

SC's array methods on the other hand (I used a few in the examples) are so smart and comfortable that I suppose your problem could be well handled with them. I just haven't a totally clear picture at the moment what the scale handling should accomplish. t can imagine that after some working with SC a nice and relatively short solution might become obvious for you.

But one point is also true: the Event framework was not primarily designed to cope with pitches and scales from the viewpoint of western music notation. 

BTW it's definitely not necessary to write classes for your abstractions at a first glance. It's usually the end of a longer developing process. And with some Functions alone combined with Patterns you can really achieve a lot !

Greetings

Daniel

-----------------------------
http://daniel-mayer.at
-----------------------------





Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

bloodymortimer
>> SC's array methods on the other hand (I used a few in the examples) are so
smart and comfortable that I suppose your problem could be well handled with
them.

I agree. & after playing with your example a bit more i think i am closer to
this outcome than i realise (given i am still in the dark about 99% of what
SC can do ... & most of the syntax too to be honest ...)

a quick one hopefully before you dissappear into your night (as i am up & at
it on Sunday am in my timezone ...)

what's the best / most elegant way to sequence the 'scale changes', given
it's a time dependent exchange of a variable value, rather than an actual
'Event' being generated? (& hence outside of the application of Pbind i
assume ... which is all about targetting Synths ...)

so far i have this ...

~scX = Pseq([[0,2 4,5,7,9,10],[0,1,3,5,6,8,10]],inf).asStream;

& then, well, i'm not really sure ... is this better suited to a more
primitive sequencing convention like Routine or something? It would seem a
shame to not utilise Patterns in this context too however ...

would welcome your thoughts.





--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
@bloodymortimer
Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

daniel-mayer

Am 11.02.2018 um 01:02 schrieb [hidden email]:

SC's array methods on the other hand (I used a few in the examples) are so
smart and comfortable that I suppose your problem could be well handled with
them.

I agree. & after playing with your example a bit more i think i am closer to
this outcome than i realise (given i am still in the dark about 99% of what
SC can do ... & most of the syntax too to be honest ...)

a quick one hopefully before you dissappear into your night (as i am up & at
it on Sunday am in my timezone ...)

what's the best / most elegant way to sequence the 'scale changes', given
it's a time dependent exchange of a variable value, rather than an actual
'Event' being generated? (& hence outside of the application of Pbind i
assume ... which is all about targetting Synths ...)

so far i have this ...

~scX = Pseq([[0,2 4,5,7,9,10],[0,1,3,5,6,8,10]],inf).asStream;

& then, well, i'm not really sure ... is this better suited to a more
primitive sequencing convention like Routine or something? It would seem a
shame to not utilise Patterns in this context too however ...


Right, this is perfectly doable with patterns. They can be played silently and produce data for whatever.
The relevant chapter in the Pattern guide is "data sharing"

One thing to pay attention to: at identical points of time ordering isn't guaranteed, so do a slight time-shift.
In other contexts you can equalize the time shift by passing a "timingOffset" with Pbind, but that's not necessary here.

(
a = Pbind(
\dur, 1.4,
\scX,  Pseq([[0,2,4,5,7,9,10], [0,1,3,5,6,8,10]],inf).collect { |x| ~scale = x },
\type, \rest,
);

b = Pbind(
\dur, 0.2,
\scX, Pfunc { ~scale },
\myDegree, Pseq([0, 3, 1, 4, 2, 5, 6], inf),
\midinote, Pfunc { |ev| ev[\scX][ev[\myDegree]] + 60 }
);

x = Ptpar([0.0, a, 0.001, b]).trace.play
)

x.stop


Regards

Daniel

-----------------------------
http://daniel-mayer.at
-----------------------------



Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

bloodymortimer
wow. That's huge ...

that P___( ).collect that bundles the result of to a function ... i'm pretty
sure there must be massive potential in that, as well as the Pfunc { |ev|
ev[\scX][ev[\myDegree]] + 60 } scooping up of the multiple prior
calculations ...

& \type, \rest, ... another secret weapon right there - i think that's
essentially the piece of the puzzle i was missing here in terms of an Event
based approach ... but of course it makes sense that 'events' should be just
that ... 'moments in time' in the most generic sense ...

OK, i can see that Patterns can cover lots of possibilities with this kind
of usage ... this is another huge help & incredibly informative about syntax
to boot ... & having skimmed that Patterns tutorial, i'll now give it more
full & thorough attention ...

In the meantime, let's see if i can pipe MIDI in & out of this thing ... it
will be a good way to check over the details of some of my patterns as they
now hopefully will start to grow in sophistication ...

at least researching that should be a bit more clear cut, as it within the
realms of more elementary & generic tasks ...





--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
@bloodymortimer
Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

bloodymortimer
i've drifted slightly from the template here, but the big picture is still
somewhat swamped by the endless fussing over the placement of brackets &
dots ...

all the component functions seem to work, but i think i am falling down at
the final Pkey() stage ... probably a 30 second fix for someone who knows
what they are doing ...

not really looking for gold stars for design at this point, but again it
models a process & once i can get these examples working i will start
thinking about how to vary these concepts & chain them together ..

comments liberally sprinkled ...

(
// just one for now ...
~scale = [0,2,4,5,7,9,11];

// not actually required for this particular Pattern performance
// but is the basis upon which the b9 exlusions are calculated
// (& that function is yet to be written ...)
~figbass = [-8,2,4,5,8];

// degrees that have been identified as resulting in stepwise resolution
// rather than free voice motion (using b9s above / below a lower figured
bass note in this example ... ^7 with the figured bass are deemed OK ...)
~b9_exclusions = [-7,0,7,14,-4,3,10,17].sort.postln;

// mimick-ing the conventions for translating degree to midinote
// for my arbitrary scale constructs
// (i.e the 'index wrapping' & transposition)

~mydeg2mn = {

        |degree|

        var lookupdegree, transposition,midinote;
        lookupdegree = degree % 7;
        transposition = (degree / 7).floor * 12;
        midinote = ~scale[lookupdegree] + transposition + 60;
        midinote;

};

// the previous degree value must be held over
// for the subsequent Pbind cycle ... (maybe this can be done with Patterns,
but it's kess complicatd this way for now ...)
~value_store = 0;

// a basic weighted distribution favouring smaller stepped melodic motion
~weighted_motion = {

                var motion;

                motion = choose([4,3,3,2,2,2,1,1,1,1])*choose([-1,1]);

                ~value_store = ~value_store + motion;
                ~value_store.fold(-12,12)

        };

)

// so far, so good ...
~mydeg2mn.(~weighted_motion.value).value


(
~p_mover = Pbind(

        // if the previous degree selection
        // stored at ~value_store ...

        // is not in the ~b9_exclusions
        // apply ~weighted_motion ...

        // else just step down the semitone (for now ...)

        \mydegree, Pif(Pfunc( { ~b9_exclusions.indexOf(~value_store) == nil }),
                        Pfunc( { ~value_store = ~value_store-1; ~value_store } ),
                        Pfunc( {~weighted_motion}),
                ),

        // ** the problem is here? **
        // convert the new ~value_store to a midinote number & transmit
        \midinote,Pfunc( {~mydeg2mn.(Pkey(\mydegree))})

);

)

x = ~p_mover.play
x.stop





--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
@bloodymortimer
Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

daniel-mayer

Am 11.02.2018 um 13:34 schrieb [hidden email]:


// ** the problem is here? **
// convert the new ~value_store to a midinote number & transmit
\midinote,Pfunc( {~mydeg2mn.(Pkey(\mydegree))})


Your assumption is right, Pkey cannot be used in any context.
Have not thought through your whole code but at least the example runs with

\midinote, Pfunc( { |ev|  ~mydeg2mn.(ev[\mydegree] )} )

Regards

Daniel

-----------------------------
http://daniel-mayer.at
-----------------------------
Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

daniel-mayer
In reply to this post by bloodymortimer

Am 11.02.2018 um 05:01 schrieb [hidden email]:

wow. That's huge ...

that P___( ).collect that bundles the result of to a function ... i'm pretty
sure there must be massive potential in that, as well as the Pfunc { |ev|
ev[\scX][ev[\myDegree]] + 60 } scooping up of the multiple prior
calculations ...

Yes, it's often totally underestimated how much flexibility you can add to event patterns with some simple customized Functions. Patterns that enable this possibilty are e.g. Pcollect (Px().collect is just a different writing for that), Pfunc, Pfuncn, Plazy, Prout. 

Greetings

Daniel
 
-----------------------------
http://daniel-mayer.at
-----------------------------

Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

bloodymortimer
In reply to this post by daniel-mayer
unfortunately i still get the same error i was getting last night with the
line substitution ... (in fact errors of various persuasions were why i
abandoned my attempts to write the line using |ev| the way you initially
suggested Daniel & started trying Pkey instead ...)

the complete code bracket in question for me now looks like

(
~p_mover = Pbind(

        // if the previous degree selection
        // stored at ~value_store ...

        // is not in the ~b9_exclusions
        // apply ~weighted_motion ...

        // else just step down the semitone (for now ...)

        \mydegree, Pif(Pfunc( { ~b9_exclusions.indexOf(~value_store) == nil }),
                        Pfunc( { ~value_store = ~value_store-1; ~value_store } ),
                        Pfunc( {~weighted_motion})
                ),

        // convert the new ~value_store to a midinote number & transmit
        \midinote, Pfunc( { |ev|  ~mydeg2mn.(ev[\mydegree] )} )

);

)

the whole error report (which seems to culminate in mt supplying a
non-integer as an index position ...) follows ...

i'll be at work all day so no urgency in trying to solve. But this is fairly
representative of the kind of progress i seem to me making here. Still, when
i look at what i have here compared to this time last week, it's significant
progress (largely thanks to Daniel's & others help ...)

< ... >

[ -7, -4, 0, 3, 7, 10, 14, 17 ]
-> a Function
-> a Pbind
-> an EventStreamPlayer
ERROR: Primitive '_BasicAt' failed.
Index not an Integer
RECEIVER:
Instance of Array {    (0x1241a4c88, gc=9C, fmt=01, flg=00, set=03)
  indexed slots [7]
      0 : Integer 0
      1 : Integer 2
      2 : Integer 4
      3 : Integer 5
      4 : Integer 7
      5 : Integer 9
      6 : Integer 11
}
PATH: /Users/macuser/Documents/Supercollider/zzz tests and tuition/b9
time.scd

PROTECTED CALL STACK:
        Meta_MethodError:new 0x11be73c80
                arg this = PrimitiveFailedError
                arg what = Index not an Integer
                arg receiver = [ 0, 2, 4, 5, 7, 9, 11 ]
        Meta_PrimitiveFailedError:new 0x11be7a1c0
                arg this = PrimitiveFailedError
                arg receiver = [ 0, 2, 4, 5, 7, 9, 11 ]
        Object:primitiveFailed 0x11bab8e40
                arg this = [ 0, 2, 4, 5, 7, 9, 11 ]
        a FunctionDef 0x124476c98
                sourceCode = "{

        |degree|

        var lookupdegree, transposition,midinote;
        lookupdegree = degree % 7;
        transposition = (degree / 7).floor * 12;
        midinote = ~scale[lookupdegree] + transposition + 60;
        midinote;

}"
                arg degree = a Function
                var lookupdegree = a BinaryOpFunction
                var transposition = a BinaryOpFunction
                var midinote = nil
        a FunctionDef 0x11c935140
                sourceCode = "<an open Function>"
        Function:prTry 0x11c0d0c40
                arg this = a Function
                var result = nil
                var thread = a Routine
                var next = nil
                var wasInProtectedFunc = false
       
CALL STACK:
        MethodError:reportError
                arg this = <instance of PrimitiveFailedError>
        Nil:handleError
                arg this = nil
                arg error = <instance of PrimitiveFailedError>
        Thread:handleError
                arg this = <instance of Thread>
                arg error = <instance of PrimitiveFailedError>
        Thread:handleError
                arg this = <instance of Routine>
                arg error = <instance of PrimitiveFailedError>
        Thread:handleError
                arg this = <instance of Routine>
                arg error = <instance of PrimitiveFailedError>
        Object:throw
                arg this = <instance of PrimitiveFailedError>
        Function:protect
                arg this = <instance of Function>
                arg handler = <instance of Function>
                var result = <instance of PrimitiveFailedError>
        Environment:use
                arg this = <instance of Environment>
                arg function = <instance of Function>
                var result = nil
                var saveEnvir = <instance of Environment>
        < FunctionDef in Method Pbind:embedInStream >
                arg i = 2
                var name = 'midinote'
                var stream = <instance of FuncStream>
                var streamout = nil
        Integer:forBy
                arg this = 0
                arg endval = 3
                arg stepval = 2
                arg function = <instance of Function>
                var i = 2
                var j = 1
        Pbind:embedInStream
                arg this = <instance of Pbind>
                arg inevent = <instance of Event>
                var event = <instance of Event>
                var sawNil = false
                var streampairs = [*4]
                var endval = 3
        Routine:prStart
                arg this = <instance of Routine>
                arg inval = <instance of Event>
^^ The preceding error dump is for ERROR: Primitive '_BasicAt' failed.
Index not an Integer
RECEIVER: [ 0, 2, 4, 5, 7, 9, 11 ]






--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
@bloodymortimer
Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

daniel-mayer

I see. Strangely the example worked first for me at first, but not now -

Within the Pif the Function ~weighted_motion isn't evaluated.
Actually you can drop the Pif and write an if-statement within a Pfunc


\mydegree, Pfunc {
if(~b9_exclusions.indexOf(~value_store) == nil,
{ ~value_store = ~value_store-1; ~value_store },
{ ~weighted_motion.value }
)
},
// convert the new ~value_store to a midinote number & transmit
\midinote, Pfunc( { |ev| ~mydeg2mn.(ev[\mydegree] )} )



or

\mydegree, Pfunc {
if(~b9_exclusions.indexOf(~value_store) == nil,
{ ~value_store = ~value_store-1; ~value_store },
~weighted_motion
)
},
// convert the new ~value_store to a midinote number & transmit
\midinote, Pfunc( { |ev| ~mydeg2mn.(ev[\mydegree] )} )



Greetings

Daniel

-----------------------------
http://daniel-mayer.at
-----------------------------




Reply | Threaded
Open this post in threaded view
|

Re: new user: handling degrees & shifting scales

bloodymortimer
Great. Thanks so much ...

the only remaining issue was that sooner rather than later it drifted onto
an endless stepwise scalar descent ... it was easy enough to deduce i had
the True & False conditions the wrong way around...

not very remarkable at the moment, but 1) it runs, & 2) it's another piece
of the puzzle, & the other texture generators i create are likely to be more
like standard arpeggiators .. this non-chord tone handling is a bit more
logically advanced, so to get that working plants a flag in a frontier town
of my ambitions ... (please excuse my imperialist metaphors ... the era of
'humorous ironic goosestepping' has clearly come to a close after all ... )

& of course, 3) its another working example with some expertise & elegance &
'hot tips' sprinkled in, thanks again Daniel so much. I hope someone, if not
yourself, can also benefit from this discussion in the future ...

I managed to get MIDI out into Reaper no problem ... just to do some post
pattern editing ... many more ideas now to try & unify into this project ...
not least of which how to database my patterns & progressions ... some sort
of Dictionary based delivery system seems the obvious starting point ...
something like Pickle in Python?





--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
@bloodymortimer