Csound Csound-dev Csound-tekno Search About

[Csnd] more python

Date2013-04-18 11:54
Frompeiman khosravi
Subject[Csnd] more python
OK, this is very positive. In just one hour last night I managed to make a bunch of alien blips and blops using PythonScore. Now for the next step.

Say we have a pattern library in python that can be used alongside PythonScore. It's great for generating score event but what if you also want to be able to define a different envelop of arbitrary segments for each note? What if you want the envelop function to be generated by a python module? Would one use tables for this? Not so elegant I think. What are the options? I

Thanks
P     



www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.


Date2013-04-18 12:18
FromRory Walsh
SubjectRe: [Csnd] more python
Are you not going to share said alien blips? A bit of extra-terrestrial audio would be nice.


On 18 April 2013 11:54, peiman khosravi <peimankhosravi@gmail.com> wrote:
OK, this is very positive. In just one hour last night I managed to make a bunch of alien blips and blops using PythonScore. Now for the next step.

Say we have a pattern library in python that can be used alongside PythonScore. It's great for generating score event but what if you also want to be able to define a different envelop of arbitrary segments for each note? What if you want the envelop function to be generated by a python module? Would one use tables for this? Not so elegant I think. What are the options? I

Thanks
P     



www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



Date2013-04-18 12:21
FromSteven Yi
SubjectRe: [Csnd] more python
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
 wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.

Date2013-04-18 14:11
Frompeiman khosravi
SubjectRe: [Csnd] more python
Hi Rory,

I think it's too early for me to share anything. But  promise to do so soon plus some tutorials. I'll be documenting my findings here: http://peimankhosravi.co.uk/miscellaneous.html







www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:18, Rory Walsh <rorywalsh@ear.ie> wrote:
Are you not going to share said alien blips? A bit of extra-terrestrial audio would be nice.


On 18 April 2013 11:54, peiman khosravi <peimankhosravi@gmail.com> wrote:
OK, this is very positive. In just one hour last night I managed to make a bunch of alien blips and blops using PythonScore. Now for the next step.

Say we have a pattern library in python that can be used alongside PythonScore. It's great for generating score event but what if you also want to be able to define a different envelop of arbitrary segments for each note? What if you want the envelop function to be generated by a python module? Would one use tables for this? Not so elegant I think. What are the options? I

Thanks
P     



www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.




Date2013-04-18 14:13
Frompeiman khosravi
SubjectRe: [Csnd] more python
Thanks very much Steven,

I'm going to have a proper look at the code you posted. My initial impression is that this is possibly too convoluted for quick and dirty experimentation. I think it should be easier than that. Maybe with array in csound6 it will be possible?

Cheers,
Peiman  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-04-18 14:52
FromJacob Joaquin
SubjectRe: [Csnd] more python
I'll take a stab at this problem in a bit, but I'm hoping arrays in C6 will support something like the following. To solve the problem you presented, I think it would require two things. First, the ability to pass an as a pfield in the score:

i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)

And then in the score, pass the array in as a list of args for opcodes:

ienvpoints getarray p6
kenv linseg *ienvpoints

There may need to be a third step required for scaling the even fields of the array, though is probably already supported by orchestra loop statements.




On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Steven,

I'm going to have a proper look at the code you posted. My initial impression is that this is possibly too convoluted for quick and dirty experimentation. I think it should be easier than that. Maybe with array in csound6 it will be possible?

Cheers,
Peiman  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
codehop.com | #code #art #music

Date2013-04-18 15:05
FromSteven Yi
SubjectRe: [Csnd] more python
Attachmentsexcerpt.csd  
Hi Peiman,

I think it depends on the complexity of what your'e trying to
generate. The python code I had posted is a little lengthy but it's
doing quite a bit.  I've attached a CSD that is an excerpt of one of
the sound mass groups from my current piece.  The code uses 12
different performer objects in two different PerformerGroup objects (8
in the groupB64A, 4 in groupHorn).  The code generates glissandi such
that the group starts at a single pitch, then glissandi within a
growing random range, then converge into a major chord.  The glissandi
values have a bit of gentle variance added to get the texture to be a
little more lively.

This example though might not fall in line with the kind of material
you're thinking about, but at least it's an option that's there.  As a
side note, as I know you've been looking at the SuperCollider Patterns
library, the use of tied notes in Csound together with a note
generator is pretty much the same as what happens with using Patterns
with PMono and PMonoArtic.  The former involves absolute time values
for notes, while the latter operates with a delta time model.   Both
operate to update values for an instance of an instr/SynthDef over
time.

steven


On Thu, Apr 18, 2013 at 2:13 PM, peiman khosravi
 wrote:
> Thanks very much Steven,
>
> I'm going to have a proper look at the code you posted. My initial
> impression is that this is possibly too convoluted for quick and dirty
> experimentation. I think it should be easier than that. Maybe with array in
> csound6 it will be possible?
>
> Cheers,
> Peiman
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 12:21, Steven Yi  wrote:
>>
>> Hi Peiman,
>>
>> I've done a couple of ways using score generation:
>>
>> 1) For a limited number of articulations, I've added a pfield that is
>> used as an index to choose what envelope to generate
>>
>> 2) For arbitrary segments, I use fractional instrument numbers
>> together with tied-notes.  Essentially, each segment becomes a note.
>> Using fractional instr numbers allows for polyphonic streams.  I've
>> used this in pieces (you can check
>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>> 8.00" object) and am using this in my current piece to do group
>> glissandi sounds.
>>
>> The setup for instruments for tied-notes can be a bit tricky, but I've
>> got a set of UDO's now that I use together as a template when building
>> instruments that will work with different p-fields given for a note.
>> That's allowed using an instrument with MIDI, by score with 5-fields,
>> or scores with 8-fields.  That in turn has made it nice to work with
>> live, for quick sketching, or for generation.
>>
>> For example, code from my current piece uses:
>>
>> def scoreFunc():
>>     end = [3,5,7][int(random.random() * 3)]
>>
>>     ampGen = Mask(GaussRandom(),
>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>     pchVarianceGen = Mask(GaussRandom(),
>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>
>>     return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen),
>> ampGen)
>>
>> score = groupB64A.perform(scoreFunc)
>>
>> The code uses a mix of PMask and some score generating functions to
>> generate a score performance func that groupB64A uses to generate
>> notes like:
>>
>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>
>> If that's of use, I can post some more of the code or create a more
>> isolated example from my piece.
>>
>> Hope that helps!
>> steven
>>
>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>  wrote:
>> > OK, this is very positive. In just one hour last night I managed to make
>> > a
>> > bunch of alien blips and blops using PythonScore. Now for the next step.
>> >
>> > Say we have a pattern library in python that can be used alongside
>> > PythonScore. It's great for generating score event but what if you also
>> > want
>> > to be able to define a different envelop of arbitrary segments for each
>> > note? What if you want the envelop function to be generated by a python
>> > module? Would one use tables for this? Not so elegant I think. What are
>> > the
>> > options? I
>> >
>> > Thanks
>> > P
>> >
>> >
>> >
>> > www.peimankhosravi.co.uk
>> >
>> > To receive emails about upcoming concerts visit this page & enter your
>> > email
>> > address in the 'follow' section.
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>

Date2013-04-18 15:45
Frompeiman khosravi
SubjectRe: [Csnd] more python
Hi Steven,

Yes I certainly need to study your code properly. It's great that it's already possible. I'm not so concerned about the complexity of the python code as it can all be made nice and tidy by defining functions and classes. The problem is the orchestra code that unnecessarily becomes convoluted and lengthy. Also in SC one can pass on arrays as synthDef arguments, which is really powerful.

To me Jacob's suggestion of passing arrays as p-fields seems an ideal. From there it shouldn't be too hard to come up with UDOs to interpret the arrays to generate line segments and more.

I'll take a good look at your code tomorrow and get back to you.

Thanks so much for posting it.
P  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 15:05, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I think it depends on the complexity of what your'e trying to
generate. The python code I had posted is a little lengthy but it's
doing quite a bit.  I've attached a CSD that is an excerpt of one of
the sound mass groups from my current piece.  The code uses 12
different performer objects in two different PerformerGroup objects (8
in the groupB64A, 4 in groupHorn).  The code generates glissandi such
that the group starts at a single pitch, then glissandi within a
growing random range, then converge into a major chord.  The glissandi
values have a bit of gentle variance added to get the texture to be a
little more lively.

This example though might not fall in line with the kind of material
you're thinking about, but at least it's an option that's there.  As a
side note, as I know you've been looking at the SuperCollider Patterns
library, the use of tied notes in Csound together with a note
generator is pretty much the same as what happens with using Patterns
with PMono and PMonoArtic.  The former involves absolute time values
for notes, while the latter operates with a delta time model.   Both
operate to update values for an instance of an instr/SynthDef over
time.

steven


On Thu, Apr 18, 2013 at 2:13 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> Thanks very much Steven,
>
> I'm going to have a proper look at the code you posted. My initial
> impression is that this is possibly too convoluted for quick and dirty
> experimentation. I think it should be easier than that. Maybe with array in
> csound6 it will be possible?
>
> Cheers,
> Peiman
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>
>> Hi Peiman,
>>
>> I've done a couple of ways using score generation:
>>
>> 1) For a limited number of articulations, I've added a pfield that is
>> used as an index to choose what envelope to generate
>>
>> 2) For arbitrary segments, I use fractional instrument numbers
>> together with tied-notes.  Essentially, each segment becomes a note.
>> Using fractional instr numbers allows for polyphonic streams.  I've
>> used this in pieces (you can check
>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>> 8.00" object) and am using this in my current piece to do group
>> glissandi sounds.
>>
>> The setup for instruments for tied-notes can be a bit tricky, but I've
>> got a set of UDO's now that I use together as a template when building
>> instruments that will work with different p-fields given for a note.
>> That's allowed using an instrument with MIDI, by score with 5-fields,
>> or scores with 8-fields.  That in turn has made it nice to work with
>> live, for quick sketching, or for generation.
>>
>> For example, code from my current piece uses:
>>
>> def scoreFunc():
>>     end = [3,5,7][int(random.random() * 3)]
>>
>>     ampGen = Mask(GaussRandom(),
>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>     pchVarianceGen = Mask(GaussRandom(),
>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>
>>     return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen),
>> ampGen)
>>
>> score = groupB64A.perform(scoreFunc)
>>
>> The code uses a mix of PMask and some score generating functions to
>> generate a score performance func that groupB64A uses to generate
>> notes like:
>>
>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>
>> If that's of use, I can post some more of the code or create a more
>> isolated example from my piece.
>>
>> Hope that helps!
>> steven
>>
>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>> > OK, this is very positive. In just one hour last night I managed to make
>> > a
>> > bunch of alien blips and blops using PythonScore. Now for the next step.
>> >
>> > Say we have a pattern library in python that can be used alongside
>> > PythonScore. It's great for generating score event but what if you also
>> > want
>> > to be able to define a different envelop of arbitrary segments for each
>> > note? What if you want the envelop function to be generated by a python
>> > module? Would one use tables for this? Not so elegant I think. What are
>> > the
>> > options? I
>> >
>> > Thanks
>> > P
>> >
>> >
>> >
>> > www.peimankhosravi.co.uk
>> >
>> > To receive emails about upcoming concerts visit this page & enter your
>> > email
>> > address in the 'follow' section.
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>

Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-04-18 16:00
FromSteven Yi
SubjectRe: [Csnd] more python
Sure thing. Instruments can get a bit messy dealing with ties, but you
can encapsulate that all in a UDO. For example, my instruments have:

kpchline, kamp, kenv, kspace yi_instr_gen i(),
i(), i(), i(), i(), 

(where the <> values are from BlueSynthBuilder knobs).  That one UDO
calls a bunch of others, and the output works for whether I call the
note like the following:

i1 0 2 8.00 -12
i1 0 2 8.00 8.03 -12 0 1

or if tied notes are used.  I end up using the same code with all of
my instruments now, so the instrument code itself is pretty tidy.  It
also means I can interchange all of my instruments with any of my
score generators. I've found it fairly useful.

What Jake wrote is similar to your earlier request on the mailing list
for arrays in score notes. The way that pfields are currently handled
don't make it simple to add, but it would certainly be nice. We
probably need to work on adding static array initializers in the orc
language first (i.e. "kVar[] init [0, 0, 0.5, 3]",  or "kenv myEnvGen
[0, .1, .1, .2], [1, .9, 0], [0, 1, -2]"), as that was requested on
the dev list too.  I guess it's a matter of scheduling the work for
CS6 or 6.1 or whenever.

On Thu, Apr 18, 2013 at 3:45 PM, peiman khosravi
 wrote:
> Hi Steven,
>
> Yes I certainly need to study your code properly. It's great that it's
> already possible. I'm not so concerned about the complexity of the python
> code as it can all be made nice and tidy by defining functions and classes.
> The problem is the orchestra code that unnecessarily becomes convoluted and
> lengthy. Also in SC one can pass on arrays as synthDef arguments, which is
> really powerful.
>
> To me Jacob's suggestion of passing arrays as p-fields seems an ideal. From
> there it shouldn't be too hard to come up with UDOs to interpret the arrays
> to generate line segments and more.
>
> I'll take a good look at your code tomorrow and get back to you.
>
> Thanks so much for posting it.
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 15:05, Steven Yi  wrote:
>>
>> Hi Peiman,
>>
>> I think it depends on the complexity of what your'e trying to
>> generate. The python code I had posted is a little lengthy but it's
>> doing quite a bit.  I've attached a CSD that is an excerpt of one of
>> the sound mass groups from my current piece.  The code uses 12
>> different performer objects in two different PerformerGroup objects (8
>> in the groupB64A, 4 in groupHorn).  The code generates glissandi such
>> that the group starts at a single pitch, then glissandi within a
>> growing random range, then converge into a major chord.  The glissandi
>> values have a bit of gentle variance added to get the texture to be a
>> little more lively.
>>
>> This example though might not fall in line with the kind of material
>> you're thinking about, but at least it's an option that's there.  As a
>> side note, as I know you've been looking at the SuperCollider Patterns
>> library, the use of tied notes in Csound together with a note
>> generator is pretty much the same as what happens with using Patterns
>> with PMono and PMonoArtic.  The former involves absolute time values
>> for notes, while the latter operates with a delta time model.   Both
>> operate to update values for an instance of an instr/SynthDef over
>> time.
>>
>> steven
>>
>>
>> On Thu, Apr 18, 2013 at 2:13 PM, peiman khosravi
>>  wrote:
>> > Thanks very much Steven,
>> >
>> > I'm going to have a proper look at the code you posted. My initial
>> > impression is that this is possibly too convoluted for quick and dirty
>> > experimentation. I think it should be easier than that. Maybe with array
>> > in
>> > csound6 it will be possible?
>> >
>> > Cheers,
>> > Peiman
>> >
>> >
>> >
>> >
>> >
>> >
>> > www.peimankhosravi.co.uk
>> >
>> > To receive emails about upcoming concerts visit this page & enter your
>> > email
>> > address in the 'follow' section.
>> >
>> >
>> >
>> > On 18 April 2013 12:21, Steven Yi  wrote:
>> >>
>> >> Hi Peiman,
>> >>
>> >> I've done a couple of ways using score generation:
>> >>
>> >> 1) For a limited number of articulations, I've added a pfield that is
>> >> used as an index to choose what envelope to generate
>> >>
>> >> 2) For arbitrary segments, I use fractional instrument numbers
>> >> together with tied-notes.  Essentially, each segment becomes a note.
>> >> Using fractional instr numbers allows for polyphonic streams.  I've
>> >> used this in pieces (you can check
>> >> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>> >> 8.00" object) and am using this in my current piece to do group
>> >> glissandi sounds.
>> >>
>> >> The setup for instruments for tied-notes can be a bit tricky, but I've
>> >> got a set of UDO's now that I use together as a template when building
>> >> instruments that will work with different p-fields given for a note.
>> >> That's allowed using an instrument with MIDI, by score with 5-fields,
>> >> or scores with 8-fields.  That in turn has made it nice to work with
>> >> live, for quick sketching, or for generation.
>> >>
>> >> For example, code from my current piece uses:
>> >>
>> >> def scoreFunc():
>> >>     end = [3,5,7][int(random.random() * 3)]
>> >>
>> >>     ampGen = Mask(GaussRandom(),
>> >>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>> >>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>> >>     pchVarianceGen = Mask(GaussRandom(),
>> >>         LinearSegment([(0,.01), (4,7), (6,end)]),
>> >>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>> >>
>> >>     return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen),
>> >> ampGen)
>> >>
>> >> score = groupB64A.perform(scoreFunc)
>> >>
>> >> The code uses a mix of PMask and some score generating functions to
>> >> generate a score performance func that groupB64A uses to generate
>> >> notes like:
>> >>
>> >> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>> >> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>> >> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>> >> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>> >> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>> >> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>> >> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>> >> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>> >> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>> >> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>> >> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>> >> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>> >> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>> >> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>> >> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>> >> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>> >> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>> >> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>> >> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>> >> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>> >> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>> >> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>> >> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>> >> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>> >> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>> >> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>> >> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>> >> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>> >> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>> >> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>> >> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>> >> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>> >> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>> >> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>> >> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>> >> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>> >> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>> >> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>> >> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>> >> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>> >> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>> >> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>> >> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>> >> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>> >> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>> >> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>> >> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>> >> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>> >> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>> >> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>> >> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>> >> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>> >> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>> >> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>> >> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>> >> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>> >> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>> >> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>> >> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>> >> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>> >> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>> >> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>> >> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>> >> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>> >> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>> >> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>> >> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>> >> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>> >> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>> >> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>> >> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>> >> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>> >> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>> >> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>> >> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>> >> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>> >> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>> >> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>> >> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>> >> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>> >> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>> >> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>> >> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>> >> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>> >> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>> >> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>> >> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>> >> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>> >> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>> >> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>> >> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>> >> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>> >> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>> >> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>> >> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>> >> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>> >> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>> >> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>> >> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>> >> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>> >>
>> >> If that's of use, I can post some more of the code or create a more
>> >> isolated example from my piece.
>> >>
>> >> Hope that helps!
>> >> steven
>> >>
>> >> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>> >>  wrote:
>> >> > OK, this is very positive. In just one hour last night I managed to
>> >> > make
>> >> > a
>> >> > bunch of alien blips and blops using PythonScore. Now for the next
>> >> > step.
>> >> >
>> >> > Say we have a pattern library in python that can be used alongside
>> >> > PythonScore. It's great for generating score event but what if you
>> >> > also
>> >> > want
>> >> > to be able to define a different envelop of arbitrary segments for
>> >> > each
>> >> > note? What if you want the envelop function to be generated by a
>> >> > python
>> >> > module? Would one use tables for this? Not so elegant I think. What
>> >> > are
>> >> > the
>> >> > options? I
>> >> >
>> >> > Thanks
>> >> > P
>> >> >
>> >> >
>> >> >
>> >> > www.peimankhosravi.co.uk
>> >> >
>> >> > To receive emails about upcoming concerts visit this page & enter
>> >> > your
>> >> > email
>> >> > address in the 'follow' section.
>> >>
>> >>
>> >> Send bugs reports to the Sourceforge bug tracker
>> >>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>

Date2013-04-18 16:30
FromJacob Joaquin
SubjectRe: [Csnd] more python
Here is another approach:


I feel I can reduce this example further, and when I do, I'll include it as an example case with PythonScore. In the meantime, here's the explanation of how it works.

Envelope shapes are generated as tables. They are created dynamically in score. Since we don't want tables overwriting tables as they're being played, I created the table_cycler that cycles through a range of table indexes every time a new table is created. In this case, the range is between 100 and 120.

table_cycler = cycle(xrange(100, 120))

The function that handles this is gen_envelope(). It takes a list of envelope points, and reformats it into a GEN07 "f" event. The args are the same as GEN07, but only the envelope data, as the first 5 "f" event pfields are automatically handled:

def gen_envelope(*args):
    global table_cycler

    table = table_cycler.next()
    L = ["f", table, score.cue.now(), 8192, -7] + list(args)
    score.write(" ".join(str(i) for i in L))
    return table

That function returns the number of the table generated. So a value between 100 and 120. If you watch the table numbers during a performance, you'll see it cycle through this range.

Now, one can pass an arbitrary number of envelope points. The first 5 notes in the score demo this explicitly:

with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))

For the rest of the piece, it auto-cycles between a frequency pattern and an envelope pattern.

Best,
Jake



On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I'll take a stab at this problem in a bit, but I'm hoping arrays in C6 will support something like the following. To solve the problem you presented, I think it would require two things. First, the ability to pass an as a pfield in the score:

i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)

And then in the score, pass the array in as a list of args for opcodes:

ienvpoints getarray p6
kenv linseg *ienvpoints

There may need to be a third step required for scaling the even fields of the array, though is probably already supported by orchestra loop statements.




On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Steven,

I'm going to have a proper look at the code you posted. My initial impression is that this is possibly too convoluted for quick and dirty experimentation. I think it should be easier than that. Maybe with array in csound6 it will be possible?

Cheers,
Peiman  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
codehop.com | #code #art #music



--
codehop.com | #code #art #music

Date2013-04-18 18:42
Frompeiman khosravi
SubjectRe: [Csnd] more python




On 18 April 2013 16:00, Steven Yi <stevenyi@gmail.com> wrote:
Sure thing. Instruments can get a bit messy dealing with ties, but you
can encapsulate that all in a UDO. For example, my instruments have:

kpchline, kamp, kenv, kspace yi_instr_gen i(<ampEnvType>),
i(<attack>), i(<decay>), i(<sustain>), i(<release>), <space>

(where the <> values are from BlueSynthBuilder knobs).  That one UDO
calls a bunch of others, and the output works for whether I call the
note like the following:

i1 0 2 8.00 -12
i1 0 2 8.00 8.03 -12 0 1

I see. Makes sense. I'll play around with
these later tonight. Sounds promising!
 
 

or if tied notes are used.  I end up using the same code with all of
my instruments now, so the instrument code itself is pretty tidy.  It
also means I can interchange all of my instruments with any of my
score generators. I've found it fairly useful.

What Jake wrote is similar to your earlier request on the mailing list
for arrays in score notes. The way that pfields are currently handled
don't make it simple to add, but it would certainly be nice. We
probably need to work on adding static array initializers in the orc
language first (i.e. "kVar[] init [0, 0, 0.5, 3]",  or "kenv myEnvGen
[0, .1, .1, .2], [1, .9, 0], [0, 1, -2]"), as that was requested on
the dev list too.  I guess it's a matter of scheduling the work for
CS6 or 6.1 or whenever.

Kool!
 
P


Date2013-04-18 18:48
Frompeiman khosravi
SubjectRe: [Csnd] more python
This is elegant. Do you know if there is currently a limit to the number of table points manually defined in the score?

If not, then there is room for much experimentation. One can even apply things like masking to tables. This then calls for a set of python classes for dealing with different table functions and so on.

I'll play with both yours and Steven's solution today and post my verdict!

P






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 16:30, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Here is another approach:


I feel I can reduce this example further, and when I do, I'll include it as an example case with PythonScore. In the meantime, here's the explanation of how it works.

Envelope shapes are generated as tables. They are created dynamically in score. Since we don't want tables overwriting tables as they're being played, I created the table_cycler that cycles through a range of table indexes every time a new table is created. In this case, the range is between 100 and 120.

table_cycler = cycle(xrange(100, 120))

The function that handles this is gen_envelope(). It takes a list of envelope points, and reformats it into a GEN07 "f" event. The args are the same as GEN07, but only the envelope data, as the first 5 "f" event pfields are automatically handled:

def gen_envelope(*args):
    global table_cycler

    table = table_cycler.next()
    L = ["f", table, score.cue.now(), 8192, -7] + list(args)
    score.write(" ".join(str(i) for i in L))
    return table

That function returns the number of the table generated. So a value between 100 and 120. If you watch the table numbers during a performance, you'll see it cycle through this range.

Now, one can pass an arbitrary number of envelope points. The first 5 notes in the score demo this explicitly:

with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))

For the rest of the piece, it auto-cycles between a frequency pattern and an envelope pattern.

Best,
Jake



On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I'll take a stab at this problem in a bit, but I'm hoping arrays in C6 will support something like the following. To solve the problem you presented, I think it would require two things. First, the ability to pass an as a pfield in the score:

i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)

And then in the score, pass the array in as a list of args for opcodes:

ienvpoints getarray p6
kenv linseg *ienvpoints

There may need to be a third step required for scaling the even fields of the array, though is probably already supported by orchestra loop statements.




On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Steven,

I'm going to have a proper look at the code you posted. My initial impression is that this is possibly too convoluted for quick and dirty experimentation. I think it should be easier than that. Maybe with array in csound6 it will be possible?

Cheers,
Peiman  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
codehop.com | #code #art #music



--
codehop.com | #code #art #music


Date2013-04-18 19:19
FromJacob Joaquin
SubjectRe: [Csnd] more python
I believe the limit is dependent on the number of pfields one can include in an "f" statement, though I have no idea what that number is.


On Thu, Apr 18, 2013 at 10:48 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
This is elegant. Do you know if there is currently a limit to the number of table points manually defined in the score?

If not, then there is room for much experimentation. One can even apply things like masking to tables. This then calls for a set of python classes for dealing with different table functions and so on.

I'll play with both yours and Steven's solution today and post my verdict!

P






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 16:30, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Here is another approach:


I feel I can reduce this example further, and when I do, I'll include it as an example case with PythonScore. In the meantime, here's the explanation of how it works.

Envelope shapes are generated as tables. They are created dynamically in score. Since we don't want tables overwriting tables as they're being played, I created the table_cycler that cycles through a range of table indexes every time a new table is created. In this case, the range is between 100 and 120.

table_cycler = cycle(xrange(100, 120))

The function that handles this is gen_envelope(). It takes a list of envelope points, and reformats it into a GEN07 "f" event. The args are the same as GEN07, but only the envelope data, as the first 5 "f" event pfields are automatically handled:

def gen_envelope(*args):
    global table_cycler

    table = table_cycler.next()
    L = ["f", table, score.cue.now(), 8192, -7] + list(args)
    score.write(" ".join(str(i) for i in L))
    return table

That function returns the number of the table generated. So a value between 100 and 120. If you watch the table numbers during a performance, you'll see it cycle through this range.

Now, one can pass an arbitrary number of envelope points. The first 5 notes in the score demo this explicitly:

with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))

For the rest of the piece, it auto-cycles between a frequency pattern and an envelope pattern.

Best,
Jake



On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I'll take a stab at this problem in a bit, but I'm hoping arrays in C6 will support something like the following. To solve the problem you presented, I think it would require two things. First, the ability to pass an as a pfield in the score:

i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)

And then in the score, pass the array in as a list of args for opcodes:

ienvpoints getarray p6
kenv linseg *ienvpoints

There may need to be a third step required for scaling the even fields of the array, though is probably already supported by orchestra loop statements.




On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Steven,

I'm going to have a proper look at the code you posted. My initial impression is that this is possibly too convoluted for quick and dirty experimentation. I think it should be easier than that. Maybe with array in csound6 it will be possible?

Cheers,
Peiman  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
codehop.com | #code #art #music



--
codehop.com | #code #art #music




--
codehop.com | #code #art #music

Date2013-04-18 19:26
FromSteven Yi
SubjectRe: [Csnd] more python
Ah, I'm confused, as your original email had:

"Would one use tables for this? Not so elegant I think."

so I thought you were looking for options besides tables.  Anyways,
each of these things will have pluses and minuses.  For example, when
I work in Blue, I can start playback in the middle of a texture block.
Because it uses notes, I don't have to worry about rendering from the
beginning of the overall texture, I can just advance through the
score. Using tied notes also means possibilities for altering a
texture in realtime if you have an event generator sending notes to
Csound.  On the other hand, using an envelope as table can make the
instrument design simpler.  (I found Jake's code very easy to
understand and reason through.)  You might run into issues like the
duration of the note affecting the envelope rate, but you can also
work around that.

I guess the important thing though is that you have some options.
Also, you might consider mixing and matching possibilities.  For
example, a lot of the complexity of the instrument code I have has to
do with dealing with different scenarios on how the instrument is
called and the interaction with the orchestral composition library I
use from python/blue.  For your own instruments, you might simplify
things, but you could have an instrument that both responds to tied
notes, articulations, or use a negative articulation to denote an
ftable to read as an envelope.  That'd give you a lot of flexibility
then.

On Thu, Apr 18, 2013 at 6:48 PM, peiman khosravi
 wrote:
> This is elegant. Do you know if there is currently a limit to the number of
> table points manually defined in the score?
>
> If not, then there is room for much experimentation. One can even apply
> things like masking to tables. This then calls for a set of python classes
> for dealing with different table functions and so on.
>
> I'll play with both yours and Steven's solution today and post my verdict!
>
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 16:30, Jacob Joaquin  wrote:
>>
>> Here is another approach:
>>
>> https://gist.github.com/jacobjoaquin/5413575
>>
>> I feel I can reduce this example further, and when I do, I'll include it
>> as an example case with PythonScore. In the meantime, here's the explanation
>> of how it works.
>>
>> Envelope shapes are generated as tables. They are created dynamically in
>> score. Since we don't want tables overwriting tables as they're being
>> played, I created the table_cycler that cycles through a range of table
>> indexes every time a new table is created. In this case, the range is
>> between 100 and 120.
>>
>> table_cycler = cycle(xrange(100, 120))
>>
>> The function that handles this is gen_envelope(). It takes a list of
>> envelope points, and reformats it into a GEN07 "f" event. The args are the
>> same as GEN07, but only the envelope data, as the first 5 "f" event pfields
>> are automatically handled:
>>
>> def gen_envelope(*args):
>>     global table_cycler
>>
>>     table = table_cycler.next()
>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>     score.write(" ".join(str(i) for i in L))
>>     return table
>>
>> That function returns the number of the table generated. So a value
>> between 100 and 120. If you watch the table numbers during a performance,
>> you'll see it cycle through this range.
>>
>> Now, one can pass an arbitrary number of envelope points. The first 5
>> notes in the score demo this explicitly:
>>
>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>
>> For the rest of the piece, it auto-cycles between a frequency pattern and
>> an envelope pattern.
>>
>> Best,
>> Jake
>>
>>
>>
>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin 
>> wrote:
>>>
>>> I'll take a stab at this problem in a bit, but I'm hoping arrays in C6
>>> will support something like the following. To solve the problem you
>>> presented, I think it would require two things. First, the ability to pass
>>> an as a pfield in the score:
>>>
>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>
>>> And then in the score, pass the array in as a list of args for opcodes:
>>>
>>> ienvpoints getarray p6
>>> kenv linseg *ienvpoints
>>>
>>> There may need to be a third step required for scaling the even fields of
>>> the array, though is probably already supported by orchestra loop
>>> statements.
>>>
>>>
>>>
>>>
>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>  wrote:
>>>>
>>>> Thanks very much Steven,
>>>>
>>>> I'm going to have a proper look at the code you posted. My initial
>>>> impression is that this is possibly too convoluted for quick and dirty
>>>> experimentation. I think it should be easier than that. Maybe with array in
>>>> csound6 it will be possible?
>>>>
>>>> Cheers,
>>>> Peiman
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 18 April 2013 12:21, Steven Yi  wrote:
>>>>>
>>>>> Hi Peiman,
>>>>>
>>>>> I've done a couple of ways using score generation:
>>>>>
>>>>> 1) For a limited number of articulations, I've added a pfield that is
>>>>> used as an index to choose what envelope to generate
>>>>>
>>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>>>> together with tied-notes.  Essentially, each segment becomes a note.
>>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>>>> used this in pieces (you can check
>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>>>> 8.00" object) and am using this in my current piece to do group
>>>>> glissandi sounds.
>>>>>
>>>>> The setup for instruments for tied-notes can be a bit tricky, but I've
>>>>> got a set of UDO's now that I use together as a template when building
>>>>> instruments that will work with different p-fields given for a note.
>>>>> That's allowed using an instrument with MIDI, by score with 5-fields,
>>>>> or scores with 8-fields.  That in turn has made it nice to work with
>>>>> live, for quick sketching, or for generation.
>>>>>
>>>>> For example, code from my current piece uses:
>>>>>
>>>>> def scoreFunc():
>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>
>>>>>     ampGen = Mask(GaussRandom(),
>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>
>>>>>     return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen),
>>>>> ampGen)
>>>>>
>>>>> score = groupB64A.perform(scoreFunc)
>>>>>
>>>>> The code uses a mix of PMask and some score generating functions to
>>>>> generate a score performance func that groupB64A uses to generate
>>>>> notes like:
>>>>>
>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>>>>
>>>>> If that's of use, I can post some more of the code or create a more
>>>>> isolated example from my piece.
>>>>>
>>>>> Hope that helps!
>>>>> steven
>>>>>
>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>  wrote:
>>>>> > OK, this is very positive. In just one hour last night I managed to
>>>>> > make a
>>>>> > bunch of alien blips and blops using PythonScore. Now for the next
>>>>> > step.
>>>>> >
>>>>> > Say we have a pattern library in python that can be used alongside
>>>>> > PythonScore. It's great for generating score event but what if you
>>>>> > also want
>>>>> > to be able to define a different envelop of arbitrary segments for
>>>>> > each
>>>>> > note? What if you want the envelop function to be generated by a
>>>>> > python
>>>>> > module? Would one use tables for this? Not so elegant I think. What
>>>>> > are the
>>>>> > options? I
>>>>> >
>>>>> > Thanks
>>>>> > P
>>>>> >
>>>>> >
>>>>> >
>>>>> > www.peimankhosravi.co.uk
>>>>> >
>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>> > your email
>>>>> > address in the 'follow' section.
>>>>>
>>>>>
>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>> Discussions of bugs and features can be posted here
>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>> "unsubscribe csound"
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> codehop.com | #code #art #music
>>
>>
>>
>>
>> --
>> codehop.com | #code #art #music
>
>

Date2013-04-18 19:36
Frompeiman khosravi
SubjectRe: [Csnd] more python







www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 19:26, Steven Yi <stevenyi@gmail.com> wrote:
Ah, I'm confused, as your original email had:

"Would one use tables for this? Not so elegant I think."

Yes, I should have had "(?)" at the end of that sentence! It seems that if python is doing all the dirty work then it doesn't look too bad! 

I'm playing with your ideas right now actually. The instrument design can get a bit messy but I'll write back in a bit. 

P

so I thought you were looking for options besides tables.  Anyways,
each of these things will have pluses and minuses.  For example, when
I work in Blue, I can start playback in the middle of a texture block.
Because it uses notes, I don't have to worry about rendering from the
beginning of the overall texture, I can just advance through the
score. Using tied notes also means possibilities for altering a
texture in realtime if you have an event generator sending notes to
Csound.  On the other hand, using an envelope as table can make the
instrument design simpler.  (I found Jake's code very easy to
understand and reason through.)  You might run into issues like the
duration of the note affecting the envelope rate, but you can also
work around that.

I guess the important thing though is that you have some options.
Also, you might consider mixing and matching possibilities.  For
example, a lot of the complexity of the instrument code I have has to
do with dealing with different scenarios on how the instrument is
called and the interaction with the orchestral composition library I
use from python/blue.  For your own instruments, you might simplify
things, but you could have an instrument that both responds to tied
notes, articulations, or use a negative articulation to denote an
ftable to read as an envelope.  That'd give you a lot of flexibility
then.

On Thu, Apr 18, 2013 at 6:48 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> This is elegant. Do you know if there is currently a limit to the number of
> table points manually defined in the score?
>
> If not, then there is room for much experimentation. One can even apply
> things like masking to tables. This then calls for a set of python classes
> for dealing with different table functions and so on.
>
> I'll play with both yours and Steven's solution today and post my verdict!
>
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 16:30, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>
>> Here is another approach:
>>
>> https://gist.github.com/jacobjoaquin/5413575
>>
>> I feel I can reduce this example further, and when I do, I'll include it
>> as an example case with PythonScore. In the meantime, here's the explanation
>> of how it works.
>>
>> Envelope shapes are generated as tables. They are created dynamically in
>> score. Since we don't want tables overwriting tables as they're being
>> played, I created the table_cycler that cycles through a range of table
>> indexes every time a new table is created. In this case, the range is
>> between 100 and 120.
>>
>> table_cycler = cycle(xrange(100, 120))
>>
>> The function that handles this is gen_envelope(). It takes a list of
>> envelope points, and reformats it into a GEN07 "f" event. The args are the
>> same as GEN07, but only the envelope data, as the first 5 "f" event pfields
>> are automatically handled:
>>
>> def gen_envelope(*args):
>>     global table_cycler
>>
>>     table = table_cycler.next()
>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>     score.write(" ".join(str(i) for i in L))
>>     return table
>>
>> That function returns the number of the table generated. So a value
>> between 100 and 120. If you watch the table numbers during a performance,
>> you'll see it cycle through this range.
>>
>> Now, one can pass an arbitrary number of envelope points. The first 5
>> notes in the score demo this explicitly:
>>
>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>
>> For the rest of the piece, it auto-cycles between a frequency pattern and
>> an envelope pattern.
>>
>> Best,
>> Jake
>>
>>
>>
>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>> wrote:
>>>
>>> I'll take a stab at this problem in a bit, but I'm hoping arrays in C6
>>> will support something like the following. To solve the problem you
>>> presented, I think it would require two things. First, the ability to pass
>>> an as a pfield in the score:
>>>
>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>
>>> And then in the score, pass the array in as a list of args for opcodes:
>>>
>>> ienvpoints getarray p6
>>> kenv linseg *ienvpoints
>>>
>>> There may need to be a third step required for scaling the even fields of
>>> the array, though is probably already supported by orchestra loop
>>> statements.
>>>
>>>
>>>
>>>
>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>> <peimankhosravi@gmail.com> wrote:
>>>>
>>>> Thanks very much Steven,
>>>>
>>>> I'm going to have a proper look at the code you posted. My initial
>>>> impression is that this is possibly too convoluted for quick and dirty
>>>> experimentation. I think it should be easier than that. Maybe with array in
>>>> csound6 it will be possible?
>>>>
>>>> Cheers,
>>>> Peiman
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>
>>>>> Hi Peiman,
>>>>>
>>>>> I've done a couple of ways using score generation:
>>>>>
>>>>> 1) For a limited number of articulations, I've added a pfield that is
>>>>> used as an index to choose what envelope to generate
>>>>>
>>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>>>> together with tied-notes.  Essentially, each segment becomes a note.
>>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>>>> used this in pieces (you can check
>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>>>> 8.00" object) and am using this in my current piece to do group
>>>>> glissandi sounds.
>>>>>
>>>>> The setup for instruments for tied-notes can be a bit tricky, but I've
>>>>> got a set of UDO's now that I use together as a template when building
>>>>> instruments that will work with different p-fields given for a note.
>>>>> That's allowed using an instrument with MIDI, by score with 5-fields,
>>>>> or scores with 8-fields.  That in turn has made it nice to work with
>>>>> live, for quick sketching, or for generation.
>>>>>
>>>>> For example, code from my current piece uses:
>>>>>
>>>>> def scoreFunc():
>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>
>>>>>     ampGen = Mask(GaussRandom(),
>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>
>>>>>     return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen),
>>>>> ampGen)
>>>>>
>>>>> score = groupB64A.perform(scoreFunc)
>>>>>
>>>>> The code uses a mix of PMask and some score generating functions to
>>>>> generate a score performance func that groupB64A uses to generate
>>>>> notes like:
>>>>>
>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>>>>
>>>>> If that's of use, I can post some more of the code or create a more
>>>>> isolated example from my piece.
>>>>>
>>>>> Hope that helps!
>>>>> steven
>>>>>
>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>> <peimankhosravi@gmail.com> wrote:
>>>>> > OK, this is very positive. In just one hour last night I managed to
>>>>> > make a
>>>>> > bunch of alien blips and blops using PythonScore. Now for the next
>>>>> > step.
>>>>> >
>>>>> > Say we have a pattern library in python that can be used alongside
>>>>> > PythonScore. It's great for generating score event but what if you
>>>>> > also want
>>>>> > to be able to define a different envelop of arbitrary segments for
>>>>> > each
>>>>> > note? What if you want the envelop function to be generated by a
>>>>> > python
>>>>> > module? Would one use tables for this? Not so elegant I think. What
>>>>> > are the
>>>>> > options? I
>>>>> >
>>>>> > Thanks
>>>>> > P
>>>>> >
>>>>> >
>>>>> >
>>>>> > www.peimankhosravi.co.uk
>>>>> >
>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>> > your email
>>>>> > address in the 'follow' section.
>>>>>
>>>>>
>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>> Discussions of bugs and features can be posted here
>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>> "unsubscribe csound"
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> codehop.com | #code #art #music
>>
>>
>>
>>
>> --
>> codehop.com | #code #art #music
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-04-18 19:38
Frompeiman khosravi
SubjectRe: [Csnd] more python
Steven,

If sample accuracy works with tied instruments in csound6 then your option is a good one!






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 19:36, peiman khosravi <peimankhosravi@gmail.com> wrote:







www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 19:26, Steven Yi <stevenyi@gmail.com> wrote:
Ah, I'm confused, as your original email had:

"Would one use tables for this? Not so elegant I think."

Yes, I should have had "(?)" at the end of that sentence! It seems that if python is doing all the dirty work then it doesn't look too bad! 

I'm playing with your ideas right now actually. The instrument design can get a bit messy but I'll write back in a bit. 

P

so I thought you were looking for options besides tables.  Anyways,
each of these things will have pluses and minuses.  For example, when
I work in Blue, I can start playback in the middle of a texture block.
Because it uses notes, I don't have to worry about rendering from the
beginning of the overall texture, I can just advance through the
score. Using tied notes also means possibilities for altering a
texture in realtime if you have an event generator sending notes to
Csound.  On the other hand, using an envelope as table can make the
instrument design simpler.  (I found Jake's code very easy to
understand and reason through.)  You might run into issues like the
duration of the note affecting the envelope rate, but you can also
work around that.

I guess the important thing though is that you have some options.
Also, you might consider mixing and matching possibilities.  For
example, a lot of the complexity of the instrument code I have has to
do with dealing with different scenarios on how the instrument is
called and the interaction with the orchestral composition library I
use from python/blue.  For your own instruments, you might simplify
things, but you could have an instrument that both responds to tied
notes, articulations, or use a negative articulation to denote an
ftable to read as an envelope.  That'd give you a lot of flexibility
then.

On Thu, Apr 18, 2013 at 6:48 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> This is elegant. Do you know if there is currently a limit to the number of
> table points manually defined in the score?
>
> If not, then there is room for much experimentation. One can even apply
> things like masking to tables. This then calls for a set of python classes
> for dealing with different table functions and so on.
>
> I'll play with both yours and Steven's solution today and post my verdict!
>
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 16:30, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>
>> Here is another approach:
>>
>> https://gist.github.com/jacobjoaquin/5413575
>>
>> I feel I can reduce this example further, and when I do, I'll include it
>> as an example case with PythonScore. In the meantime, here's the explanation
>> of how it works.
>>
>> Envelope shapes are generated as tables. They are created dynamically in
>> score. Since we don't want tables overwriting tables as they're being
>> played, I created the table_cycler that cycles through a range of table
>> indexes every time a new table is created. In this case, the range is
>> between 100 and 120.
>>
>> table_cycler = cycle(xrange(100, 120))
>>
>> The function that handles this is gen_envelope(). It takes a list of
>> envelope points, and reformats it into a GEN07 "f" event. The args are the
>> same as GEN07, but only the envelope data, as the first 5 "f" event pfields
>> are automatically handled:
>>
>> def gen_envelope(*args):
>>     global table_cycler
>>
>>     table = table_cycler.next()
>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>     score.write(" ".join(str(i) for i in L))
>>     return table
>>
>> That function returns the number of the table generated. So a value
>> between 100 and 120. If you watch the table numbers during a performance,
>> you'll see it cycle through this range.
>>
>> Now, one can pass an arbitrary number of envelope points. The first 5
>> notes in the score demo this explicitly:
>>
>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>
>> For the rest of the piece, it auto-cycles between a frequency pattern and
>> an envelope pattern.
>>
>> Best,
>> Jake
>>
>>
>>
>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>> wrote:
>>>
>>> I'll take a stab at this problem in a bit, but I'm hoping arrays in C6
>>> will support something like the following. To solve the problem you
>>> presented, I think it would require two things. First, the ability to pass
>>> an as a pfield in the score:
>>>
>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>
>>> And then in the score, pass the array in as a list of args for opcodes:
>>>
>>> ienvpoints getarray p6
>>> kenv linseg *ienvpoints
>>>
>>> There may need to be a third step required for scaling the even fields of
>>> the array, though is probably already supported by orchestra loop
>>> statements.
>>>
>>>
>>>
>>>
>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>> <peimankhosravi@gmail.com> wrote:
>>>>
>>>> Thanks very much Steven,
>>>>
>>>> I'm going to have a proper look at the code you posted. My initial
>>>> impression is that this is possibly too convoluted for quick and dirty
>>>> experimentation. I think it should be easier than that. Maybe with array in
>>>> csound6 it will be possible?
>>>>
>>>> Cheers,
>>>> Peiman
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>
>>>>> Hi Peiman,
>>>>>
>>>>> I've done a couple of ways using score generation:
>>>>>
>>>>> 1) For a limited number of articulations, I've added a pfield that is
>>>>> used as an index to choose what envelope to generate
>>>>>
>>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>>>> together with tied-notes.  Essentially, each segment becomes a note.
>>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>>>> used this in pieces (you can check
>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>>>> 8.00" object) and am using this in my current piece to do group
>>>>> glissandi sounds.
>>>>>
>>>>> The setup for instruments for tied-notes can be a bit tricky, but I've
>>>>> got a set of UDO's now that I use together as a template when building
>>>>> instruments that will work with different p-fields given for a note.
>>>>> That's allowed using an instrument with MIDI, by score with 5-fields,
>>>>> or scores with 8-fields.  That in turn has made it nice to work with
>>>>> live, for quick sketching, or for generation.
>>>>>
>>>>> For example, code from my current piece uses:
>>>>>
>>>>> def scoreFunc():
>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>
>>>>>     ampGen = Mask(GaussRandom(),
>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>
>>>>>     return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen),
>>>>> ampGen)
>>>>>
>>>>> score = groupB64A.perform(scoreFunc)
>>>>>
>>>>> The code uses a mix of PMask and some score generating functions to
>>>>> generate a score performance func that groupB64A uses to generate
>>>>> notes like:
>>>>>
>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>>>>
>>>>> If that's of use, I can post some more of the code or create a more
>>>>> isolated example from my piece.
>>>>>
>>>>> Hope that helps!
>>>>> steven
>>>>>
>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>> <peimankhosravi@gmail.com> wrote:
>>>>> > OK, this is very positive. In just one hour last night I managed to
>>>>> > make a
>>>>> > bunch of alien blips and blops using PythonScore. Now for the next
>>>>> > step.
>>>>> >
>>>>> > Say we have a pattern library in python that can be used alongside
>>>>> > PythonScore. It's great for generating score event but what if you
>>>>> > also want
>>>>> > to be able to define a different envelop of arbitrary segments for
>>>>> > each
>>>>> > note? What if you want the envelop function to be generated by a
>>>>> > python
>>>>> > module? Would one use tables for this? Not so elegant I think. What
>>>>> > are the
>>>>> > options? I
>>>>> >
>>>>> > Thanks
>>>>> > P
>>>>> >
>>>>> >
>>>>> >
>>>>> > www.peimankhosravi.co.uk
>>>>> >
>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>> > your email
>>>>> > address in the 'follow' section.
>>>>>
>>>>>
>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>> Discussions of bugs and features can be posted here
>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>> "unsubscribe csound"
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> codehop.com | #code #art #music
>>
>>
>>
>>
>> --
>> codehop.com | #code #art #music
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2013-04-18 20:25
FromSteven Yi
SubjectRe: [Csnd] more python
It should be as accurate as what you have set for ksmps, or if using
--sample-accurate in CS6, then you should be good to go regardless of
ksmps (though, I'm not sure if tied notes and sample accurate mode in
CS6 was tested...). Jake's way of using tables is a very good solution
too. I seem to remember a lot of early Music-N pieces doing envelopes
with tables generated in scores, so I think it's an important
technique to know. The use of tables from the score can also be very
handy if you're going to do modulation envelopes, where you might then
loop through the table rather than play it with 1/p3 duration. You'd
could probably implement things like the filter table in Native
Instrument's Massive that way.

On Thu, Apr 18, 2013 at 7:38 PM, peiman khosravi
 wrote:
> Steven,
>
> If sample accuracy works with tied instruments in csound6 then your option
> is a good one!
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 19:36, peiman khosravi  wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>> www.peimankhosravi.co.uk
>>
>> To receive emails about upcoming concerts visit this page & enter your
>> email address in the 'follow' section.
>>
>>
>>
>> On 18 April 2013 19:26, Steven Yi  wrote:
>>>
>>> Ah, I'm confused, as your original email had:
>>>
>>> "Would one use tables for this? Not so elegant I think."
>>
>>
>> Yes, I should have had "(?)" at the end of that sentence! It seems that if
>> python is doing all the dirty work then it doesn't look too bad!
>>
>> I'm playing with your ideas right now actually. The instrument design can
>> get a bit messy but I'll write back in a bit.
>>
>> P
>>>
>>>
>>> so I thought you were looking for options besides tables.  Anyways,
>>> each of these things will have pluses and minuses.  For example, when
>>> I work in Blue, I can start playback in the middle of a texture block.
>>> Because it uses notes, I don't have to worry about rendering from the
>>> beginning of the overall texture, I can just advance through the
>>> score. Using tied notes also means possibilities for altering a
>>> texture in realtime if you have an event generator sending notes to
>>> Csound.  On the other hand, using an envelope as table can make the
>>> instrument design simpler.  (I found Jake's code very easy to
>>> understand and reason through.)  You might run into issues like the
>>> duration of the note affecting the envelope rate, but you can also
>>> work around that.
>>>
>>> I guess the important thing though is that you have some options.
>>> Also, you might consider mixing and matching possibilities.  For
>>> example, a lot of the complexity of the instrument code I have has to
>>> do with dealing with different scenarios on how the instrument is
>>> called and the interaction with the orchestral composition library I
>>> use from python/blue.  For your own instruments, you might simplify
>>> things, but you could have an instrument that both responds to tied
>>> notes, articulations, or use a negative articulation to denote an
>>> ftable to read as an envelope.  That'd give you a lot of flexibility
>>> then.
>>>
>>> On Thu, Apr 18, 2013 at 6:48 PM, peiman khosravi
>>>  wrote:
>>> > This is elegant. Do you know if there is currently a limit to the
>>> > number of
>>> > table points manually defined in the score?
>>> >
>>> > If not, then there is room for much experimentation. One can even apply
>>> > things like masking to tables. This then calls for a set of python
>>> > classes
>>> > for dealing with different table functions and so on.
>>> >
>>> > I'll play with both yours and Steven's solution today and post my
>>> > verdict!
>>> >
>>> > P
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > www.peimankhosravi.co.uk
>>> >
>>> > To receive emails about upcoming concerts visit this page & enter your
>>> > email
>>> > address in the 'follow' section.
>>> >
>>> >
>>> >
>>> > On 18 April 2013 16:30, Jacob Joaquin  wrote:
>>> >>
>>> >> Here is another approach:
>>> >>
>>> >> https://gist.github.com/jacobjoaquin/5413575
>>> >>
>>> >> I feel I can reduce this example further, and when I do, I'll include
>>> >> it
>>> >> as an example case with PythonScore. In the meantime, here's the
>>> >> explanation
>>> >> of how it works.
>>> >>
>>> >> Envelope shapes are generated as tables. They are created dynamically
>>> >> in
>>> >> score. Since we don't want tables overwriting tables as they're being
>>> >> played, I created the table_cycler that cycles through a range of
>>> >> table
>>> >> indexes every time a new table is created. In this case, the range is
>>> >> between 100 and 120.
>>> >>
>>> >> table_cycler = cycle(xrange(100, 120))
>>> >>
>>> >> The function that handles this is gen_envelope(). It takes a list of
>>> >> envelope points, and reformats it into a GEN07 "f" event. The args are
>>> >> the
>>> >> same as GEN07, but only the envelope data, as the first 5 "f" event
>>> >> pfields
>>> >> are automatically handled:
>>> >>
>>> >> def gen_envelope(*args):
>>> >>     global table_cycler
>>> >>
>>> >>     table = table_cycler.next()
>>> >>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>> >>     score.write(" ".join(str(i) for i in L))
>>> >>     return table
>>> >>
>>> >> That function returns the number of the table generated. So a value
>>> >> between 100 and 120. If you watch the table numbers during a
>>> >> performance,
>>> >> you'll see it cycle through this range.
>>> >>
>>> >> Now, one can pass an arbitrary number of envelope points. The first 5
>>> >> notes in the score demo this explicitly:
>>> >>
>>> >> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>>> >> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>>> >> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>> >> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991,
>>> >> 0))
>>> >> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>> >>
>>> >> For the rest of the piece, it auto-cycles between a frequency pattern
>>> >> and
>>> >> an envelope pattern.
>>> >>
>>> >> Best,
>>> >> Jake
>>> >>
>>> >>
>>> >>
>>> >> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>>> >> 
>>> >> wrote:
>>> >>>
>>> >>> I'll take a stab at this problem in a bit, but I'm hoping arrays in
>>> >>> C6
>>> >>> will support something like the following. To solve the problem you
>>> >>> presented, I think it would require two things. First, the ability to
>>> >>> pass
>>> >>> an as a pfield in the score:
>>> >>>
>>> >>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>> >>>
>>> >>> And then in the score, pass the array in as a list of args for
>>> >>> opcodes:
>>> >>>
>>> >>> ienvpoints getarray p6
>>> >>> kenv linseg *ienvpoints
>>> >>>
>>> >>> There may need to be a third step required for scaling the even
>>> >>> fields of
>>> >>> the array, though is probably already supported by orchestra loop
>>> >>> statements.
>>> >>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>> >>>  wrote:
>>> >>>>
>>> >>>> Thanks very much Steven,
>>> >>>>
>>> >>>> I'm going to have a proper look at the code you posted. My initial
>>> >>>> impression is that this is possibly too convoluted for quick and
>>> >>>> dirty
>>> >>>> experimentation. I think it should be easier than that. Maybe with
>>> >>>> array in
>>> >>>> csound6 it will be possible?
>>> >>>>
>>> >>>> Cheers,
>>> >>>> Peiman
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> www.peimankhosravi.co.uk
>>> >>>>
>>> >>>> To receive emails about upcoming concerts visit this page & enter
>>> >>>> your
>>> >>>> email address in the 'follow' section.
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> On 18 April 2013 12:21, Steven Yi  wrote:
>>> >>>>>
>>> >>>>> Hi Peiman,
>>> >>>>>
>>> >>>>> I've done a couple of ways using score generation:
>>> >>>>>
>>> >>>>> 1) For a limited number of articulations, I've added a pfield that
>>> >>>>> is
>>> >>>>> used as an index to choose what envelope to generate
>>> >>>>>
>>> >>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>> >>>>> together with tied-notes.  Essentially, each segment becomes a
>>> >>>>> note.
>>> >>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>> >>>>> used this in pieces (you can check
>>> >>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>> >>>>> 8.00" object) and am using this in my current piece to do group
>>> >>>>> glissandi sounds.
>>> >>>>>
>>> >>>>> The setup for instruments for tied-notes can be a bit tricky, but
>>> >>>>> I've
>>> >>>>> got a set of UDO's now that I use together as a template when
>>> >>>>> building
>>> >>>>> instruments that will work with different p-fields given for a
>>> >>>>> note.
>>> >>>>> That's allowed using an instrument with MIDI, by score with
>>> >>>>> 5-fields,
>>> >>>>> or scores with 8-fields.  That in turn has made it nice to work
>>> >>>>> with
>>> >>>>> live, for quick sketching, or for generation.
>>> >>>>>
>>> >>>>> For example, code from my current piece uses:
>>> >>>>>
>>> >>>>> def scoreFunc():
>>> >>>>>     end = [3,5,7][int(random.random() * 3)]
>>> >>>>>
>>> >>>>>     ampGen = Mask(GaussRandom(),
>>> >>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>> >>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>> >>>>>     pchVarianceGen = Mask(GaussRandom(),
>>> >>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>> >>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>> >>>>>
>>> >>>>>     return createUnstableGroup3(50,
>>> >>>>> PchDeviation(8.00,pchVarianceGen),
>>> >>>>> ampGen)
>>> >>>>>
>>> >>>>> score = groupB64A.perform(scoreFunc)
>>> >>>>>
>>> >>>>> The code uses a mix of PMask and some score generating functions to
>>> >>>>> generate a score performance func that groupB64A uses to generate
>>> >>>>> notes like:
>>> >>>>>
>>> >>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>> >>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>> >>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>> >>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>> >>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>> >>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>> >>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>> >>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>> >>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>> >>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>> >>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>> >>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>> >>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>> >>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>> >>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>> >>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>> >>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>> >>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>> >>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>> >>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>> >>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>> >>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>> >>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>> >>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>> >>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>> >>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>> >>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>> >>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>> >>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>> >>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>> >>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>> >>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>> >>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>> >>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>> >>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>> >>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>> >>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>> >>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>> >>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>> >>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>> >>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>> >>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>> >>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>> >>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>> >>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>> >>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>> >>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>> >>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>> >>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>> >>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>> >>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>> >>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>> >>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>> >>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>> >>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>> >>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>> >>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>> >>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>> >>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>> >>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>> >>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>> >>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>> >>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>> >>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>> >>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>> >>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>> >>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>> >>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>> >>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>> >>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>> >>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>> >>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>> >>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>> >>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>> >>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>> >>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>> >>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>> >>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>> >>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>> >>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>> >>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>> >>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>> >>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>> >>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>> >>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>> >>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>> >>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>> >>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>> >>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>> >>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>> >>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>> >>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>> >>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>> >>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>> >>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>> >>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>> >>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>> >>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>> >>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>> >>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>> >>>>>
>>> >>>>> If that's of use, I can post some more of the code or create a more
>>> >>>>> isolated example from my piece.
>>> >>>>>
>>> >>>>> Hope that helps!
>>> >>>>> steven
>>> >>>>>
>>> >>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>> >>>>>  wrote:
>>> >>>>> > OK, this is very positive. In just one hour last night I managed
>>> >>>>> > to
>>> >>>>> > make a
>>> >>>>> > bunch of alien blips and blops using PythonScore. Now for the
>>> >>>>> > next
>>> >>>>> > step.
>>> >>>>> >
>>> >>>>> > Say we have a pattern library in python that can be used
>>> >>>>> > alongside
>>> >>>>> > PythonScore. It's great for generating score event but what if
>>> >>>>> > you
>>> >>>>> > also want
>>> >>>>> > to be able to define a different envelop of arbitrary segments
>>> >>>>> > for
>>> >>>>> > each
>>> >>>>> > note? What if you want the envelop function to be generated by a
>>> >>>>> > python
>>> >>>>> > module? Would one use tables for this? Not so elegant I think.
>>> >>>>> > What
>>> >>>>> > are the
>>> >>>>> > options? I
>>> >>>>> >
>>> >>>>> > Thanks
>>> >>>>> > P
>>> >>>>> >
>>> >>>>> >
>>> >>>>> >
>>> >>>>> > www.peimankhosravi.co.uk
>>> >>>>> >
>>> >>>>> > To receive emails about upcoming concerts visit this page & enter
>>> >>>>> > your email
>>> >>>>> > address in the 'follow' section.
>>> >>>>>
>>> >>>>>
>>> >>>>> Send bugs reports to the Sourceforge bug tracker
>>> >>>>>
>>> >>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> >>>>> Discussions of bugs and features can be posted here
>>> >>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> >>>>> "unsubscribe csound"
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> codehop.com | #code #art #music
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> codehop.com | #code #art #music
>>> >
>>> >
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>
>

Date2013-04-18 22:52
FromJacob Joaquin
SubjectRe: [Csnd] more python
I cleaned up the example and placed it with the PythonScore examples in the master branch of the CSD module:


The plan is to create/collect lots of examples as a way to start identifying some of the design patterns that Python brings to the score environment. Once enough are collected and we have a sense of good ways of approaching common problems, functions and classes that reside in these examples we'll be pulled out, rewritten if necessary, and placed into modules that come with CSD. The examples will be updated in the process.







On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Here is another approach:


I feel I can reduce this example further, and when I do, I'll include it as an example case with PythonScore. In the meantime, here's the explanation of how it works.

Envelope shapes are generated as tables. They are created dynamically in score. Since we don't want tables overwriting tables as they're being played, I created the table_cycler that cycles through a range of table indexes every time a new table is created. In this case, the range is between 100 and 120.

table_cycler = cycle(xrange(100, 120))

The function that handles this is gen_envelope(). It takes a list of envelope points, and reformats it into a GEN07 "f" event. The args are the same as GEN07, but only the envelope data, as the first 5 "f" event pfields are automatically handled:

def gen_envelope(*args):
    global table_cycler

    table = table_cycler.next()
    L = ["f", table, score.cue.now(), 8192, -7] + list(args)
    score.write(" ".join(str(i) for i in L))
    return table

That function returns the number of the table generated. So a value between 100 and 120. If you watch the table numbers during a performance, you'll see it cycle through this range.

Now, one can pass an arbitrary number of envelope points. The first 5 notes in the score demo this explicitly:

with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))

For the rest of the piece, it auto-cycles between a frequency pattern and an envelope pattern.

Best,
Jake



On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I'll take a stab at this problem in a bit, but I'm hoping arrays in C6 will support something like the following. To solve the problem you presented, I think it would require two things. First, the ability to pass an as a pfield in the score:

i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)

And then in the score, pass the array in as a list of args for opcodes:

ienvpoints getarray p6
kenv linseg *ienvpoints

There may need to be a third step required for scaling the even fields of the array, though is probably already supported by orchestra loop statements.




On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Steven,

I'm going to have a proper look at the code you posted. My initial impression is that this is possibly too convoluted for quick and dirty experimentation. I think it should be easier than that. Maybe with array in csound6 it will be possible?

Cheers,
Peiman  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
codehop.com | #code #art #music



--
codehop.com | #code #art #music



--
codehop.com | #code #art #music

Date2013-04-18 22:58
Frompeiman khosravi
SubjectRe: [Csnd] more python
Thanks, I haven't tried your example yet. That next! Here's my latest. Much more readable. I'm not so suave with python [yet!] so it's probably not the most efficient of doing it.



from csd.pysco import PythonScore
from random import choice

score = PythonScore()
cue = score.cue

score.write('f1 0 8192 10 1')


def note(p1, p2, p3, list):

    type = list.pop(1)

    if "l" in type:
        p7 = 1
    else:
        p7 = 0

    p4 = list.pop(0)
    linseg = list[0:]

    score.i(p1, p2, p3)
    paramName = '"' + p4+"."+str(p1) + '"'


    for i in range(len(linseg)-4):

        if i > 0:
            i = i+1
 
        t1 = linseg[i]
        v1 = linseg[i+1]
        t2 = linseg[i+2]
        v2 = linseg[i+3]

        start = t1
        dur = t2-t1
        point1 = v1
        point2 = v2

        score.i(2, start, dur,paramName, point1, point2, p7)
  

note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])


score.end();








www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I cleaned up the example and placed it with the PythonScore examples in the master branch of the CSD module:


The plan is to create/collect lots of examples as a way to start identifying some of the design patterns that Python brings to the score environment. Once enough are collected and we have a sense of good ways of approaching common problems, functions and classes that reside in these examples we'll be pulled out, rewritten if necessary, and placed into modules that come with CSD. The examples will be updated in the process.







On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Here is another approach:


I feel I can reduce this example further, and when I do, I'll include it as an example case with PythonScore. In the meantime, here's the explanation of how it works.

Envelope shapes are generated as tables. They are created dynamically in score. Since we don't want tables overwriting tables as they're being played, I created the table_cycler that cycles through a range of table indexes every time a new table is created. In this case, the range is between 100 and 120.

table_cycler = cycle(xrange(100, 120))

The function that handles this is gen_envelope(). It takes a list of envelope points, and reformats it into a GEN07 "f" event. The args are the same as GEN07, but only the envelope data, as the first 5 "f" event pfields are automatically handled:

def gen_envelope(*args):
    global table_cycler

    table = table_cycler.next()
    L = ["f", table, score.cue.now(), 8192, -7] + list(args)
    score.write(" ".join(str(i) for i in L))
    return table

That function returns the number of the table generated. So a value between 100 and 120. If you watch the table numbers during a performance, you'll see it cycle through this range.

Now, one can pass an arbitrary number of envelope points. The first 5 notes in the score demo this explicitly:

with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))

For the rest of the piece, it auto-cycles between a frequency pattern and an envelope pattern.

Best,
Jake



On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I'll take a stab at this problem in a bit, but I'm hoping arrays in C6 will support something like the following. To solve the problem you presented, I think it would require two things. First, the ability to pass an as a pfield in the score:

i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)

And then in the score, pass the array in as a list of args for opcodes:

ienvpoints getarray p6
kenv linseg *ienvpoints

There may need to be a third step required for scaling the even fields of the array, though is probably already supported by orchestra loop statements.




On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Steven,

I'm going to have a proper look at the code you posted. My initial impression is that this is possibly too convoluted for quick and dirty experimentation. I think it should be easier than that. Maybe with array in csound6 it will be possible?

Cheers,
Peiman  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
codehop.com | #code #art #music



--
codehop.com | #code #art #music



--
codehop.com | #code #art #music


Date2013-04-18 23:09
FromJacob Joaquin
SubjectRe: [Csnd] more python
Thanks for posting these. I'm definitely reading and running them. Here's an supported featured debugging feature that might help, which will eventually be transformed into an official feature. To see what data is currently in the score object, do this:

for L in score.score_data:
    print L



On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks, I haven't tried your example yet. That next! Here's my latest. Much more readable. I'm not so suave with python [yet!] so it's probably not the most efficient of doing it.



from csd.pysco import PythonScore
from random import choice

score = PythonScore()
cue = score.cue

score.write('f1 0 8192 10 1')


def note(p1, p2, p3, list):

    type = list.pop(1)

    if "l" in type:
        p7 = 1
    else:
        p7 = 0

    p4 = list.pop(0)
    linseg = list[0:]


    score.i(p1, p2, p3)
    paramName = '"' + p4+"."+str(p1) + '"'


    for i in range(len(linseg)-4):

        if i > 0:
            i = i+1
 
        t1 = linseg[i]
        v1 = linseg[i+1]
        t2 = linseg[i+2]
        v2 = linseg[i+3]

        start = t1
        dur = t2-t1
        point1 = v1
        point2 = v2

        score.i(2, start, dur,paramName, point1, point2, p7)
  

note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])


score.end();








www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I cleaned up the example and placed it with the PythonScore examples in the master branch of the CSD module:


The plan is to create/collect lots of examples as a way to start identifying some of the design patterns that Python brings to the score environment. Once enough are collected and we have a sense of good ways of approaching common problems, functions and classes that reside in these examples we'll be pulled out, rewritten if necessary, and placed into modules that come with CSD. The examples will be updated in the process.







On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Here is another approach:


I feel I can reduce this example further, and when I do, I'll include it as an example case with PythonScore. In the meantime, here's the explanation of how it works.

Envelope shapes are generated as tables. They are created dynamically in score. Since we don't want tables overwriting tables as they're being played, I created the table_cycler that cycles through a range of table indexes every time a new table is created. In this case, the range is between 100 and 120.

table_cycler = cycle(xrange(100, 120))

The function that handles this is gen_envelope(). It takes a list of envelope points, and reformats it into a GEN07 "f" event. The args are the same as GEN07, but only the envelope data, as the first 5 "f" event pfields are automatically handled:

def gen_envelope(*args):
    global table_cycler

    table = table_cycler.next()
    L = ["f", table, score.cue.now(), 8192, -7] + list(args)
    score.write(" ".join(str(i) for i in L))
    return table

That function returns the number of the table generated. So a value between 100 and 120. If you watch the table numbers during a performance, you'll see it cycle through this range.

Now, one can pass an arbitrary number of envelope points. The first 5 notes in the score demo this explicitly:

with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))

For the rest of the piece, it auto-cycles between a frequency pattern and an envelope pattern.

Best,
Jake



On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I'll take a stab at this problem in a bit, but I'm hoping arrays in C6 will support something like the following. To solve the problem you presented, I think it would require two things. First, the ability to pass an as a pfield in the score:

i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)

And then in the score, pass the array in as a list of args for opcodes:

ienvpoints getarray p6
kenv linseg *ienvpoints

There may need to be a third step required for scaling the even fields of the array, though is probably already supported by orchestra loop statements.




On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Steven,

I'm going to have a proper look at the code you posted. My initial impression is that this is possibly too convoluted for quick and dirty experimentation. I think it should be easier than that. Maybe with array in csound6 it will be possible?

Cheers,
Peiman  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
codehop.com | #code #art #music



--
codehop.com | #code #art #music



--
codehop.com | #code #art #music




--
codehop.com | #code #art #music

Date2013-04-18 23:25
Frompeiman khosravi
SubjectRe: [Csnd] more python
No thank you and Steven for all your comments and contributions.

I've had enough of staring at the computer tonight. Here's the latest function I came up with.

Best,
P



from csd.pysco import PythonScore
from random import choice

score = PythonScore()
cue = score.cue

score.write('f1 0 8192 10 1')

def parameter(p1, name, type, envelope):

    if "l" in type:
        p7 = 1
    else:
        p7 = 0

    p4 = name
    linseg = envelope
    paramName = '"' + p4+"."+str(p1) + '"'

    for i in range(len(linseg)-4):

        if i > 0:
            i = i+1
 
        t1 = linseg[i]
        v1 = linseg[i+1]
        t2 = linseg[i+2]
        v2 = linseg[i+3]
        start = t1
        dur = t2-t1
        point1 = v1
        point2 = v2

        score.i(2, start, dur,paramName, point1, point2, p7)
  

score.i(3.1, 0, 10)
parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])



score.end();

 






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Thanks for posting these. I'm definitely reading and running them. Here's an supported featured debugging feature that might help, which will eventually be transformed into an official feature. To see what data is currently in the score object, do this:

for L in score.score_data:
    print L



On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks, I haven't tried your example yet. That next! Here's my latest. Much more readable. I'm not so suave with python [yet!] so it's probably not the most efficient of doing it.



from csd.pysco import PythonScore
from random import choice

score = PythonScore()
cue = score.cue

score.write('f1 0 8192 10 1')


def note(p1, p2, p3, list):

    type = list.pop(1)

    if "l" in type:
        p7 = 1
    else:
        p7 = 0

    p4 = list.pop(0)
    linseg = list[0:]


    score.i(p1, p2, p3)
    paramName = '"' + p4+"."+str(p1) + '"'


    for i in range(len(linseg)-4):

        if i > 0:
            i = i+1
 
        t1 = linseg[i]
        v1 = linseg[i+1]
        t2 = linseg[i+2]
        v2 = linseg[i+3]

        start = t1
        dur = t2-t1
        point1 = v1
        point2 = v2

        score.i(2, start, dur,paramName, point1, point2, p7)
  

note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])


score.end();








www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I cleaned up the example and placed it with the PythonScore examples in the master branch of the CSD module:


The plan is to create/collect lots of examples as a way to start identifying some of the design patterns that Python brings to the score environment. Once enough are collected and we have a sense of good ways of approaching common problems, functions and classes that reside in these examples we'll be pulled out, rewritten if necessary, and placed into modules that come with CSD. The examples will be updated in the process.







On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Here is another approach:


I feel I can reduce this example further, and when I do, I'll include it as an example case with PythonScore. In the meantime, here's the explanation of how it works.

Envelope shapes are generated as tables. They are created dynamically in score. Since we don't want tables overwriting tables as they're being played, I created the table_cycler that cycles through a range of table indexes every time a new table is created. In this case, the range is between 100 and 120.

table_cycler = cycle(xrange(100, 120))

The function that handles this is gen_envelope(). It takes a list of envelope points, and reformats it into a GEN07 "f" event. The args are the same as GEN07, but only the envelope data, as the first 5 "f" event pfields are automatically handled:

def gen_envelope(*args):
    global table_cycler

    table = table_cycler.next()
    L = ["f", table, score.cue.now(), 8192, -7] + list(args)
    score.write(" ".join(str(i) for i in L))
    return table

That function returns the number of the table generated. So a value between 100 and 120. If you watch the table numbers during a performance, you'll see it cycle through this range.

Now, one can pass an arbitrary number of envelope points. The first 5 notes in the score demo this explicitly:

with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991, 0))
with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))

For the rest of the piece, it auto-cycles between a frequency pattern and an envelope pattern.

Best,
Jake



On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I'll take a stab at this problem in a bit, but I'm hoping arrays in C6 will support something like the following. To solve the problem you presented, I think it would require two things. First, the ability to pass an as a pfield in the score:

i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)

And then in the score, pass the array in as a list of args for opcodes:

ienvpoints getarray p6
kenv linseg *ienvpoints

There may need to be a third step required for scaling the even fields of the array, though is probably already supported by orchestra loop statements.




On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks very much Steven,

I'm going to have a proper look at the code you posted. My initial impression is that this is possibly too convoluted for quick and dirty experimentation. I think it should be easier than that. Maybe with array in csound6 it will be possible?

Cheers,
Peiman  






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I've done a couple of ways using score generation:

1) For a limited number of articulations, I've added a pfield that is
used as an index to choose what envelope to generate

2) For arbitrary segments, I use fractional instrument numbers
together with tied-notes.  Essentially, each segment becomes a note.
Using fractional instr numbers allows for polyphonic streams.  I've
used this in pieces (you can check
blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
8.00" object) and am using this in my current piece to do group
glissandi sounds.

The setup for instruments for tied-notes can be a bit tricky, but I've
got a set of UDO's now that I use together as a template when building
instruments that will work with different p-fields given for a note.
That's allowed using an instrument with MIDI, by score with 5-fields,
or scores with 8-fields.  That in turn has made it nice to work with
live, for quick sketching, or for generation.

For example, code from my current piece uses:

def scoreFunc():
    end = [3,5,7][int(random.random() * 3)]

    ampGen = Mask(GaussRandom(),
         LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
         LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
    pchVarianceGen = Mask(GaussRandom(),
        LinearSegment([(0,.01), (4,7), (6,end)]),
        LinearSegment([(0,0), (4,3), (6,end -.09)]))

    return createUnstableGroup3(50, PchDeviation(8.00,pchVarianceGen), ampGen)

score = groupB64A.perform(scoreFunc)

The code uses a mix of PMask and some score generating functions to
generate a score performance func that groupB64A uses to generate
notes like:

i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3

If that's of use, I can post some more of the code or create a more
isolated example from my piece.

Hope that helps!
steven

On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> OK, this is very positive. In just one hour last night I managed to make a
> bunch of alien blips and blops using PythonScore. Now for the next step.
>
> Say we have a pattern library in python that can be used alongside
> PythonScore. It's great for generating score event but what if you also want
> to be able to define a different envelop of arbitrary segments for each
> note? What if you want the envelop function to be generated by a python
> module? Would one use tables for this? Not so elegant I think. What are the
> options? I
>
> Thanks
> P
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
codehop.com | #code #art #music



--
codehop.com | #code #art #music



--
codehop.com | #code #art #music




--
codehop.com | #code #art #music


Date2013-04-18 23:45
FromSteven Yi
SubjectRe: [Csnd] more python
Hi Peiman,

Thought I'd mention, you may want to consider using formatting strings
[1] to modify:

    paramName = '"' + p4+"."+str(p1) + '"'

to:

    paramName = '"%s.%g"'%(p4, p1)

You may also want to use list slicing  [2] with multiple assignment
[2] to do something like this:

t1, v1, t2, v2 = linseg[i:i+4]

String formatting is good to know as you can get a lot of control
about the string formatting, and the template string can be easier to
use and understand, especially when using a lot of replacement values.
 List slicing and multiple assignment are also handy syntax sugar to
write more terser code.

Hope that's useful!
steven

[1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
[2] http://docs.python.org/2/tutorial/introduction.html

On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
 wrote:
> No thank you and Steven for all your comments and contributions.
>
> I've had enough of staring at the computer tonight. Here's the latest
> function I came up with.
>
> Best,
> P
>
>
>
> from csd.pysco import PythonScore
> from random import choice
>
> score = PythonScore()
> cue = score.cue
>
> score.write('f1 0 8192 10 1')
>
> def parameter(p1, name, type, envelope):
>
>
>     if "l" in type:
>         p7 = 1
>     else:
>         p7 = 0
>
>     p4 = name
>     linseg = envelope
>
>     paramName = '"' + p4+"."+str(p1) + '"'
>
>     for i in range(len(linseg)-4):
>
>         if i > 0:
>             i = i+1
>
>         t1 = linseg[i]
>         v1 = linseg[i+1]
>         t2 = linseg[i+2]
>         v2 = linseg[i+3]
>         start = t1
>         dur = t2-t1
>         point1 = v1
>         point2 = v2
>
>         score.i(2, start, dur,paramName, point1, point2, p7)
>
>
> score.i(3.1, 0, 10)
> parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>
>
>
> score.end();
>
>
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 23:09, Jacob Joaquin  wrote:
>>
>> Thanks for posting these. I'm definitely reading and running them. Here's
>> an supported featured debugging feature that might help, which will
>> eventually be transformed into an official feature. To see what data is
>> currently in the score object, do this:
>>
>> for L in score.score_data:
>>     print L
>>
>>
>>
>> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>>  wrote:
>>>
>>> Thanks, I haven't tried your example yet. That next! Here's my latest.
>>> Much more readable. I'm not so suave with python [yet!] so it's probably not
>>> the most efficient of doing it.
>>>
>>>
>>>
>>> from csd.pysco import PythonScore
>>> from random import choice
>>>
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 8192 10 1')
>>>
>>>
>>> def note(p1, p2, p3, list):
>>>
>>>     type = list.pop(1)
>>>
>>>     if "l" in type:
>>>         p7 = 1
>>>     else:
>>>         p7 = 0
>>>
>>>     p4 = list.pop(0)
>>>     linseg = list[0:]
>>>
>>>
>>>     score.i(p1, p2, p3)
>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>
>>>
>>>     for i in range(len(linseg)-4):
>>>
>>>         if i > 0:
>>>             i = i+1
>>>
>>>         t1 = linseg[i]
>>>         v1 = linseg[i+1]
>>>         t2 = linseg[i+2]
>>>         v2 = linseg[i+3]
>>>
>>>         start = t1
>>>         dur = t2-t1
>>>         point1 = v1
>>>         point2 = v2
>>>
>>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>
>>>
>>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>
>>>
>>> score.end();
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 18 April 2013 22:52, Jacob Joaquin  wrote:
>>>>
>>>> I cleaned up the example and placed it with the PythonScore examples in
>>>> the master branch of the CSD module:
>>>>
>>>>
>>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>
>>>> The plan is to create/collect lots of examples as a way to start
>>>> identifying some of the design patterns that Python brings to the score
>>>> environment. Once enough are collected and we have a sense of good ways of
>>>> approaching common problems, functions and classes that reside in these
>>>> examples we'll be pulled out, rewritten if necessary, and placed into
>>>> modules that come with CSD. The examples will be updated in the process.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin 
>>>> wrote:
>>>>>
>>>>> Here is another approach:
>>>>>
>>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>
>>>>> I feel I can reduce this example further, and when I do, I'll include
>>>>> it as an example case with PythonScore. In the meantime, here's the
>>>>> explanation of how it works.
>>>>>
>>>>> Envelope shapes are generated as tables. They are created dynamically
>>>>> in score. Since we don't want tables overwriting tables as they're being
>>>>> played, I created the table_cycler that cycles through a range of table
>>>>> indexes every time a new table is created. In this case, the range is
>>>>> between 100 and 120.
>>>>>
>>>>> table_cycler = cycle(xrange(100, 120))
>>>>>
>>>>> The function that handles this is gen_envelope(). It takes a list of
>>>>> envelope points, and reformats it into a GEN07 "f" event. The args are the
>>>>> same as GEN07, but only the envelope data, as the first 5 "f" event pfields
>>>>> are automatically handled:
>>>>>
>>>>> def gen_envelope(*args):
>>>>>     global table_cycler
>>>>>
>>>>>     table = table_cycler.next()
>>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>     score.write(" ".join(str(i) for i in L))
>>>>>     return table
>>>>>
>>>>> That function returns the number of the table generated. So a value
>>>>> between 100 and 120. If you watch the table numbers during a performance,
>>>>> you'll see it cycle through this range.
>>>>>
>>>>> Now, one can pass an arbitrary number of envelope points. The first 5
>>>>> notes in the score demo this explicitly:
>>>>>
>>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991,
>>>>> 0))
>>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>>>>
>>>>> For the rest of the piece, it auto-cycles between a frequency pattern
>>>>> and an envelope pattern.
>>>>>
>>>>> Best,
>>>>> Jake
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin 
>>>>> wrote:
>>>>>>
>>>>>> I'll take a stab at this problem in a bit, but I'm hoping arrays in C6
>>>>>> will support something like the following. To solve the problem you
>>>>>> presented, I think it would require two things. First, the ability to pass
>>>>>> an as a pfield in the score:
>>>>>>
>>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>>
>>>>>> And then in the score, pass the array in as a list of args for
>>>>>> opcodes:
>>>>>>
>>>>>> ienvpoints getarray p6
>>>>>> kenv linseg *ienvpoints
>>>>>>
>>>>>> There may need to be a third step required for scaling the even fields
>>>>>> of the array, though is probably already supported by orchestra loop
>>>>>> statements.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>>  wrote:
>>>>>>>
>>>>>>> Thanks very much Steven,
>>>>>>>
>>>>>>> I'm going to have a proper look at the code you posted. My initial
>>>>>>> impression is that this is possibly too convoluted for quick and dirty
>>>>>>> experimentation. I think it should be easier than that. Maybe with array in
>>>>>>> csound6 it will be possible?
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Peiman
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> www.peimankhosravi.co.uk
>>>>>>>
>>>>>>> To receive emails about upcoming concerts visit this page & enter
>>>>>>> your email address in the 'follow' section.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 18 April 2013 12:21, Steven Yi  wrote:
>>>>>>>>
>>>>>>>> Hi Peiman,
>>>>>>>>
>>>>>>>> I've done a couple of ways using score generation:
>>>>>>>>
>>>>>>>> 1) For a limited number of articulations, I've added a pfield that
>>>>>>>> is
>>>>>>>> used as an index to choose what envelope to generate
>>>>>>>>
>>>>>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>>>>>>> together with tied-notes.  Essentially, each segment becomes a note.
>>>>>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>>>>>>> used this in pieces (you can check
>>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>>>>>>> 8.00" object) and am using this in my current piece to do group
>>>>>>>> glissandi sounds.
>>>>>>>>
>>>>>>>> The setup for instruments for tied-notes can be a bit tricky, but
>>>>>>>> I've
>>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>>>> building
>>>>>>>> instruments that will work with different p-fields given for a note.
>>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>>>> 5-fields,
>>>>>>>> or scores with 8-fields.  That in turn has made it nice to work with
>>>>>>>> live, for quick sketching, or for generation.
>>>>>>>>
>>>>>>>> For example, code from my current piece uses:
>>>>>>>>
>>>>>>>> def scoreFunc():
>>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>>>>
>>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>>>>
>>>>>>>>     return createUnstableGroup3(50,
>>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>>>>
>>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>>>>
>>>>>>>> The code uses a mix of PMask and some score generating functions to
>>>>>>>> generate a score performance func that groupB64A uses to generate
>>>>>>>> notes like:
>>>>>>>>
>>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>>>>>>>
>>>>>>>> If that's of use, I can post some more of the code or create a more
>>>>>>>> isolated example from my piece.
>>>>>>>>
>>>>>>>> Hope that helps!
>>>>>>>> steven
>>>>>>>>
>>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>>>>  wrote:
>>>>>>>> > OK, this is very positive. In just one hour last night I managed
>>>>>>>> > to make a
>>>>>>>> > bunch of alien blips and blops using PythonScore. Now for the next
>>>>>>>> > step.
>>>>>>>> >
>>>>>>>> > Say we have a pattern library in python that can be used alongside
>>>>>>>> > PythonScore. It's great for generating score event but what if you
>>>>>>>> > also want
>>>>>>>> > to be able to define a different envelop of arbitrary segments for
>>>>>>>> > each
>>>>>>>> > note? What if you want the envelop function to be generated by a
>>>>>>>> > python
>>>>>>>> > module? Would one use tables for this? Not so elegant I think.
>>>>>>>> > What are the
>>>>>>>> > options? I
>>>>>>>> >
>>>>>>>> > Thanks
>>>>>>>> > P
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > www.peimankhosravi.co.uk
>>>>>>>> >
>>>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>>>> > your email
>>>>>>>> > address in the 'follow' section.
>>>>>>>>
>>>>>>>>
>>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>>>
>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>>>> "unsubscribe csound"
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> codehop.com | #code #art #music
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> codehop.com | #code #art #music
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> codehop.com | #code #art #music
>>>
>>>
>>
>>
>>
>> --
>> codehop.com | #code #art #music
>
>

Date2013-04-19 00:07
Frompeiman khosravi
SubjectRe: [Csnd] more python
Thanks Steven,

I really appreciate that. Super useful!

All the best,
Peiman







www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Thought I'd mention, you may want to consider using formatting strings
[1] to modify:

    paramName = '"' + p4+"."+str(p1) + '"'

to:

    paramName = '"%s.%g"'%(p4, p1)

You may also want to use list slicing  [2] with multiple assignment
[2] to do something like this:

t1, v1, t2, v2 = linseg[i:i+4]

String formatting is good to know as you can get a lot of control
about the string formatting, and the template string can be easier to
use and understand, especially when using a lot of replacement values.
 List slicing and multiple assignment are also handy syntax sugar to
write more terser code.

Hope that's useful!
steven

[1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
[2] http://docs.python.org/2/tutorial/introduction.html

On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> No thank you and Steven for all your comments and contributions.
>
> I've had enough of staring at the computer tonight. Here's the latest
> function I came up with.
>
> Best,
> P
>
>
>
> from csd.pysco import PythonScore
> from random import choice
>
> score = PythonScore()
> cue = score.cue
>
> score.write('f1 0 8192 10 1')
>
> def parameter(p1, name, type, envelope):
>
>
>     if "l" in type:
>         p7 = 1
>     else:
>         p7 = 0
>
>     p4 = name
>     linseg = envelope
>
>     paramName = '"' + p4+"."+str(p1) + '"'
>
>     for i in range(len(linseg)-4):
>
>         if i > 0:
>             i = i+1
>
>         t1 = linseg[i]
>         v1 = linseg[i+1]
>         t2 = linseg[i+2]
>         v2 = linseg[i+3]
>         start = t1
>         dur = t2-t1
>         point1 = v1
>         point2 = v2
>
>         score.i(2, start, dur,paramName, point1, point2, p7)
>
>
> score.i(3.1, 0, 10)
> parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>
>
>
> score.end();
>
>
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>
>> Thanks for posting these. I'm definitely reading and running them. Here's
>> an supported featured debugging feature that might help, which will
>> eventually be transformed into an official feature. To see what data is
>> currently in the score object, do this:
>>
>> for L in score.score_data:
>>     print L
>>
>>
>>
>> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>>>
>>> Thanks, I haven't tried your example yet. That next! Here's my latest.
>>> Much more readable. I'm not so suave with python [yet!] so it's probably not
>>> the most efficient of doing it.
>>>
>>>
>>>
>>> from csd.pysco import PythonScore
>>> from random import choice
>>>
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 8192 10 1')
>>>
>>>
>>> def note(p1, p2, p3, list):
>>>
>>>     type = list.pop(1)
>>>
>>>     if "l" in type:
>>>         p7 = 1
>>>     else:
>>>         p7 = 0
>>>
>>>     p4 = list.pop(0)
>>>     linseg = list[0:]
>>>
>>>
>>>     score.i(p1, p2, p3)
>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>
>>>
>>>     for i in range(len(linseg)-4):
>>>
>>>         if i > 0:
>>>             i = i+1
>>>
>>>         t1 = linseg[i]
>>>         v1 = linseg[i+1]
>>>         t2 = linseg[i+2]
>>>         v2 = linseg[i+3]
>>>
>>>         start = t1
>>>         dur = t2-t1
>>>         point1 = v1
>>>         point2 = v2
>>>
>>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>
>>>
>>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>
>>>
>>> score.end();
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>>>
>>>> I cleaned up the example and placed it with the PythonScore examples in
>>>> the master branch of the CSD module:
>>>>
>>>>
>>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>
>>>> The plan is to create/collect lots of examples as a way to start
>>>> identifying some of the design patterns that Python brings to the score
>>>> environment. Once enough are collected and we have a sense of good ways of
>>>> approaching common problems, functions and classes that reside in these
>>>> examples we'll be pulled out, rewritten if necessary, and placed into
>>>> modules that come with CSD. The examples will be updated in the process.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>> wrote:
>>>>>
>>>>> Here is another approach:
>>>>>
>>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>
>>>>> I feel I can reduce this example further, and when I do, I'll include
>>>>> it as an example case with PythonScore. In the meantime, here's the
>>>>> explanation of how it works.
>>>>>
>>>>> Envelope shapes are generated as tables. They are created dynamically
>>>>> in score. Since we don't want tables overwriting tables as they're being
>>>>> played, I created the table_cycler that cycles through a range of table
>>>>> indexes every time a new table is created. In this case, the range is
>>>>> between 100 and 120.
>>>>>
>>>>> table_cycler = cycle(xrange(100, 120))
>>>>>
>>>>> The function that handles this is gen_envelope(). It takes a list of
>>>>> envelope points, and reformats it into a GEN07 "f" event. The args are the
>>>>> same as GEN07, but only the envelope data, as the first 5 "f" event pfields
>>>>> are automatically handled:
>>>>>
>>>>> def gen_envelope(*args):
>>>>>     global table_cycler
>>>>>
>>>>>     table = table_cycler.next()
>>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>     score.write(" ".join(str(i) for i in L))
>>>>>     return table
>>>>>
>>>>> That function returns the number of the table generated. So a value
>>>>> between 100 and 120. If you watch the table numbers during a performance,
>>>>> you'll see it cycle through this range.
>>>>>
>>>>> Now, one can pass an arbitrary number of envelope points. The first 5
>>>>> notes in the score demo this explicitly:
>>>>>
>>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991,
>>>>> 0))
>>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>>>>
>>>>> For the rest of the piece, it auto-cycles between a frequency pattern
>>>>> and an envelope pattern.
>>>>>
>>>>> Best,
>>>>> Jake
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> I'll take a stab at this problem in a bit, but I'm hoping arrays in C6
>>>>>> will support something like the following. To solve the problem you
>>>>>> presented, I think it would require two things. First, the ability to pass
>>>>>> an as a pfield in the score:
>>>>>>
>>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>>
>>>>>> And then in the score, pass the array in as a list of args for
>>>>>> opcodes:
>>>>>>
>>>>>> ienvpoints getarray p6
>>>>>> kenv linseg *ienvpoints
>>>>>>
>>>>>> There may need to be a third step required for scaling the even fields
>>>>>> of the array, though is probably already supported by orchestra loop
>>>>>> statements.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>
>>>>>>> Thanks very much Steven,
>>>>>>>
>>>>>>> I'm going to have a proper look at the code you posted. My initial
>>>>>>> impression is that this is possibly too convoluted for quick and dirty
>>>>>>> experimentation. I think it should be easier than that. Maybe with array in
>>>>>>> csound6 it will be possible?
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Peiman
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> www.peimankhosravi.co.uk
>>>>>>>
>>>>>>> To receive emails about upcoming concerts visit this page & enter
>>>>>>> your email address in the 'follow' section.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi Peiman,
>>>>>>>>
>>>>>>>> I've done a couple of ways using score generation:
>>>>>>>>
>>>>>>>> 1) For a limited number of articulations, I've added a pfield that
>>>>>>>> is
>>>>>>>> used as an index to choose what envelope to generate
>>>>>>>>
>>>>>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>>>>>>> together with tied-notes.  Essentially, each segment becomes a note.
>>>>>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>>>>>>> used this in pieces (you can check
>>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>>>>>>> 8.00" object) and am using this in my current piece to do group
>>>>>>>> glissandi sounds.
>>>>>>>>
>>>>>>>> The setup for instruments for tied-notes can be a bit tricky, but
>>>>>>>> I've
>>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>>>> building
>>>>>>>> instruments that will work with different p-fields given for a note.
>>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>>>> 5-fields,
>>>>>>>> or scores with 8-fields.  That in turn has made it nice to work with
>>>>>>>> live, for quick sketching, or for generation.
>>>>>>>>
>>>>>>>> For example, code from my current piece uses:
>>>>>>>>
>>>>>>>> def scoreFunc():
>>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>>>>
>>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>>>>
>>>>>>>>     return createUnstableGroup3(50,
>>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>>>>
>>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>>>>
>>>>>>>> The code uses a mix of PMask and some score generating functions to
>>>>>>>> generate a score performance func that groupB64A uses to generate
>>>>>>>> notes like:
>>>>>>>>
>>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>>>>>>>
>>>>>>>> If that's of use, I can post some more of the code or create a more
>>>>>>>> isolated example from my piece.
>>>>>>>>
>>>>>>>> Hope that helps!
>>>>>>>> steven
>>>>>>>>
>>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>> > OK, this is very positive. In just one hour last night I managed
>>>>>>>> > to make a
>>>>>>>> > bunch of alien blips and blops using PythonScore. Now for the next
>>>>>>>> > step.
>>>>>>>> >
>>>>>>>> > Say we have a pattern library in python that can be used alongside
>>>>>>>> > PythonScore. It's great for generating score event but what if you
>>>>>>>> > also want
>>>>>>>> > to be able to define a different envelop of arbitrary segments for
>>>>>>>> > each
>>>>>>>> > note? What if you want the envelop function to be generated by a
>>>>>>>> > python
>>>>>>>> > module? Would one use tables for this? Not so elegant I think.
>>>>>>>> > What are the
>>>>>>>> > options? I
>>>>>>>> >
>>>>>>>> > Thanks
>>>>>>>> > P
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > www.peimankhosravi.co.uk
>>>>>>>> >
>>>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>>>> > your email
>>>>>>>> > address in the 'follow' section.
>>>>>>>>
>>>>>>>>
>>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>>>
>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>>>> "unsubscribe csound"
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> codehop.com | #code #art #music
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> codehop.com | #code #art #music
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> codehop.com | #code #art #music
>>>
>>>
>>
>>
>>
>> --
>> codehop.com | #code #art #music
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-04-19 01:17
Frompeiman khosravi
SubjectRe: [Csnd] more python
AttachmentspythonAutomation.csd  
In fact what I had was also stupid on so many other levels! This is the corrected one (attached). Also added amplitude automation.











www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Steven,

I really appreciate that. Super useful!

All the best,
Peiman







www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Thought I'd mention, you may want to consider using formatting strings
[1] to modify:

    paramName = '"' + p4+"."+str(p1) + '"'

to:

    paramName = '"%s.%g"'%(p4, p1)

You may also want to use list slicing  [2] with multiple assignment
[2] to do something like this:

t1, v1, t2, v2 = linseg[i:i+4]

String formatting is good to know as you can get a lot of control
about the string formatting, and the template string can be easier to
use and understand, especially when using a lot of replacement values.
 List slicing and multiple assignment are also handy syntax sugar to
write more terser code.

Hope that's useful!
steven

[1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
[2] http://docs.python.org/2/tutorial/introduction.html

On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> No thank you and Steven for all your comments and contributions.
>
> I've had enough of staring at the computer tonight. Here's the latest
> function I came up with.
>
> Best,
> P
>
>
>
> from csd.pysco import PythonScore
> from random import choice
>
> score = PythonScore()
> cue = score.cue
>
> score.write('f1 0 8192 10 1')
>
> def parameter(p1, name, type, envelope):
>
>
>     if "l" in type:
>         p7 = 1
>     else:
>         p7 = 0
>
>     p4 = name
>     linseg = envelope
>
>     paramName = '"' + p4+"."+str(p1) + '"'
>
>     for i in range(len(linseg)-4):
>
>         if i > 0:
>             i = i+1
>
>         t1 = linseg[i]
>         v1 = linseg[i+1]
>         t2 = linseg[i+2]
>         v2 = linseg[i+3]
>         start = t1
>         dur = t2-t1
>         point1 = v1
>         point2 = v2
>
>         score.i(2, start, dur,paramName, point1, point2, p7)
>
>
> score.i(3.1, 0, 10)
> parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>
>
>
> score.end();
>
>
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>
>> Thanks for posting these. I'm definitely reading and running them. Here's
>> an supported featured debugging feature that might help, which will
>> eventually be transformed into an official feature. To see what data is
>> currently in the score object, do this:
>>
>> for L in score.score_data:
>>     print L
>>
>>
>>
>> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>>>
>>> Thanks, I haven't tried your example yet. That next! Here's my latest.
>>> Much more readable. I'm not so suave with python [yet!] so it's probably not
>>> the most efficient of doing it.
>>>
>>>
>>>
>>> from csd.pysco import PythonScore
>>> from random import choice
>>>
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 8192 10 1')
>>>
>>>
>>> def note(p1, p2, p3, list):
>>>
>>>     type = list.pop(1)
>>>
>>>     if "l" in type:
>>>         p7 = 1
>>>     else:
>>>         p7 = 0
>>>
>>>     p4 = list.pop(0)
>>>     linseg = list[0:]
>>>
>>>
>>>     score.i(p1, p2, p3)
>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>
>>>
>>>     for i in range(len(linseg)-4):
>>>
>>>         if i > 0:
>>>             i = i+1
>>>
>>>         t1 = linseg[i]
>>>         v1 = linseg[i+1]
>>>         t2 = linseg[i+2]
>>>         v2 = linseg[i+3]
>>>
>>>         start = t1
>>>         dur = t2-t1
>>>         point1 = v1
>>>         point2 = v2
>>>
>>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>
>>>
>>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>
>>>
>>> score.end();
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>>>
>>>> I cleaned up the example and placed it with the PythonScore examples in
>>>> the master branch of the CSD module:
>>>>
>>>>
>>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>
>>>> The plan is to create/collect lots of examples as a way to start
>>>> identifying some of the design patterns that Python brings to the score
>>>> environment. Once enough are collected and we have a sense of good ways of
>>>> approaching common problems, functions and classes that reside in these
>>>> examples we'll be pulled out, rewritten if necessary, and placed into
>>>> modules that come with CSD. The examples will be updated in the process.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>> wrote:
>>>>>
>>>>> Here is another approach:
>>>>>
>>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>
>>>>> I feel I can reduce this example further, and when I do, I'll include
>>>>> it as an example case with PythonScore. In the meantime, here's the
>>>>> explanation of how it works.
>>>>>
>>>>> Envelope shapes are generated as tables. They are created dynamically
>>>>> in score. Since we don't want tables overwriting tables as they're being
>>>>> played, I created the table_cycler that cycles through a range of table
>>>>> indexes every time a new table is created. In this case, the range is
>>>>> between 100 and 120.
>>>>>
>>>>> table_cycler = cycle(xrange(100, 120))
>>>>>
>>>>> The function that handles this is gen_envelope(). It takes a list of
>>>>> envelope points, and reformats it into a GEN07 "f" event. The args are the
>>>>> same as GEN07, but only the envelope data, as the first 5 "f" event pfields
>>>>> are automatically handled:
>>>>>
>>>>> def gen_envelope(*args):
>>>>>     global table_cycler
>>>>>
>>>>>     table = table_cycler.next()
>>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>     score.write(" ".join(str(i) for i in L))
>>>>>     return table
>>>>>
>>>>> That function returns the number of the table generated. So a value
>>>>> between 100 and 120. If you watch the table numbers during a performance,
>>>>> you'll see it cycle through this range.
>>>>>
>>>>> Now, one can pass an arbitrary number of envelope points. The first 5
>>>>> notes in the score demo this explicitly:
>>>>>
>>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991,
>>>>> 0))
>>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>>>>
>>>>> For the rest of the piece, it auto-cycles between a frequency pattern
>>>>> and an envelope pattern.
>>>>>
>>>>> Best,
>>>>> Jake
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> I'll take a stab at this problem in a bit, but I'm hoping arrays in C6
>>>>>> will support something like the following. To solve the problem you
>>>>>> presented, I think it would require two things. First, the ability to pass
>>>>>> an as a pfield in the score:
>>>>>>
>>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>>
>>>>>> And then in the score, pass the array in as a list of args for
>>>>>> opcodes:
>>>>>>
>>>>>> ienvpoints getarray p6
>>>>>> kenv linseg *ienvpoints
>>>>>>
>>>>>> There may need to be a third step required for scaling the even fields
>>>>>> of the array, though is probably already supported by orchestra loop
>>>>>> statements.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>
>>>>>>> Thanks very much Steven,
>>>>>>>
>>>>>>> I'm going to have a proper look at the code you posted. My initial
>>>>>>> impression is that this is possibly too convoluted for quick and dirty
>>>>>>> experimentation. I think it should be easier than that. Maybe with array in
>>>>>>> csound6 it will be possible?
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Peiman
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> www.peimankhosravi.co.uk
>>>>>>>
>>>>>>> To receive emails about upcoming concerts visit this page & enter
>>>>>>> your email address in the 'follow' section.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi Peiman,
>>>>>>>>
>>>>>>>> I've done a couple of ways using score generation:
>>>>>>>>
>>>>>>>> 1) For a limited number of articulations, I've added a pfield that
>>>>>>>> is
>>>>>>>> used as an index to choose what envelope to generate
>>>>>>>>
>>>>>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>>>>>>> together with tied-notes.  Essentially, each segment becomes a note.
>>>>>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>>>>>>> used this in pieces (you can check
>>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>>>>>>> 8.00" object) and am using this in my current piece to do group
>>>>>>>> glissandi sounds.
>>>>>>>>
>>>>>>>> The setup for instruments for tied-notes can be a bit tricky, but
>>>>>>>> I've
>>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>>>> building
>>>>>>>> instruments that will work with different p-fields given for a note.
>>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>>>> 5-fields,
>>>>>>>> or scores with 8-fields.  That in turn has made it nice to work with
>>>>>>>> live, for quick sketching, or for generation.
>>>>>>>>
>>>>>>>> For example, code from my current piece uses:
>>>>>>>>
>>>>>>>> def scoreFunc():
>>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>>>>
>>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>>>>
>>>>>>>>     return createUnstableGroup3(50,
>>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>>>>
>>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>>>>
>>>>>>>> The code uses a mix of PMask and some score generating functions to
>>>>>>>> generate a score performance func that groupB64A uses to generate
>>>>>>>> notes like:
>>>>>>>>
>>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>>>>>>>
>>>>>>>> If that's of use, I can post some more of the code or create a more
>>>>>>>> isolated example from my piece.
>>>>>>>>
>>>>>>>> Hope that helps!
>>>>>>>> steven
>>>>>>>>
>>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>> > OK, this is very positive. In just one hour last night I managed
>>>>>>>> > to make a
>>>>>>>> > bunch of alien blips and blops using PythonScore. Now for the next
>>>>>>>> > step.
>>>>>>>> >
>>>>>>>> > Say we have a pattern library in python that can be used alongside
>>>>>>>> > PythonScore. It's great for generating score event but what if you
>>>>>>>> > also want
>>>>>>>> > to be able to define a different envelop of arbitrary segments for
>>>>>>>> > each
>>>>>>>> > note? What if you want the envelop function to be generated by a
>>>>>>>> > python
>>>>>>>> > module? Would one use tables for this? Not so elegant I think.
>>>>>>>> > What are the
>>>>>>>> > options? I
>>>>>>>> >
>>>>>>>> > Thanks
>>>>>>>> > P
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > www.peimankhosravi.co.uk
>>>>>>>> >
>>>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>>>> > your email
>>>>>>>> > address in the 'follow' section.
>>>>>>>>
>>>>>>>>
>>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>>>
>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>>>> "unsubscribe csound"
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> codehop.com | #code #art #music
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> codehop.com | #code #art #music
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> codehop.com | #code #art #music
>>>
>>>
>>
>>
>>
>> --
>> codehop.com | #code #art #music
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2013-04-19 01:30
Frompeiman khosravi
SubjectRe: [Csnd] more python
BTW I'm totally a convert to python. What a beauty. I don't know what those SC3 people are doing! Honestly!

All I need to do now is to make the function into a class and the next time just write:


<CsScore bin="python">
from csd.pysco import PythonScore
score = PythonScore()
cue = score.cue

score.write('f1 0 32768 10 1')

with cue(0):
    score.i(3.1, 0, 10)
    parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
    parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])

score.end();
</CsScore>

What's more, one could have as many 'parameters' as one wishes without defining any extra functions in python. 
 






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com> wrote:
In fact what I had was also stupid on so many other levels! This is the corrected one (attached). Also added amplitude automation.











www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Steven,

I really appreciate that. Super useful!

All the best,
Peiman







www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Thought I'd mention, you may want to consider using formatting strings
[1] to modify:

    paramName = '"' + p4+"."+str(p1) + '"'

to:

    paramName = '"%s.%g"'%(p4, p1)

You may also want to use list slicing  [2] with multiple assignment
[2] to do something like this:

t1, v1, t2, v2 = linseg[i:i+4]

String formatting is good to know as you can get a lot of control
about the string formatting, and the template string can be easier to
use and understand, especially when using a lot of replacement values.
 List slicing and multiple assignment are also handy syntax sugar to
write more terser code.

Hope that's useful!
steven

[1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
[2] http://docs.python.org/2/tutorial/introduction.html

On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> No thank you and Steven for all your comments and contributions.
>
> I've had enough of staring at the computer tonight. Here's the latest
> function I came up with.
>
> Best,
> P
>
>
>
> from csd.pysco import PythonScore
> from random import choice
>
> score = PythonScore()
> cue = score.cue
>
> score.write('f1 0 8192 10 1')
>
> def parameter(p1, name, type, envelope):
>
>
>     if "l" in type:
>         p7 = 1
>     else:
>         p7 = 0
>
>     p4 = name
>     linseg = envelope
>
>     paramName = '"' + p4+"."+str(p1) + '"'
>
>     for i in range(len(linseg)-4):
>
>         if i > 0:
>             i = i+1
>
>         t1 = linseg[i]
>         v1 = linseg[i+1]
>         t2 = linseg[i+2]
>         v2 = linseg[i+3]
>         start = t1
>         dur = t2-t1
>         point1 = v1
>         point2 = v2
>
>         score.i(2, start, dur,paramName, point1, point2, p7)
>
>
> score.i(3.1, 0, 10)
> parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>
>
>
> score.end();
>
>
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>
>> Thanks for posting these. I'm definitely reading and running them. Here's
>> an supported featured debugging feature that might help, which will
>> eventually be transformed into an official feature. To see what data is
>> currently in the score object, do this:
>>
>> for L in score.score_data:
>>     print L
>>
>>
>>
>> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>>>
>>> Thanks, I haven't tried your example yet. That next! Here's my latest.
>>> Much more readable. I'm not so suave with python [yet!] so it's probably not
>>> the most efficient of doing it.
>>>
>>>
>>>
>>> from csd.pysco import PythonScore
>>> from random import choice
>>>
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 8192 10 1')
>>>
>>>
>>> def note(p1, p2, p3, list):
>>>
>>>     type = list.pop(1)
>>>
>>>     if "l" in type:
>>>         p7 = 1
>>>     else:
>>>         p7 = 0
>>>
>>>     p4 = list.pop(0)
>>>     linseg = list[0:]
>>>
>>>
>>>     score.i(p1, p2, p3)
>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>
>>>
>>>     for i in range(len(linseg)-4):
>>>
>>>         if i > 0:
>>>             i = i+1
>>>
>>>         t1 = linseg[i]
>>>         v1 = linseg[i+1]
>>>         t2 = linseg[i+2]
>>>         v2 = linseg[i+3]
>>>
>>>         start = t1
>>>         dur = t2-t1
>>>         point1 = v1
>>>         point2 = v2
>>>
>>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>
>>>
>>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>
>>>
>>> score.end();
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>>>
>>>> I cleaned up the example and placed it with the PythonScore examples in
>>>> the master branch of the CSD module:
>>>>
>>>>
>>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>
>>>> The plan is to create/collect lots of examples as a way to start
>>>> identifying some of the design patterns that Python brings to the score
>>>> environment. Once enough are collected and we have a sense of good ways of
>>>> approaching common problems, functions and classes that reside in these
>>>> examples we'll be pulled out, rewritten if necessary, and placed into
>>>> modules that come with CSD. The examples will be updated in the process.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>> wrote:
>>>>>
>>>>> Here is another approach:
>>>>>
>>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>
>>>>> I feel I can reduce this example further, and when I do, I'll include
>>>>> it as an example case with PythonScore. In the meantime, here's the
>>>>> explanation of how it works.
>>>>>
>>>>> Envelope shapes are generated as tables. They are created dynamically
>>>>> in score. Since we don't want tables overwriting tables as they're being
>>>>> played, I created the table_cycler that cycles through a range of table
>>>>> indexes every time a new table is created. In this case, the range is
>>>>> between 100 and 120.
>>>>>
>>>>> table_cycler = cycle(xrange(100, 120))
>>>>>
>>>>> The function that handles this is gen_envelope(). It takes a list of
>>>>> envelope points, and reformats it into a GEN07 "f" event. The args are the
>>>>> same as GEN07, but only the envelope data, as the first 5 "f" event pfields
>>>>> are automatically handled:
>>>>>
>>>>> def gen_envelope(*args):
>>>>>     global table_cycler
>>>>>
>>>>>     table = table_cycler.next()
>>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>     score.write(" ".join(str(i) for i in L))
>>>>>     return table
>>>>>
>>>>> That function returns the number of the table generated. So a value
>>>>> between 100 and 120. If you watch the table numbers during a performance,
>>>>> you'll see it cycle through this range.
>>>>>
>>>>> Now, one can pass an arbitrary number of envelope points. The first 5
>>>>> notes in the score demo this explicitly:
>>>>>
>>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991,
>>>>> 0))
>>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>>>>
>>>>> For the rest of the piece, it auto-cycles between a frequency pattern
>>>>> and an envelope pattern.
>>>>>
>>>>> Best,
>>>>> Jake
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> I'll take a stab at this problem in a bit, but I'm hoping arrays in C6
>>>>>> will support something like the following. To solve the problem you
>>>>>> presented, I think it would require two things. First, the ability to pass
>>>>>> an as a pfield in the score:
>>>>>>
>>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>>
>>>>>> And then in the score, pass the array in as a list of args for
>>>>>> opcodes:
>>>>>>
>>>>>> ienvpoints getarray p6
>>>>>> kenv linseg *ienvpoints
>>>>>>
>>>>>> There may need to be a third step required for scaling the even fields
>>>>>> of the array, though is probably already supported by orchestra loop
>>>>>> statements.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>
>>>>>>> Thanks very much Steven,
>>>>>>>
>>>>>>> I'm going to have a proper look at the code you posted. My initial
>>>>>>> impression is that this is possibly too convoluted for quick and dirty
>>>>>>> experimentation. I think it should be easier than that. Maybe with array in
>>>>>>> csound6 it will be possible?
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Peiman
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> www.peimankhosravi.co.uk
>>>>>>>
>>>>>>> To receive emails about upcoming concerts visit this page & enter
>>>>>>> your email address in the 'follow' section.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi Peiman,
>>>>>>>>
>>>>>>>> I've done a couple of ways using score generation:
>>>>>>>>
>>>>>>>> 1) For a limited number of articulations, I've added a pfield that
>>>>>>>> is
>>>>>>>> used as an index to choose what envelope to generate
>>>>>>>>
>>>>>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>>>>>>> together with tied-notes.  Essentially, each segment becomes a note.
>>>>>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>>>>>>> used this in pieces (you can check
>>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>>>>>>> 8.00" object) and am using this in my current piece to do group
>>>>>>>> glissandi sounds.
>>>>>>>>
>>>>>>>> The setup for instruments for tied-notes can be a bit tricky, but
>>>>>>>> I've
>>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>>>> building
>>>>>>>> instruments that will work with different p-fields given for a note.
>>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>>>> 5-fields,
>>>>>>>> or scores with 8-fields.  That in turn has made it nice to work with
>>>>>>>> live, for quick sketching, or for generation.
>>>>>>>>
>>>>>>>> For example, code from my current piece uses:
>>>>>>>>
>>>>>>>> def scoreFunc():
>>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>>>>
>>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>>>>
>>>>>>>>     return createUnstableGroup3(50,
>>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>>>>
>>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>>>>
>>>>>>>> The code uses a mix of PMask and some score generating functions to
>>>>>>>> generate a score performance func that groupB64A uses to generate
>>>>>>>> notes like:
>>>>>>>>
>>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>>>>>>>
>>>>>>>> If that's of use, I can post some more of the code or create a more
>>>>>>>> isolated example from my piece.
>>>>>>>>
>>>>>>>> Hope that helps!
>>>>>>>> steven
>>>>>>>>
>>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>> > OK, this is very positive. In just one hour last night I managed
>>>>>>>> > to make a
>>>>>>>> > bunch of alien blips and blops using PythonScore. Now for the next
>>>>>>>> > step.
>>>>>>>> >
>>>>>>>> > Say we have a pattern library in python that can be used alongside
>>>>>>>> > PythonScore. It's great for generating score event but what if you
>>>>>>>> > also want
>>>>>>>> > to be able to define a different envelop of arbitrary segments for
>>>>>>>> > each
>>>>>>>> > note? What if you want the envelop function to be generated by a
>>>>>>>> > python
>>>>>>>> > module? Would one use tables for this? Not so elegant I think.
>>>>>>>> > What are the
>>>>>>>> > options? I
>>>>>>>> >
>>>>>>>> > Thanks
>>>>>>>> > P
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > www.peimankhosravi.co.uk
>>>>>>>> >
>>>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>>>> > your email
>>>>>>>> > address in the 'follow' section.
>>>>>>>>
>>>>>>>>
>>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>>>
>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>>>> "unsubscribe csound"
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> codehop.com | #code #art #music
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> codehop.com | #code #art #music
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> codehop.com | #code #art #music
>>>
>>>
>>
>>
>>
>> --
>> codehop.com | #code #art #music
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





Date2013-04-19 10:45
Frompeiman khosravi
SubjectRe: [Csnd] more python
Now the question is how to have an automated polyphonic management so one doesn't need to bother writing in the fractional part of the instrument manually?

An another question: how to make other types of interpolation, say, for creating a periodic LFO sine function?

Cheers,
P
 






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com> wrote:
BTW I'm totally a convert to python. What a beauty. I don't know what those SC3 people are doing! Honestly!

All I need to do now is to make the function into a class and the next time just write:


<CsScore bin="python">
from csd.pysco import PythonScore
score = PythonScore()
cue = score.cue

score.write('f1 0 32768 10 1')

with cue(0):
    score.i(3.1, 0, 10)
    parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
    parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])

score.end();
</CsScore>

What's more, one could have as many 'parameters' as one wishes without defining any extra functions in python. 
 






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com> wrote:
In fact what I had was also stupid on so many other levels! This is the corrected one (attached). Also added amplitude automation.











www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Steven,

I really appreciate that. Super useful!

All the best,
Peiman







www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Thought I'd mention, you may want to consider using formatting strings
[1] to modify:

    paramName = '"' + p4+"."+str(p1) + '"'

to:

    paramName = '"%s.%g"'%(p4, p1)

You may also want to use list slicing  [2] with multiple assignment
[2] to do something like this:

t1, v1, t2, v2 = linseg[i:i+4]

String formatting is good to know as you can get a lot of control
about the string formatting, and the template string can be easier to
use and understand, especially when using a lot of replacement values.
 List slicing and multiple assignment are also handy syntax sugar to
write more terser code.

Hope that's useful!
steven

[1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
[2] http://docs.python.org/2/tutorial/introduction.html

On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> No thank you and Steven for all your comments and contributions.
>
> I've had enough of staring at the computer tonight. Here's the latest
> function I came up with.
>
> Best,
> P
>
>
>
> from csd.pysco import PythonScore
> from random import choice
>
> score = PythonScore()
> cue = score.cue
>
> score.write('f1 0 8192 10 1')
>
> def parameter(p1, name, type, envelope):
>
>
>     if "l" in type:
>         p7 = 1
>     else:
>         p7 = 0
>
>     p4 = name
>     linseg = envelope
>
>     paramName = '"' + p4+"."+str(p1) + '"'
>
>     for i in range(len(linseg)-4):
>
>         if i > 0:
>             i = i+1
>
>         t1 = linseg[i]
>         v1 = linseg[i+1]
>         t2 = linseg[i+2]
>         v2 = linseg[i+3]
>         start = t1
>         dur = t2-t1
>         point1 = v1
>         point2 = v2
>
>         score.i(2, start, dur,paramName, point1, point2, p7)
>
>
> score.i(3.1, 0, 10)
> parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>
>
>
> score.end();
>
>
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>
>> Thanks for posting these. I'm definitely reading and running them. Here's
>> an supported featured debugging feature that might help, which will
>> eventually be transformed into an official feature. To see what data is
>> currently in the score object, do this:
>>
>> for L in score.score_data:
>>     print L
>>
>>
>>
>> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>>>
>>> Thanks, I haven't tried your example yet. That next! Here's my latest.
>>> Much more readable. I'm not so suave with python [yet!] so it's probably not
>>> the most efficient of doing it.
>>>
>>>
>>>
>>> from csd.pysco import PythonScore
>>> from random import choice
>>>
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 8192 10 1')
>>>
>>>
>>> def note(p1, p2, p3, list):
>>>
>>>     type = list.pop(1)
>>>
>>>     if "l" in type:
>>>         p7 = 1
>>>     else:
>>>         p7 = 0
>>>
>>>     p4 = list.pop(0)
>>>     linseg = list[0:]
>>>
>>>
>>>     score.i(p1, p2, p3)
>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>
>>>
>>>     for i in range(len(linseg)-4):
>>>
>>>         if i > 0:
>>>             i = i+1
>>>
>>>         t1 = linseg[i]
>>>         v1 = linseg[i+1]
>>>         t2 = linseg[i+2]
>>>         v2 = linseg[i+3]
>>>
>>>         start = t1
>>>         dur = t2-t1
>>>         point1 = v1
>>>         point2 = v2
>>>
>>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>
>>>
>>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>
>>>
>>> score.end();
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>>>
>>>> I cleaned up the example and placed it with the PythonScore examples in
>>>> the master branch of the CSD module:
>>>>
>>>>
>>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>
>>>> The plan is to create/collect lots of examples as a way to start
>>>> identifying some of the design patterns that Python brings to the score
>>>> environment. Once enough are collected and we have a sense of good ways of
>>>> approaching common problems, functions and classes that reside in these
>>>> examples we'll be pulled out, rewritten if necessary, and placed into
>>>> modules that come with CSD. The examples will be updated in the process.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>> wrote:
>>>>>
>>>>> Here is another approach:
>>>>>
>>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>
>>>>> I feel I can reduce this example further, and when I do, I'll include
>>>>> it as an example case with PythonScore. In the meantime, here's the
>>>>> explanation of how it works.
>>>>>
>>>>> Envelope shapes are generated as tables. They are created dynamically
>>>>> in score. Since we don't want tables overwriting tables as they're being
>>>>> played, I created the table_cycler that cycles through a range of table
>>>>> indexes every time a new table is created. In this case, the range is
>>>>> between 100 and 120.
>>>>>
>>>>> table_cycler = cycle(xrange(100, 120))
>>>>>
>>>>> The function that handles this is gen_envelope(). It takes a list of
>>>>> envelope points, and reformats it into a GEN07 "f" event. The args are the
>>>>> same as GEN07, but only the envelope data, as the first 5 "f" event pfields
>>>>> are automatically handled:
>>>>>
>>>>> def gen_envelope(*args):
>>>>>     global table_cycler
>>>>>
>>>>>     table = table_cycler.next()
>>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>     score.write(" ".join(str(i) for i in L))
>>>>>     return table
>>>>>
>>>>> That function returns the number of the table generated. So a value
>>>>> between 100 and 120. If you watch the table numbers during a performance,
>>>>> you'll see it cycle through this range.
>>>>>
>>>>> Now, one can pass an arbitrary number of envelope points. The first 5
>>>>> notes in the score demo this explicitly:
>>>>>
>>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991,
>>>>> 0))
>>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>>>>
>>>>> For the rest of the piece, it auto-cycles between a frequency pattern
>>>>> and an envelope pattern.
>>>>>
>>>>> Best,
>>>>> Jake
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> I'll take a stab at this problem in a bit, but I'm hoping arrays in C6
>>>>>> will support something like the following. To solve the problem you
>>>>>> presented, I think it would require two things. First, the ability to pass
>>>>>> an as a pfield in the score:
>>>>>>
>>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>>
>>>>>> And then in the score, pass the array in as a list of args for
>>>>>> opcodes:
>>>>>>
>>>>>> ienvpoints getarray p6
>>>>>> kenv linseg *ienvpoints
>>>>>>
>>>>>> There may need to be a third step required for scaling the even fields
>>>>>> of the array, though is probably already supported by orchestra loop
>>>>>> statements.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>
>>>>>>> Thanks very much Steven,
>>>>>>>
>>>>>>> I'm going to have a proper look at the code you posted. My initial
>>>>>>> impression is that this is possibly too convoluted for quick and dirty
>>>>>>> experimentation. I think it should be easier than that. Maybe with array in
>>>>>>> csound6 it will be possible?
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Peiman
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> www.peimankhosravi.co.uk
>>>>>>>
>>>>>>> To receive emails about upcoming concerts visit this page & enter
>>>>>>> your email address in the 'follow' section.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi Peiman,
>>>>>>>>
>>>>>>>> I've done a couple of ways using score generation:
>>>>>>>>
>>>>>>>> 1) For a limited number of articulations, I've added a pfield that
>>>>>>>> is
>>>>>>>> used as an index to choose what envelope to generate
>>>>>>>>
>>>>>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>>>>>>> together with tied-notes.  Essentially, each segment becomes a note.
>>>>>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>>>>>>> used this in pieces (you can check
>>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>>>>>>> 8.00" object) and am using this in my current piece to do group
>>>>>>>> glissandi sounds.
>>>>>>>>
>>>>>>>> The setup for instruments for tied-notes can be a bit tricky, but
>>>>>>>> I've
>>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>>>> building
>>>>>>>> instruments that will work with different p-fields given for a note.
>>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>>>> 5-fields,
>>>>>>>> or scores with 8-fields.  That in turn has made it nice to work with
>>>>>>>> live, for quick sketching, or for generation.
>>>>>>>>
>>>>>>>> For example, code from my current piece uses:
>>>>>>>>
>>>>>>>> def scoreFunc():
>>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>>>>
>>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>>>>
>>>>>>>>     return createUnstableGroup3(50,
>>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>>>>
>>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>>>>
>>>>>>>> The code uses a mix of PMask and some score generating functions to
>>>>>>>> generate a score performance func that groupB64A uses to generate
>>>>>>>> notes like:
>>>>>>>>
>>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>>>>>>>
>>>>>>>> If that's of use, I can post some more of the code or create a more
>>>>>>>> isolated example from my piece.
>>>>>>>>
>>>>>>>> Hope that helps!
>>>>>>>> steven
>>>>>>>>
>>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>> > OK, this is very positive. In just one hour last night I managed
>>>>>>>> > to make a
>>>>>>>> > bunch of alien blips and blops using PythonScore. Now for the next
>>>>>>>> > step.
>>>>>>>> >
>>>>>>>> > Say we have a pattern library in python that can be used alongside
>>>>>>>> > PythonScore. It's great for generating score event but what if you
>>>>>>>> > also want
>>>>>>>> > to be able to define a different envelop of arbitrary segments for
>>>>>>>> > each
>>>>>>>> > note? What if you want the envelop function to be generated by a
>>>>>>>> > python
>>>>>>>> > module? Would one use tables for this? Not so elegant I think.
>>>>>>>> > What are the
>>>>>>>> > options? I
>>>>>>>> >
>>>>>>>> > Thanks
>>>>>>>> > P
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > www.peimankhosravi.co.uk
>>>>>>>> >
>>>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>>>> > your email
>>>>>>>> > address in the 'follow' section.
>>>>>>>>
>>>>>>>>
>>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>>>
>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>>>> "unsubscribe csound"
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> codehop.com | #code #art #music
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> codehop.com | #code #art #music
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> codehop.com | #code #art #music
>>>
>>>
>>
>>
>>
>> --
>> codehop.com | #code #art #music
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






Date2013-04-19 12:00
Frompeiman khosravi
SubjectRe: [Csnd] more python
I've added a little something here: http://www.peimankhosravi.co.uk/miscellaneous.html
P






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com> wrote:
Now the question is how to have an automated polyphonic management so one doesn't need to bother writing in the fractional part of the instrument manually?

An another question: how to make other types of interpolation, say, for creating a periodic LFO sine function?

Cheers,
P
 






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com> wrote:
BTW I'm totally a convert to python. What a beauty. I don't know what those SC3 people are doing! Honestly!

All I need to do now is to make the function into a class and the next time just write:


<CsScore bin="python">
from csd.pysco import PythonScore
score = PythonScore()
cue = score.cue

score.write('f1 0 32768 10 1')

with cue(0):
    score.i(3.1, 0, 10)
    parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
    parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])

score.end();
</CsScore>

What's more, one could have as many 'parameters' as one wishes without defining any extra functions in python. 
 






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com> wrote:
In fact what I had was also stupid on so many other levels! This is the corrected one (attached). Also added amplitude automation.











www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Steven,

I really appreciate that. Super useful!

All the best,
Peiman







www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Thought I'd mention, you may want to consider using formatting strings
[1] to modify:

    paramName = '"' + p4+"."+str(p1) + '"'

to:

    paramName = '"%s.%g"'%(p4, p1)

You may also want to use list slicing  [2] with multiple assignment
[2] to do something like this:

t1, v1, t2, v2 = linseg[i:i+4]

String formatting is good to know as you can get a lot of control
about the string formatting, and the template string can be easier to
use and understand, especially when using a lot of replacement values.
 List slicing and multiple assignment are also handy syntax sugar to
write more terser code.

Hope that's useful!
steven

[1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
[2] http://docs.python.org/2/tutorial/introduction.html

On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> No thank you and Steven for all your comments and contributions.
>
> I've had enough of staring at the computer tonight. Here's the latest
> function I came up with.
>
> Best,
> P
>
>
>
> from csd.pysco import PythonScore
> from random import choice
>
> score = PythonScore()
> cue = score.cue
>
> score.write('f1 0 8192 10 1')
>
> def parameter(p1, name, type, envelope):
>
>
>     if "l" in type:
>         p7 = 1
>     else:
>         p7 = 0
>
>     p4 = name
>     linseg = envelope
>
>     paramName = '"' + p4+"."+str(p1) + '"'
>
>     for i in range(len(linseg)-4):
>
>         if i > 0:
>             i = i+1
>
>         t1 = linseg[i]
>         v1 = linseg[i+1]
>         t2 = linseg[i+2]
>         v2 = linseg[i+3]
>         start = t1
>         dur = t2-t1
>         point1 = v1
>         point2 = v2
>
>         score.i(2, start, dur,paramName, point1, point2, p7)
>
>
> score.i(3.1, 0, 10)
> parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>
>
>
> score.end();
>
>
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>
>> Thanks for posting these. I'm definitely reading and running them. Here's
>> an supported featured debugging feature that might help, which will
>> eventually be transformed into an official feature. To see what data is
>> currently in the score object, do this:
>>
>> for L in score.score_data:
>>     print L
>>
>>
>>
>> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>>>
>>> Thanks, I haven't tried your example yet. That next! Here's my latest.
>>> Much more readable. I'm not so suave with python [yet!] so it's probably not
>>> the most efficient of doing it.
>>>
>>>
>>>
>>> from csd.pysco import PythonScore
>>> from random import choice
>>>
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 8192 10 1')
>>>
>>>
>>> def note(p1, p2, p3, list):
>>>
>>>     type = list.pop(1)
>>>
>>>     if "l" in type:
>>>         p7 = 1
>>>     else:
>>>         p7 = 0
>>>
>>>     p4 = list.pop(0)
>>>     linseg = list[0:]
>>>
>>>
>>>     score.i(p1, p2, p3)
>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>
>>>
>>>     for i in range(len(linseg)-4):
>>>
>>>         if i > 0:
>>>             i = i+1
>>>
>>>         t1 = linseg[i]
>>>         v1 = linseg[i+1]
>>>         t2 = linseg[i+2]
>>>         v2 = linseg[i+3]
>>>
>>>         start = t1
>>>         dur = t2-t1
>>>         point1 = v1
>>>         point2 = v2
>>>
>>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>
>>>
>>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>
>>>
>>> score.end();
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
>>>>
>>>> I cleaned up the example and placed it with the PythonScore examples in
>>>> the master branch of the CSD module:
>>>>
>>>>
>>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>
>>>> The plan is to create/collect lots of examples as a way to start
>>>> identifying some of the design patterns that Python brings to the score
>>>> environment. Once enough are collected and we have a sense of good ways of
>>>> approaching common problems, functions and classes that reside in these
>>>> examples we'll be pulled out, rewritten if necessary, and placed into
>>>> modules that come with CSD. The examples will be updated in the process.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>> wrote:
>>>>>
>>>>> Here is another approach:
>>>>>
>>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>
>>>>> I feel I can reduce this example further, and when I do, I'll include
>>>>> it as an example case with PythonScore. In the meantime, here's the
>>>>> explanation of how it works.
>>>>>
>>>>> Envelope shapes are generated as tables. They are created dynamically
>>>>> in score. Since we don't want tables overwriting tables as they're being
>>>>> played, I created the table_cycler that cycles through a range of table
>>>>> indexes every time a new table is created. In this case, the range is
>>>>> between 100 and 120.
>>>>>
>>>>> table_cycler = cycle(xrange(100, 120))
>>>>>
>>>>> The function that handles this is gen_envelope(). It takes a list of
>>>>> envelope points, and reformats it into a GEN07 "f" event. The args are the
>>>>> same as GEN07, but only the envelope data, as the first 5 "f" event pfields
>>>>> are automatically handled:
>>>>>
>>>>> def gen_envelope(*args):
>>>>>     global table_cycler
>>>>>
>>>>>     table = table_cycler.next()
>>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>     score.write(" ".join(str(i) for i in L))
>>>>>     return table
>>>>>
>>>>> That function returns the number of the table generated. So a value
>>>>> between 100 and 120. If you watch the table numbers during a performance,
>>>>> you'll see it cycle through this range.
>>>>>
>>>>> Now, one can pass an arbitrary number of envelope points. The first 5
>>>>> notes in the score demo this explicitly:
>>>>>
>>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100, 0))
>>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191, 0))
>>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1, 7991,
>>>>> 0))
>>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100, 0))
>>>>>
>>>>> For the rest of the piece, it auto-cycles between a frequency pattern
>>>>> and an envelope pattern.
>>>>>
>>>>> Best,
>>>>> Jake
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> I'll take a stab at this problem in a bit, but I'm hoping arrays in C6
>>>>>> will support something like the following. To solve the problem you
>>>>>> presented, I think it would require two things. First, the ability to pass
>>>>>> an as a pfield in the score:
>>>>>>
>>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>>
>>>>>> And then in the score, pass the array in as a list of args for
>>>>>> opcodes:
>>>>>>
>>>>>> ienvpoints getarray p6
>>>>>> kenv linseg *ienvpoints
>>>>>>
>>>>>> There may need to be a third step required for scaling the even fields
>>>>>> of the array, though is probably already supported by orchestra loop
>>>>>> statements.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>
>>>>>>> Thanks very much Steven,
>>>>>>>
>>>>>>> I'm going to have a proper look at the code you posted. My initial
>>>>>>> impression is that this is possibly too convoluted for quick and dirty
>>>>>>> experimentation. I think it should be easier than that. Maybe with array in
>>>>>>> csound6 it will be possible?
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Peiman
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> www.peimankhosravi.co.uk
>>>>>>>
>>>>>>> To receive emails about upcoming concerts visit this page & enter
>>>>>>> your email address in the 'follow' section.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi Peiman,
>>>>>>>>
>>>>>>>> I've done a couple of ways using score generation:
>>>>>>>>
>>>>>>>> 1) For a limited number of articulations, I've added a pfield that
>>>>>>>> is
>>>>>>>> used as an index to choose what envelope to generate
>>>>>>>>
>>>>>>>> 2) For arbitrary segments, I use fractional instrument numbers
>>>>>>>> together with tied-notes.  Essentially, each segment becomes a note.
>>>>>>>> Using fractional instr numbers allows for polyphonic streams.  I've
>>>>>>>> used this in pieces (you can check
>>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the "StrA -
>>>>>>>> 8.00" object) and am using this in my current piece to do group
>>>>>>>> glissandi sounds.
>>>>>>>>
>>>>>>>> The setup for instruments for tied-notes can be a bit tricky, but
>>>>>>>> I've
>>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>>>> building
>>>>>>>> instruments that will work with different p-fields given for a note.
>>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>>>> 5-fields,
>>>>>>>> or scores with 8-fields.  That in turn has made it nice to work with
>>>>>>>> live, for quick sketching, or for generation.
>>>>>>>>
>>>>>>>> For example, code from my current piece uses:
>>>>>>>>
>>>>>>>> def scoreFunc():
>>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>>>>
>>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14), (10,-50)]),
>>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16), (10,-50)]))
>>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>>>>
>>>>>>>>     return createUnstableGroup3(50,
>>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>>>>
>>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>>>>
>>>>>>>> The code uses a mix of PMask and some score generating functions to
>>>>>>>> generate a score performance func that groupB64A uses to generate
>>>>>>>> notes like:
>>>>>>>>
>>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074 -0.25 3
>>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192 -0.25 3
>>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775 -0.25 3
>>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318 -0.25 3
>>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064 -0.25 3
>>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332 -0.25 3
>>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339 -0.25 3
>>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186 -0.25 3
>>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504 -0.25 3
>>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918 -0.25 3
>>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093 -0.25 3
>>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612 -0.25 3
>>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441 -0.25 3
>>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029 -0.25 3
>>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563 -0.25 3
>>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706 -0.25 3
>>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684 -0.25 3
>>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181 -0.25 3
>>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466 -0.25 3
>>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135 -0.25 3
>>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995 -0.25 3
>>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785 -0.25 3
>>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768 -0.25 3
>>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869 -0.25 3
>>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975 -0.25 3
>>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844 -0.25 3
>>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393 -0.25 3
>>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042 -0.25 3
>>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624 -0.25 3
>>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086 -0.25 3
>>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414 -0.25 3
>>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592 -0.25 3
>>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716 -0.25 3
>>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429 -0.25 3
>>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773 -0.25 3
>>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183 -0.25 3
>>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769 -0.25 3
>>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712 -0.25 3
>>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093 -0.25 3
>>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695 -0.25 3
>>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601 -0.25 3
>>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25 3
>>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255 -0.25 3
>>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605 -0.25 3
>>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133 -0.25 3
>>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659 -0.25 3
>>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244 -0.25 3
>>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713 -0.25 3
>>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213 -0.25 3
>>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454 -0.2 3
>>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423 -0.2 3
>>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654 -0.2 3
>>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944 -0.2 3
>>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366 -0.2 3
>>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563 -0.2 3
>>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576 -0.2 3
>>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672 -0.2 3
>>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332 -0.2 3
>>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478 -0.2 3
>>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2 3
>>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498 -0.2 3
>>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293 -0.2 3
>>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881 -0.2 3
>>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355 -0.2 3
>>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183 -0.2 3
>>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116 -0.2 3
>>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441 -0.2 3
>>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2 3
>>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265 -0.2 3
>>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913 -0.2 3
>>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733 -0.2 3
>>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325 -0.2 3
>>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432 -0.2 3
>>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225 -0.2 3
>>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2 3
>>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952 -0.2 3
>>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156 -0.2 3
>>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437 -0.2 3
>>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2 3
>>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476 -0.2 3
>>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2 3
>>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983 -0.2 3
>>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699 -0.2 3
>>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861 -0.2 3
>>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2 3
>>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687 -0.2 3
>>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846 -0.2 3
>>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2 3
>>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188 -0.2 3
>>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346 -0.2 3
>>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2 3
>>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823 -0.2 3
>>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249 -0.2 3
>>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2 3
>>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589 -0.2 3
>>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2 3
>>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308 -0.2 3
>>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2 3
>>>>>>>>
>>>>>>>> If that's of use, I can post some more of the code or create a more
>>>>>>>> isolated example from my piece.
>>>>>>>>
>>>>>>>> Hope that helps!
>>>>>>>> steven
>>>>>>>>
>>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>>>> > OK, this is very positive. In just one hour last night I managed
>>>>>>>> > to make a
>>>>>>>> > bunch of alien blips and blops using PythonScore. Now for the next
>>>>>>>> > step.
>>>>>>>> >
>>>>>>>> > Say we have a pattern library in python that can be used alongside
>>>>>>>> > PythonScore. It's great for generating score event but what if you
>>>>>>>> > also want
>>>>>>>> > to be able to define a different envelop of arbitrary segments for
>>>>>>>> > each
>>>>>>>> > note? What if you want the envelop function to be generated by a
>>>>>>>> > python
>>>>>>>> > module? Would one use tables for this? Not so elegant I think.
>>>>>>>> > What are the
>>>>>>>> > options? I
>>>>>>>> >
>>>>>>>> > Thanks
>>>>>>>> > P
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > www.peimankhosravi.co.uk
>>>>>>>> >
>>>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>>>> > your email
>>>>>>>> > address in the 'follow' section.
>>>>>>>>
>>>>>>>>
>>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>>>
>>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>>>> "unsubscribe csound"
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> codehop.com | #code #art #music
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> codehop.com | #code #art #music
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> codehop.com | #code #art #music
>>>
>>>
>>
>>
>>
>> --
>> codehop.com | #code #art #music
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"







Date2013-04-19 12:58
FromSteven Yi
SubjectRe: [Csnd] more python
Hi Peiman,

Nice webpage!  Any thought to adding RSS or Atom so people can
subscribe to the page?

As for polyphonic management, I use my orchestral composition library
[1] to do this.  The library is quite small.  There are Performer
objects that have things like instrument numbers assigned to them.
Each performer might have an instr num like "1.01" or "1.03". The
Performer has a space attribute and amplitude adjustment attribute.
The layers of the library allow for notes to be generated and the
Performer to "perform" the notes, applying their amp, space, and instr
num to the notes.  Other things can be applied here too. The
processing is like this

NoteGenerator => [notes] => Performer => [modified notes] => output

I'm not sure if Jake's CSD library works to return note objects/lists
that you can further manipulate or not.  If so, then you could create
your own function to decorate the contents of the list with further
values.

I realize though re-reading your email that this technique isn't quite
automatic polyphony management per-se, but might be useful.

Cheers!
steven

[1] This orchestra library is described in my chapter in "The Audio
Programming Book".  The python library is browsable online at:
http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/


On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
 wrote:
> I've added a little something here:
> http://www.peimankhosravi.co.uk/miscellaneous.html
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 19 April 2013 10:45, peiman khosravi  wrote:
>>
>> Here's an improved version:
>> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>>
>> Now the question is how to have an automated polyphonic management so one
>> doesn't need to bother writing in the fractional part of the instrument
>> manually?
>>
>> An another question: how to make other types of interpolation, say, for
>> creating a periodic LFO sine function?
>>
>> Cheers,
>> P
>>
>>
>>
>>
>>
>>
>>
>> www.peimankhosravi.co.uk
>>
>> To receive emails about upcoming concerts visit this page & enter your
>> email address in the 'follow' section.
>>
>>
>>
>> On 19 April 2013 01:30, peiman khosravi  wrote:
>>>
>>> BTW I'm totally a convert to python. What a beauty. I don't know what
>>> those SC3 people are doing! Honestly!
>>>
>>> All I need to do now is to make the function into a class and the next
>>> time just write:
>>>
>>>
>>> 
>>> from csd.pysco import PythonScore
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 32768 10 1')
>>>
>>> with cue(0):
>>>     score.i(3.1, 0, 10)
>>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>>>
>>> score.end();
>>> 
>>>
>>> What's more, one could have as many 'parameters' as one wishes without
>>> defining any extra functions in python.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 19 April 2013 01:17, peiman khosravi  wrote:
>>>>
>>>> In fact what I had was also stupid on so many other levels! This is the
>>>> corrected one (attached). Also added amplitude automation.
>>>>
>>>> P
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 19 April 2013 00:07, peiman khosravi 
>>>> wrote:
>>>>>
>>>>> Thanks Steven,
>>>>>
>>>>> I really appreciate that. Super useful!
>>>>>
>>>>> All the best,
>>>>> Peiman
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> www.peimankhosravi.co.uk
>>>>>
>>>>> To receive emails about upcoming concerts visit this page & enter your
>>>>> email address in the 'follow' section.
>>>>>
>>>>>
>>>>>
>>>>> On 18 April 2013 23:45, Steven Yi  wrote:
>>>>>>
>>>>>> Hi Peiman,
>>>>>>
>>>>>> Thought I'd mention, you may want to consider using formatting strings
>>>>>> [1] to modify:
>>>>>>
>>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>>
>>>>>> to:
>>>>>>
>>>>>>     paramName = '"%s.%g"'%(p4, p1)
>>>>>>
>>>>>> You may also want to use list slicing  [2] with multiple assignment
>>>>>> [2] to do something like this:
>>>>>>
>>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>>>>>>
>>>>>> String formatting is good to know as you can get a lot of control
>>>>>> about the string formatting, and the template string can be easier to
>>>>>> use and understand, especially when using a lot of replacement values.
>>>>>>  List slicing and multiple assignment are also handy syntax sugar to
>>>>>> write more terser code.
>>>>>>
>>>>>> Hope that's useful!
>>>>>> steven
>>>>>>
>>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>>>>>>  wrote:
>>>>>> > No thank you and Steven for all your comments and contributions.
>>>>>> >
>>>>>> > I've had enough of staring at the computer tonight. Here's the
>>>>>> > latest
>>>>>> > function I came up with.
>>>>>> >
>>>>>> > Best,
>>>>>> > P
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > from csd.pysco import PythonScore
>>>>>> > from random import choice
>>>>>> >
>>>>>> > score = PythonScore()
>>>>>> > cue = score.cue
>>>>>> >
>>>>>> > score.write('f1 0 8192 10 1')
>>>>>> >
>>>>>> > def parameter(p1, name, type, envelope):
>>>>>> >
>>>>>> >
>>>>>> >     if "l" in type:
>>>>>> >         p7 = 1
>>>>>> >     else:
>>>>>> >         p7 = 0
>>>>>> >
>>>>>> >     p4 = name
>>>>>> >     linseg = envelope
>>>>>> >
>>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >
>>>>>> >     for i in range(len(linseg)-4):
>>>>>> >
>>>>>> >         if i > 0:
>>>>>> >             i = i+1
>>>>>> >
>>>>>> >         t1 = linseg[i]
>>>>>> >         v1 = linseg[i+1]
>>>>>> >         t2 = linseg[i+2]
>>>>>> >         v2 = linseg[i+3]
>>>>>> >         start = t1
>>>>>> >         dur = t2-t1
>>>>>> >         point1 = v1
>>>>>> >         point2 = v2
>>>>>> >
>>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >
>>>>>> >
>>>>>> > score.i(3.1, 0, 10)
>>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > score.end();
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > www.peimankhosravi.co.uk
>>>>>> >
>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>> > your email
>>>>>> > address in the 'follow' section.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On 18 April 2013 23:09, Jacob Joaquin 
>>>>>> > wrote:
>>>>>> >>
>>>>>> >> Thanks for posting these. I'm definitely reading and running them.
>>>>>> >> Here's
>>>>>> >> an supported featured debugging feature that might help, which will
>>>>>> >> eventually be transformed into an official feature. To see what
>>>>>> >> data is
>>>>>> >> currently in the score object, do this:
>>>>>> >>
>>>>>> >> for L in score.score_data:
>>>>>> >>     print L
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>>>>>> >>  wrote:
>>>>>> >>>
>>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>>>>>> >>> latest.
>>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>>>>>> >>> probably not
>>>>>> >>> the most efficient of doing it.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> from csd.pysco import PythonScore
>>>>>> >>> from random import choice
>>>>>> >>>
>>>>>> >>> score = PythonScore()
>>>>>> >>> cue = score.cue
>>>>>> >>>
>>>>>> >>> score.write('f1 0 8192 10 1')
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> def note(p1, p2, p3, list):
>>>>>> >>>
>>>>>> >>>     type = list.pop(1)
>>>>>> >>>
>>>>>> >>>     if "l" in type:
>>>>>> >>>         p7 = 1
>>>>>> >>>     else:
>>>>>> >>>         p7 = 0
>>>>>> >>>
>>>>>> >>>     p4 = list.pop(0)
>>>>>> >>>     linseg = list[0:]
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     score.i(p1, p2, p3)
>>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     for i in range(len(linseg)-4):
>>>>>> >>>
>>>>>> >>>         if i > 0:
>>>>>> >>>             i = i+1
>>>>>> >>>
>>>>>> >>>         t1 = linseg[i]
>>>>>> >>>         v1 = linseg[i+1]
>>>>>> >>>         t2 = linseg[i+2]
>>>>>> >>>         v2 = linseg[i+3]
>>>>>> >>>
>>>>>> >>>         start = t1
>>>>>> >>>         dur = t2-t1
>>>>>> >>>         point1 = v1
>>>>>> >>>         point2 = v2
>>>>>> >>>
>>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> score.end();
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> www.peimankhosravi.co.uk
>>>>>> >>>
>>>>>> >>> To receive emails about upcoming concerts visit this page & enter
>>>>>> >>> your
>>>>>> >>> email address in the 'follow' section.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin 
>>>>>> >>> wrote:
>>>>>> >>>>
>>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>>>>>> >>>> examples in
>>>>>> >>>> the master branch of the CSD module:
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>>> >>>>
>>>>>> >>>> The plan is to create/collect lots of examples as a way to start
>>>>>> >>>> identifying some of the design patterns that Python brings to the
>>>>>> >>>> score
>>>>>> >>>> environment. Once enough are collected and we have a sense of
>>>>>> >>>> good ways of
>>>>>> >>>> approaching common problems, functions and classes that reside in
>>>>>> >>>> these
>>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and placed
>>>>>> >>>> into
>>>>>> >>>> modules that come with CSD. The examples will be updated in the
>>>>>> >>>> process.
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>>>>>> >>>> 
>>>>>> >>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> Here is another approach:
>>>>>> >>>>>
>>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>> >>>>>
>>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>>>>>> >>>>> include
>>>>>> >>>>> it as an example case with PythonScore. In the meantime, here's
>>>>>> >>>>> the
>>>>>> >>>>> explanation of how it works.
>>>>>> >>>>>
>>>>>> >>>>> Envelope shapes are generated as tables. They are created
>>>>>> >>>>> dynamically
>>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>>>>>> >>>>> they're being
>>>>>> >>>>> played, I created the table_cycler that cycles through a range
>>>>>> >>>>> of table
>>>>>> >>>>> indexes every time a new table is created. In this case, the
>>>>>> >>>>> range is
>>>>>> >>>>> between 100 and 120.
>>>>>> >>>>>
>>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>>>>>> >>>>>
>>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>>>>>> >>>>> list of
>>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>>>>>> >>>>> args are the
>>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>>>>>> >>>>> event pfields
>>>>>> >>>>> are automatically handled:
>>>>>> >>>>>
>>>>>> >>>>> def gen_envelope(*args):
>>>>>> >>>>>     global table_cycler
>>>>>> >>>>>
>>>>>> >>>>>     table = table_cycler.next()
>>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>>>>>> >>>>>     return table
>>>>>> >>>>>
>>>>>> >>>>> That function returns the number of the table generated. So a
>>>>>> >>>>> value
>>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>>>>>> >>>>> performance,
>>>>>> >>>>> you'll see it cycle through this range.
>>>>>> >>>>>
>>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>>>>>> >>>>> first 5
>>>>>> >>>>> notes in the score demo this explicitly:
>>>>>> >>>>>
>>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1,
>>>>>> >>>>> 7991,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>>
>>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>>>>>> >>>>> pattern
>>>>>> >>>>> and an envelope pattern.
>>>>>> >>>>>
>>>>>> >>>>> Best,
>>>>>> >>>>> Jake
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>>>>>> >>>>> 
>>>>>> >>>>> wrote:
>>>>>> >>>>>>
>>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>>>>>> >>>>>> arrays in C6
>>>>>> >>>>>> will support something like the following. To solve the problem
>>>>>> >>>>>> you
>>>>>> >>>>>> presented, I think it would require two things. First, the
>>>>>> >>>>>> ability to pass
>>>>>> >>>>>> an as a pfield in the score:
>>>>>> >>>>>>
>>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>> >>>>>>
>>>>>> >>>>>> And then in the score, pass the array in as a list of args for
>>>>>> >>>>>> opcodes:
>>>>>> >>>>>>
>>>>>> >>>>>> ienvpoints getarray p6
>>>>>> >>>>>> kenv linseg *ienvpoints
>>>>>> >>>>>>
>>>>>> >>>>>> There may need to be a third step required for scaling the even
>>>>>> >>>>>> fields
>>>>>> >>>>>> of the array, though is probably already supported by orchestra
>>>>>> >>>>>> loop
>>>>>> >>>>>> statements.
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> >>>>>>  wrote:
>>>>>> >>>>>>>
>>>>>> >>>>>>> Thanks very much Steven,
>>>>>> >>>>>>>
>>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>>>>>> >>>>>>> initial
>>>>>> >>>>>>> impression is that this is possibly too convoluted for quick
>>>>>> >>>>>>> and dirty
>>>>>> >>>>>>> experimentation. I think it should be easier than that. Maybe
>>>>>> >>>>>>> with array in
>>>>>> >>>>>>> csound6 it will be possible?
>>>>>> >>>>>>>
>>>>>> >>>>>>> Cheers,
>>>>>> >>>>>>> Peiman
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> www.peimankhosravi.co.uk
>>>>>> >>>>>>>
>>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>> enter
>>>>>> >>>>>>> your email address in the 'follow' section.
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi  wrote:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hi Peiman,
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> I've done a couple of ways using score generation:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a pfield
>>>>>> >>>>>>>> that
>>>>>> >>>>>>>> is
>>>>>> >>>>>>>> used as an index to choose what envelope to generate
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>>>>>> >>>>>>>> numbers
>>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment becomes
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic streams.
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> used this in pieces (you can check
>>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>>>>>> >>>>>>>> "StrA -
>>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>>>>>> >>>>>>>> group
>>>>>> >>>>>>>> glissandi sounds.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit tricky,
>>>>>> >>>>>>>> but
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>> >>>>>>>> building
>>>>>> >>>>>>>> instruments that will work with different p-fields given for
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>> >>>>>>>> 5-fields,
>>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>>>>>> >>>>>>>> work with
>>>>>> >>>>>>>> live, for quick sketching, or for generation.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> For example, code from my current piece uses:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> def scoreFunc():
>>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>>>>>> >>>>>>>> (10,-50)]),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>>>>>> >>>>>>>> (10,-50)]))
>>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     return createUnstableGroup3(50,
>>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>>>>>> >>>>>>>> functions to
>>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>>>>>> >>>>>>>> generate
>>>>>> >>>>>>>> notes like:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> If that's of use, I can post some more of the code or create
>>>>>> >>>>>>>> a more
>>>>>> >>>>>>>> isolated example from my piece.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hope that helps!
>>>>>> >>>>>>>> steven
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>> >>>>>>>>  wrote:
>>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>>>>>> >>>>>>>> > managed
>>>>>> >>>>>>>> > to make a
>>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now for
>>>>>> >>>>>>>> > the next
>>>>>> >>>>>>>> > step.
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>>>>>> >>>>>>>> > alongside
>>>>>> >>>>>>>> > PythonScore. It's great for generating score event but what
>>>>>> >>>>>>>> > if you
>>>>>> >>>>>>>> > also want
>>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>>>>>> >>>>>>>> > segments for
>>>>>> >>>>>>>> > each
>>>>>> >>>>>>>> > note? What if you want the envelop function to be generated
>>>>>> >>>>>>>> > by a
>>>>>> >>>>>>>> > python
>>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>>>>>> >>>>>>>> > think.
>>>>>> >>>>>>>> > What are the
>>>>>> >>>>>>>> > options? I
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Thanks
>>>>>> >>>>>>>> > P
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>>> > enter
>>>>>> >>>>>>>> > your email
>>>>>> >>>>>>>> > address in the 'follow' section.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> >>>>>>>> "unsubscribe csound"
>>>>>> >>>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> --
>>>>>> >>>>>> codehop.com | #code #art #music
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> codehop.com | #code #art #music
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> codehop.com | #code #art #music
>>>>>> >>>
>>>>>> >>>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> --
>>>>>> >> codehop.com | #code #art #music
>>>>>> >
>>>>>> >
>>>>>>
>>>>>>
>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>
>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> Discussions of bugs and features can be posted here
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe csound"
>>>>>>
>>>>>
>>>>
>>>
>>
>

Date2013-04-19 13:23
Frompeiman khosravi
SubjectRe: [Csnd] more python
Thanks Steven,

On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Nice webpage!  Any thought to adding RSS or Atom so people can
subscribe to the page?

I don't know how to do this, other than linking to an external blog. I'm making everything in a text editor and my html skills are minimal! it seems like a good idea to link to a wordpress page though. Unless you have a better suggestions. 
 
 

As for polyphonic management, I use my orchestral composition library
[1] to do this.  The library is quite small.  There are Performer
objects that have things like instrument numbers assigned to them.
Each performer might have an instr num like "1.01" or "1.03". The
Performer has a space attribute and amplitude adjustment attribute.
The layers of the library allow for notes to be generated and the
Performer to "perform" the notes, applying their amp, space, and instr
num to the notes.  Other things can be applied here too. The
processing is like this

NoteGenerator => [notes] => Performer => [modified notes] => output


Sounds nice. I must have a look. I have the book so I'll have a read later. And thanks for the link to the python library,


 
I'm not sure if Jake's CSD library works to return note objects/lists
that you can further manipulate or not.  If so, then you could create
your own function to decorate the contents of the list with further
values.

I realize though re-reading your email that this technique isn't quite
automatic polyphony management per-se, but might be useful.

Cheers!
steven

[1] This orchestra library is described in my chapter in "The Audio
Programming Book".  The python library is browsable online at:
http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/


On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> I've added a little something here:
> http://www.peimankhosravi.co.uk/miscellaneous.html
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>
>> Here's an improved version:
>> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>>
>> Now the question is how to have an automated polyphonic management so one
>> doesn't need to bother writing in the fractional part of the instrument
>> manually?
>>
>> An another question: how to make other types of interpolation, say, for
>> creating a periodic LFO sine function?
>>
>> Cheers,
>> P
>>
>>
>>
>>
>>
>>
>>
>> www.peimankhosravi.co.uk
>>
>> To receive emails about upcoming concerts visit this page & enter your
>> email address in the 'follow' section.
>>
>>
>>
>> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>
>>> BTW I'm totally a convert to python. What a beauty. I don't know what
>>> those SC3 people are doing! Honestly!
>>>
>>> All I need to do now is to make the function into a class and the next
>>> time just write:
>>>
>>>
>>> <CsScore bin="python">
>>> from csd.pysco import PythonScore
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 32768 10 1')
>>>
>>> with cue(0):
>>>     score.i(3.1, 0, 10)
>>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>>>
>>> score.end();
>>> </CsScore>
>>>
>>> What's more, one could have as many 'parameters' as one wishes without
>>> defining any extra functions in python.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>>
>>>> In fact what I had was also stupid on so many other levels! This is the
>>>> corrected one (attached). Also added amplitude automation.
>>>>
>>>> P
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>>>> wrote:
>>>>>
>>>>> Thanks Steven,
>>>>>
>>>>> I really appreciate that. Super useful!
>>>>>
>>>>> All the best,
>>>>> Peiman
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> www.peimankhosravi.co.uk
>>>>>
>>>>> To receive emails about upcoming concerts visit this page & enter your
>>>>> email address in the 'follow' section.
>>>>>
>>>>>
>>>>>
>>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>
>>>>>> Hi Peiman,
>>>>>>
>>>>>> Thought I'd mention, you may want to consider using formatting strings
>>>>>> [1] to modify:
>>>>>>
>>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>>
>>>>>> to:
>>>>>>
>>>>>>     paramName = '"%s.%g"'%(p4, p1)
>>>>>>
>>>>>> You may also want to use list slicing  [2] with multiple assignment
>>>>>> [2] to do something like this:
>>>>>>
>>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>>>>>>
>>>>>> String formatting is good to know as you can get a lot of control
>>>>>> about the string formatting, and the template string can be easier to
>>>>>> use and understand, especially when using a lot of replacement values.
>>>>>>  List slicing and multiple assignment are also handy syntax sugar to
>>>>>> write more terser code.
>>>>>>
>>>>>> Hope that's useful!
>>>>>> steven
>>>>>>
>>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> > No thank you and Steven for all your comments and contributions.
>>>>>> >
>>>>>> > I've had enough of staring at the computer tonight. Here's the
>>>>>> > latest
>>>>>> > function I came up with.
>>>>>> >
>>>>>> > Best,
>>>>>> > P
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > from csd.pysco import PythonScore
>>>>>> > from random import choice
>>>>>> >
>>>>>> > score = PythonScore()
>>>>>> > cue = score.cue
>>>>>> >
>>>>>> > score.write('f1 0 8192 10 1')
>>>>>> >
>>>>>> > def parameter(p1, name, type, envelope):
>>>>>> >
>>>>>> >
>>>>>> >     if "l" in type:
>>>>>> >         p7 = 1
>>>>>> >     else:
>>>>>> >         p7 = 0
>>>>>> >
>>>>>> >     p4 = name
>>>>>> >     linseg = envelope
>>>>>> >
>>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >
>>>>>> >     for i in range(len(linseg)-4):
>>>>>> >
>>>>>> >         if i > 0:
>>>>>> >             i = i+1
>>>>>> >
>>>>>> >         t1 = linseg[i]
>>>>>> >         v1 = linseg[i+1]
>>>>>> >         t2 = linseg[i+2]
>>>>>> >         v2 = linseg[i+3]
>>>>>> >         start = t1
>>>>>> >         dur = t2-t1
>>>>>> >         point1 = v1
>>>>>> >         point2 = v2
>>>>>> >
>>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >
>>>>>> >
>>>>>> > score.i(3.1, 0, 10)
>>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > score.end();
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > www.peimankhosravi.co.uk
>>>>>> >
>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>> > your email
>>>>>> > address in the 'follow' section.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> > wrote:
>>>>>> >>
>>>>>> >> Thanks for posting these. I'm definitely reading and running them.
>>>>>> >> Here's
>>>>>> >> an supported featured debugging feature that might help, which will
>>>>>> >> eventually be transformed into an official feature. To see what
>>>>>> >> data is
>>>>>> >> currently in the score object, do this:
>>>>>> >>
>>>>>> >> for L in score.score_data:
>>>>>> >>     print L
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>>>>>> >> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>
>>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>>>>>> >>> latest.
>>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>>>>>> >>> probably not
>>>>>> >>> the most efficient of doing it.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> from csd.pysco import PythonScore
>>>>>> >>> from random import choice
>>>>>> >>>
>>>>>> >>> score = PythonScore()
>>>>>> >>> cue = score.cue
>>>>>> >>>
>>>>>> >>> score.write('f1 0 8192 10 1')
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> def note(p1, p2, p3, list):
>>>>>> >>>
>>>>>> >>>     type = list.pop(1)
>>>>>> >>>
>>>>>> >>>     if "l" in type:
>>>>>> >>>         p7 = 1
>>>>>> >>>     else:
>>>>>> >>>         p7 = 0
>>>>>> >>>
>>>>>> >>>     p4 = list.pop(0)
>>>>>> >>>     linseg = list[0:]
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     score.i(p1, p2, p3)
>>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     for i in range(len(linseg)-4):
>>>>>> >>>
>>>>>> >>>         if i > 0:
>>>>>> >>>             i = i+1
>>>>>> >>>
>>>>>> >>>         t1 = linseg[i]
>>>>>> >>>         v1 = linseg[i+1]
>>>>>> >>>         t2 = linseg[i+2]
>>>>>> >>>         v2 = linseg[i+3]
>>>>>> >>>
>>>>>> >>>         start = t1
>>>>>> >>>         dur = t2-t1
>>>>>> >>>         point1 = v1
>>>>>> >>>         point2 = v2
>>>>>> >>>
>>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> score.end();
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> www.peimankhosravi.co.uk
>>>>>> >>>
>>>>>> >>> To receive emails about upcoming concerts visit this page & enter
>>>>>> >>> your
>>>>>> >>> email address in the 'follow' section.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> >>> wrote:
>>>>>> >>>>
>>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>>>>>> >>>> examples in
>>>>>> >>>> the master branch of the CSD module:
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>>> >>>>
>>>>>> >>>> The plan is to create/collect lots of examples as a way to start
>>>>>> >>>> identifying some of the design patterns that Python brings to the
>>>>>> >>>> score
>>>>>> >>>> environment. Once enough are collected and we have a sense of
>>>>>> >>>> good ways of
>>>>>> >>>> approaching common problems, functions and classes that reside in
>>>>>> >>>> these
>>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and placed
>>>>>> >>>> into
>>>>>> >>>> modules that come with CSD. The examples will be updated in the
>>>>>> >>>> process.
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>>>>>> >>>> <jacobjoaquin@gmail.com>
>>>>>> >>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> Here is another approach:
>>>>>> >>>>>
>>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>> >>>>>
>>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>>>>>> >>>>> include
>>>>>> >>>>> it as an example case with PythonScore. In the meantime, here's
>>>>>> >>>>> the
>>>>>> >>>>> explanation of how it works.
>>>>>> >>>>>
>>>>>> >>>>> Envelope shapes are generated as tables. They are created
>>>>>> >>>>> dynamically
>>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>>>>>> >>>>> they're being
>>>>>> >>>>> played, I created the table_cycler that cycles through a range
>>>>>> >>>>> of table
>>>>>> >>>>> indexes every time a new table is created. In this case, the
>>>>>> >>>>> range is
>>>>>> >>>>> between 100 and 120.
>>>>>> >>>>>
>>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>>>>>> >>>>>
>>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>>>>>> >>>>> list of
>>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>>>>>> >>>>> args are the
>>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>>>>>> >>>>> event pfields
>>>>>> >>>>> are automatically handled:
>>>>>> >>>>>
>>>>>> >>>>> def gen_envelope(*args):
>>>>>> >>>>>     global table_cycler
>>>>>> >>>>>
>>>>>> >>>>>     table = table_cycler.next()
>>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>>>>>> >>>>>     return table
>>>>>> >>>>>
>>>>>> >>>>> That function returns the number of the table generated. So a
>>>>>> >>>>> value
>>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>>>>>> >>>>> performance,
>>>>>> >>>>> you'll see it cycle through this range.
>>>>>> >>>>>
>>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>>>>>> >>>>> first 5
>>>>>> >>>>> notes in the score demo this explicitly:
>>>>>> >>>>>
>>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1,
>>>>>> >>>>> 7991,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>>
>>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>>>>>> >>>>> pattern
>>>>>> >>>>> and an envelope pattern.
>>>>>> >>>>>
>>>>>> >>>>> Best,
>>>>>> >>>>> Jake
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>>>>>> >>>>> <jacobjoaquin@gmail.com>
>>>>>> >>>>> wrote:
>>>>>> >>>>>>
>>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>>>>>> >>>>>> arrays in C6
>>>>>> >>>>>> will support something like the following. To solve the problem
>>>>>> >>>>>> you
>>>>>> >>>>>> presented, I think it would require two things. First, the
>>>>>> >>>>>> ability to pass
>>>>>> >>>>>> an as a pfield in the score:
>>>>>> >>>>>>
>>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>> >>>>>>
>>>>>> >>>>>> And then in the score, pass the array in as a list of args for
>>>>>> >>>>>> opcodes:
>>>>>> >>>>>>
>>>>>> >>>>>> ienvpoints getarray p6
>>>>>> >>>>>> kenv linseg *ienvpoints
>>>>>> >>>>>>
>>>>>> >>>>>> There may need to be a third step required for scaling the even
>>>>>> >>>>>> fields
>>>>>> >>>>>> of the array, though is probably already supported by orchestra
>>>>>> >>>>>> loop
>>>>>> >>>>>> statements.
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>
>>>>>> >>>>>>> Thanks very much Steven,
>>>>>> >>>>>>>
>>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>>>>>> >>>>>>> initial
>>>>>> >>>>>>> impression is that this is possibly too convoluted for quick
>>>>>> >>>>>>> and dirty
>>>>>> >>>>>>> experimentation. I think it should be easier than that. Maybe
>>>>>> >>>>>>> with array in
>>>>>> >>>>>>> csound6 it will be possible?
>>>>>> >>>>>>>
>>>>>> >>>>>>> Cheers,
>>>>>> >>>>>>> Peiman
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> www.peimankhosravi.co.uk
>>>>>> >>>>>>>
>>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>> enter
>>>>>> >>>>>>> your email address in the 'follow' section.
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hi Peiman,
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> I've done a couple of ways using score generation:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a pfield
>>>>>> >>>>>>>> that
>>>>>> >>>>>>>> is
>>>>>> >>>>>>>> used as an index to choose what envelope to generate
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>>>>>> >>>>>>>> numbers
>>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment becomes
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic streams.
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> used this in pieces (you can check
>>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>>>>>> >>>>>>>> "StrA -
>>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>>>>>> >>>>>>>> group
>>>>>> >>>>>>>> glissandi sounds.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit tricky,
>>>>>> >>>>>>>> but
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>> >>>>>>>> building
>>>>>> >>>>>>>> instruments that will work with different p-fields given for
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>> >>>>>>>> 5-fields,
>>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>>>>>> >>>>>>>> work with
>>>>>> >>>>>>>> live, for quick sketching, or for generation.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> For example, code from my current piece uses:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> def scoreFunc():
>>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>>>>>> >>>>>>>> (10,-50)]),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>>>>>> >>>>>>>> (10,-50)]))
>>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     return createUnstableGroup3(50,
>>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>>>>>> >>>>>>>> functions to
>>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>>>>>> >>>>>>>> generate
>>>>>> >>>>>>>> notes like:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> If that's of use, I can post some more of the code or create
>>>>>> >>>>>>>> a more
>>>>>> >>>>>>>> isolated example from my piece.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hope that helps!
>>>>>> >>>>>>>> steven
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>>>>>> >>>>>>>> > managed
>>>>>> >>>>>>>> > to make a
>>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now for
>>>>>> >>>>>>>> > the next
>>>>>> >>>>>>>> > step.
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>>>>>> >>>>>>>> > alongside
>>>>>> >>>>>>>> > PythonScore. It's great for generating score event but what
>>>>>> >>>>>>>> > if you
>>>>>> >>>>>>>> > also want
>>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>>>>>> >>>>>>>> > segments for
>>>>>> >>>>>>>> > each
>>>>>> >>>>>>>> > note? What if you want the envelop function to be generated
>>>>>> >>>>>>>> > by a
>>>>>> >>>>>>>> > python
>>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>>>>>> >>>>>>>> > think.
>>>>>> >>>>>>>> > What are the
>>>>>> >>>>>>>> > options? I
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Thanks
>>>>>> >>>>>>>> > P
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>>> > enter
>>>>>> >>>>>>>> > your email
>>>>>> >>>>>>>> > address in the 'follow' section.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> >>>>>>>> "unsubscribe csound"
>>>>>> >>>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> --
>>>>>> >>>>>> codehop.com | #code #art #music
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> codehop.com | #code #art #music
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> codehop.com | #code #art #music
>>>>>> >>>
>>>>>> >>>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> --
>>>>>> >> codehop.com | #code #art #music
>>>>>> >
>>>>>> >
>>>>>>
>>>>>>
>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>
>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> Discussions of bugs and features can be posted here
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe csound"
>>>>>>
>>>>>
>>>>
>>>
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-04-19 23:59
FromAndres Cabrera
SubjectRe: [Csnd] more python
I was thinking it would be great if when you send a score event text, you got back an id, which you could then use to remove the scheduled notes from the scheduler.

Would that be too complicated? It would make retracting a set of events scheduled into the future easier.

Cheers,
Andrés


On Fri, Apr 19, 2013 at 5:23 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Steven,

On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Nice webpage!  Any thought to adding RSS or Atom so people can
subscribe to the page?

I don't know how to do this, other than linking to an external blog. I'm making everything in a text editor and my html skills are minimal! it seems like a good idea to link to a wordpress page though. Unless you have a better suggestions. 
 
 

As for polyphonic management, I use my orchestral composition library
[1] to do this.  The library is quite small.  There are Performer
objects that have things like instrument numbers assigned to them.
Each performer might have an instr num like "1.01" or "1.03". The
Performer has a space attribute and amplitude adjustment attribute.
The layers of the library allow for notes to be generated and the
Performer to "perform" the notes, applying their amp, space, and instr
num to the notes.  Other things can be applied here too. The
processing is like this

NoteGenerator => [notes] => Performer => [modified notes] => output


Sounds nice. I must have a look. I have the book so I'll have a read later. And thanks for the link to the python library,


 
I'm not sure if Jake's CSD library works to return note objects/lists
that you can further manipulate or not.  If so, then you could create
your own function to decorate the contents of the list with further
values.

I realize though re-reading your email that this technique isn't quite
automatic polyphony management per-se, but might be useful.

Cheers!
steven

[1] This orchestra library is described in my chapter in "The Audio
Programming Book".  The python library is browsable online at:
http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/


On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> I've added a little something here:
> http://www.peimankhosravi.co.uk/miscellaneous.html
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>
>> Here's an improved version:
>> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>>
>> Now the question is how to have an automated polyphonic management so one
>> doesn't need to bother writing in the fractional part of the instrument
>> manually?
>>
>> An another question: how to make other types of interpolation, say, for
>> creating a periodic LFO sine function?
>>
>> Cheers,
>> P
>>
>>
>>
>>
>>
>>
>>
>> www.peimankhosravi.co.uk
>>
>> To receive emails about upcoming concerts visit this page & enter your
>> email address in the 'follow' section.
>>
>>
>>
>> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>
>>> BTW I'm totally a convert to python. What a beauty. I don't know what
>>> those SC3 people are doing! Honestly!
>>>
>>> All I need to do now is to make the function into a class and the next
>>> time just write:
>>>
>>>
>>> <CsScore bin="python">
>>> from csd.pysco import PythonScore
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 32768 10 1')
>>>
>>> with cue(0):
>>>     score.i(3.1, 0, 10)
>>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>>>
>>> score.end();
>>> </CsScore>
>>>
>>> What's more, one could have as many 'parameters' as one wishes without
>>> defining any extra functions in python.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>>
>>>> In fact what I had was also stupid on so many other levels! This is the
>>>> corrected one (attached). Also added amplitude automation.
>>>>
>>>> P
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>>>> wrote:
>>>>>
>>>>> Thanks Steven,
>>>>>
>>>>> I really appreciate that. Super useful!
>>>>>
>>>>> All the best,
>>>>> Peiman
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> www.peimankhosravi.co.uk
>>>>>
>>>>> To receive emails about upcoming concerts visit this page & enter your
>>>>> email address in the 'follow' section.
>>>>>
>>>>>
>>>>>
>>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>
>>>>>> Hi Peiman,
>>>>>>
>>>>>> Thought I'd mention, you may want to consider using formatting strings
>>>>>> [1] to modify:
>>>>>>
>>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>>
>>>>>> to:
>>>>>>
>>>>>>     paramName = '"%s.%g"'%(p4, p1)
>>>>>>
>>>>>> You may also want to use list slicing  [2] with multiple assignment
>>>>>> [2] to do something like this:
>>>>>>
>>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>>>>>>
>>>>>> String formatting is good to know as you can get a lot of control
>>>>>> about the string formatting, and the template string can be easier to
>>>>>> use and understand, especially when using a lot of replacement values.
>>>>>>  List slicing and multiple assignment are also handy syntax sugar to
>>>>>> write more terser code.
>>>>>>
>>>>>> Hope that's useful!
>>>>>> steven
>>>>>>
>>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> > No thank you and Steven for all your comments and contributions.
>>>>>> >
>>>>>> > I've had enough of staring at the computer tonight. Here's the
>>>>>> > latest
>>>>>> > function I came up with.
>>>>>> >
>>>>>> > Best,
>>>>>> > P
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > from csd.pysco import PythonScore
>>>>>> > from random import choice
>>>>>> >
>>>>>> > score = PythonScore()
>>>>>> > cue = score.cue
>>>>>> >
>>>>>> > score.write('f1 0 8192 10 1')
>>>>>> >
>>>>>> > def parameter(p1, name, type, envelope):
>>>>>> >
>>>>>> >
>>>>>> >     if "l" in type:
>>>>>> >         p7 = 1
>>>>>> >     else:
>>>>>> >         p7 = 0
>>>>>> >
>>>>>> >     p4 = name
>>>>>> >     linseg = envelope
>>>>>> >
>>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >
>>>>>> >     for i in range(len(linseg)-4):
>>>>>> >
>>>>>> >         if i > 0:
>>>>>> >             i = i+1
>>>>>> >
>>>>>> >         t1 = linseg[i]
>>>>>> >         v1 = linseg[i+1]
>>>>>> >         t2 = linseg[i+2]
>>>>>> >         v2 = linseg[i+3]
>>>>>> >         start = t1
>>>>>> >         dur = t2-t1
>>>>>> >         point1 = v1
>>>>>> >         point2 = v2
>>>>>> >
>>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >
>>>>>> >
>>>>>> > score.i(3.1, 0, 10)
>>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > score.end();
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > www.peimankhosravi.co.uk
>>>>>> >
>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>> > your email
>>>>>> > address in the 'follow' section.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> > wrote:
>>>>>> >>
>>>>>> >> Thanks for posting these. I'm definitely reading and running them.
>>>>>> >> Here's
>>>>>> >> an supported featured debugging feature that might help, which will
>>>>>> >> eventually be transformed into an official feature. To see what
>>>>>> >> data is
>>>>>> >> currently in the score object, do this:
>>>>>> >>
>>>>>> >> for L in score.score_data:
>>>>>> >>     print L
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>>>>>> >> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>
>>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>>>>>> >>> latest.
>>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>>>>>> >>> probably not
>>>>>> >>> the most efficient of doing it.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> from csd.pysco import PythonScore
>>>>>> >>> from random import choice
>>>>>> >>>
>>>>>> >>> score = PythonScore()
>>>>>> >>> cue = score.cue
>>>>>> >>>
>>>>>> >>> score.write('f1 0 8192 10 1')
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> def note(p1, p2, p3, list):
>>>>>> >>>
>>>>>> >>>     type = list.pop(1)
>>>>>> >>>
>>>>>> >>>     if "l" in type:
>>>>>> >>>         p7 = 1
>>>>>> >>>     else:
>>>>>> >>>         p7 = 0
>>>>>> >>>
>>>>>> >>>     p4 = list.pop(0)
>>>>>> >>>     linseg = list[0:]
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     score.i(p1, p2, p3)
>>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     for i in range(len(linseg)-4):
>>>>>> >>>
>>>>>> >>>         if i > 0:
>>>>>> >>>             i = i+1
>>>>>> >>>
>>>>>> >>>         t1 = linseg[i]
>>>>>> >>>         v1 = linseg[i+1]
>>>>>> >>>         t2 = linseg[i+2]
>>>>>> >>>         v2 = linseg[i+3]
>>>>>> >>>
>>>>>> >>>         start = t1
>>>>>> >>>         dur = t2-t1
>>>>>> >>>         point1 = v1
>>>>>> >>>         point2 = v2
>>>>>> >>>
>>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> score.end();
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> www.peimankhosravi.co.uk
>>>>>> >>>
>>>>>> >>> To receive emails about upcoming concerts visit this page & enter
>>>>>> >>> your
>>>>>> >>> email address in the 'follow' section.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> >>> wrote:
>>>>>> >>>>
>>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>>>>>> >>>> examples in
>>>>>> >>>> the master branch of the CSD module:
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>>> >>>>
>>>>>> >>>> The plan is to create/collect lots of examples as a way to start
>>>>>> >>>> identifying some of the design patterns that Python brings to the
>>>>>> >>>> score
>>>>>> >>>> environment. Once enough are collected and we have a sense of
>>>>>> >>>> good ways of
>>>>>> >>>> approaching common problems, functions and classes that reside in
>>>>>> >>>> these
>>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and placed
>>>>>> >>>> into
>>>>>> >>>> modules that come with CSD. The examples will be updated in the
>>>>>> >>>> process.
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>>>>>> >>>> <jacobjoaquin@gmail.com>
>>>>>> >>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> Here is another approach:
>>>>>> >>>>>
>>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>> >>>>>
>>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>>>>>> >>>>> include
>>>>>> >>>>> it as an example case with PythonScore. In the meantime, here's
>>>>>> >>>>> the
>>>>>> >>>>> explanation of how it works.
>>>>>> >>>>>
>>>>>> >>>>> Envelope shapes are generated as tables. They are created
>>>>>> >>>>> dynamically
>>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>>>>>> >>>>> they're being
>>>>>> >>>>> played, I created the table_cycler that cycles through a range
>>>>>> >>>>> of table
>>>>>> >>>>> indexes every time a new table is created. In this case, the
>>>>>> >>>>> range is
>>>>>> >>>>> between 100 and 120.
>>>>>> >>>>>
>>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>>>>>> >>>>>
>>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>>>>>> >>>>> list of
>>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>>>>>> >>>>> args are the
>>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>>>>>> >>>>> event pfields
>>>>>> >>>>> are automatically handled:
>>>>>> >>>>>
>>>>>> >>>>> def gen_envelope(*args):
>>>>>> >>>>>     global table_cycler
>>>>>> >>>>>
>>>>>> >>>>>     table = table_cycler.next()
>>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>>>>>> >>>>>     return table
>>>>>> >>>>>
>>>>>> >>>>> That function returns the number of the table generated. So a
>>>>>> >>>>> value
>>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>>>>>> >>>>> performance,
>>>>>> >>>>> you'll see it cycle through this range.
>>>>>> >>>>>
>>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>>>>>> >>>>> first 5
>>>>>> >>>>> notes in the score demo this explicitly:
>>>>>> >>>>>
>>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1,
>>>>>> >>>>> 7991,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>>
>>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>>>>>> >>>>> pattern
>>>>>> >>>>> and an envelope pattern.
>>>>>> >>>>>
>>>>>> >>>>> Best,
>>>>>> >>>>> Jake
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>>>>>> >>>>> <jacobjoaquin@gmail.com>
>>>>>> >>>>> wrote:
>>>>>> >>>>>>
>>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>>>>>> >>>>>> arrays in C6
>>>>>> >>>>>> will support something like the following. To solve the problem
>>>>>> >>>>>> you
>>>>>> >>>>>> presented, I think it would require two things. First, the
>>>>>> >>>>>> ability to pass
>>>>>> >>>>>> an as a pfield in the score:
>>>>>> >>>>>>
>>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>> >>>>>>
>>>>>> >>>>>> And then in the score, pass the array in as a list of args for
>>>>>> >>>>>> opcodes:
>>>>>> >>>>>>
>>>>>> >>>>>> ienvpoints getarray p6
>>>>>> >>>>>> kenv linseg *ienvpoints
>>>>>> >>>>>>
>>>>>> >>>>>> There may need to be a third step required for scaling the even
>>>>>> >>>>>> fields
>>>>>> >>>>>> of the array, though is probably already supported by orchestra
>>>>>> >>>>>> loop
>>>>>> >>>>>> statements.
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>
>>>>>> >>>>>>> Thanks very much Steven,
>>>>>> >>>>>>>
>>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>>>>>> >>>>>>> initial
>>>>>> >>>>>>> impression is that this is possibly too convoluted for quick
>>>>>> >>>>>>> and dirty
>>>>>> >>>>>>> experimentation. I think it should be easier than that. Maybe
>>>>>> >>>>>>> with array in
>>>>>> >>>>>>> csound6 it will be possible?
>>>>>> >>>>>>>
>>>>>> >>>>>>> Cheers,
>>>>>> >>>>>>> Peiman
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> www.peimankhosravi.co.uk
>>>>>> >>>>>>>
>>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>> enter
>>>>>> >>>>>>> your email address in the 'follow' section.
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hi Peiman,
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> I've done a couple of ways using score generation:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a pfield
>>>>>> >>>>>>>> that
>>>>>> >>>>>>>> is
>>>>>> >>>>>>>> used as an index to choose what envelope to generate
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>>>>>> >>>>>>>> numbers
>>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment becomes
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic streams.
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> used this in pieces (you can check
>>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>>>>>> >>>>>>>> "StrA -
>>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>>>>>> >>>>>>>> group
>>>>>> >>>>>>>> glissandi sounds.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit tricky,
>>>>>> >>>>>>>> but
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>> >>>>>>>> building
>>>>>> >>>>>>>> instruments that will work with different p-fields given for
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>> >>>>>>>> 5-fields,
>>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>>>>>> >>>>>>>> work with
>>>>>> >>>>>>>> live, for quick sketching, or for generation.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> For example, code from my current piece uses:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> def scoreFunc():
>>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>>>>>> >>>>>>>> (10,-50)]),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>>>>>> >>>>>>>> (10,-50)]))
>>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     return createUnstableGroup3(50,
>>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>>>>>> >>>>>>>> functions to
>>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>>>>>> >>>>>>>> generate
>>>>>> >>>>>>>> notes like:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> If that's of use, I can post some more of the code or create
>>>>>> >>>>>>>> a more
>>>>>> >>>>>>>> isolated example from my piece.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hope that helps!
>>>>>> >>>>>>>> steven
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>>>>>> >>>>>>>> > managed
>>>>>> >>>>>>>> > to make a
>>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now for
>>>>>> >>>>>>>> > the next
>>>>>> >>>>>>>> > step.
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>>>>>> >>>>>>>> > alongside
>>>>>> >>>>>>>> > PythonScore. It's great for generating score event but what
>>>>>> >>>>>>>> > if you
>>>>>> >>>>>>>> > also want
>>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>>>>>> >>>>>>>> > segments for
>>>>>> >>>>>>>> > each
>>>>>> >>>>>>>> > note? What if you want the envelop function to be generated
>>>>>> >>>>>>>> > by a
>>>>>> >>>>>>>> > python
>>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>>>>>> >>>>>>>> > think.
>>>>>> >>>>>>>> > What are the
>>>>>> >>>>>>>> > options? I
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Thanks
>>>>>> >>>>>>>> > P
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>>> > enter
>>>>>> >>>>>>>> > your email
>>>>>> >>>>>>>> > address in the 'follow' section.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> >>>>>>>> "unsubscribe csound"
>>>>>> >>>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> --
>>>>>> >>>>>> codehop.com | #code #art #music
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> codehop.com | #code #art #music
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> codehop.com | #code #art #music
>>>>>> >>>
>>>>>> >>>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> --
>>>>>> >> codehop.com | #code #art #music
>>>>>> >
>>>>>> >
>>>>>>
>>>>>>
>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>
>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> Discussions of bugs and features can be posted here
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe csound"
>>>>>>
>>>>>
>>>>
>>>
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2013-04-20 00:04
FromJacob Joaquin
SubjectRe: [Csnd] more python
I second this.


On Fri, Apr 19, 2013 at 3:59 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:
I was thinking it would be great if when you send a score event text, you got back an id, which you could then use to remove the scheduled notes from the scheduler.

Would that be too complicated? It would make retracting a set of events scheduled into the future easier.

Cheers,
Andrés


On Fri, Apr 19, 2013 at 5:23 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Steven,

On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Nice webpage!  Any thought to adding RSS or Atom so people can
subscribe to the page?

I don't know how to do this, other than linking to an external blog. I'm making everything in a text editor and my html skills are minimal! it seems like a good idea to link to a wordpress page though. Unless you have a better suggestions. 
 
 

As for polyphonic management, I use my orchestral composition library
[1] to do this.  The library is quite small.  There are Performer
objects that have things like instrument numbers assigned to them.
Each performer might have an instr num like "1.01" or "1.03". The
Performer has a space attribute and amplitude adjustment attribute.
The layers of the library allow for notes to be generated and the
Performer to "perform" the notes, applying their amp, space, and instr
num to the notes.  Other things can be applied here too. The
processing is like this

NoteGenerator => [notes] => Performer => [modified notes] => output


Sounds nice. I must have a look. I have the book so I'll have a read later. And thanks for the link to the python library,


 
I'm not sure if Jake's CSD library works to return note objects/lists
that you can further manipulate or not.  If so, then you could create
your own function to decorate the contents of the list with further
values.

I realize though re-reading your email that this technique isn't quite
automatic polyphony management per-se, but might be useful.

Cheers!
steven

[1] This orchestra library is described in my chapter in "The Audio
Programming Book".  The python library is browsable online at:
http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/


On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> I've added a little something here:
> http://www.peimankhosravi.co.uk/miscellaneous.html
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>
>> Here's an improved version:
>> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>>
>> Now the question is how to have an automated polyphonic management so one
>> doesn't need to bother writing in the fractional part of the instrument
>> manually?
>>
>> An another question: how to make other types of interpolation, say, for
>> creating a periodic LFO sine function?
>>
>> Cheers,
>> P
>>
>>
>>
>>
>>
>>
>>
>> www.peimankhosravi.co.uk
>>
>> To receive emails about upcoming concerts visit this page & enter your
>> email address in the 'follow' section.
>>
>>
>>
>> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>
>>> BTW I'm totally a convert to python. What a beauty. I don't know what
>>> those SC3 people are doing! Honestly!
>>>
>>> All I need to do now is to make the function into a class and the next
>>> time just write:
>>>
>>>
>>> <CsScore bin="python">
>>> from csd.pysco import PythonScore
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 32768 10 1')
>>>
>>> with cue(0):
>>>     score.i(3.1, 0, 10)
>>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>>>
>>> score.end();
>>> </CsScore>
>>>
>>> What's more, one could have as many 'parameters' as one wishes without
>>> defining any extra functions in python.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>>
>>>> In fact what I had was also stupid on so many other levels! This is the
>>>> corrected one (attached). Also added amplitude automation.
>>>>
>>>> P
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>>>> wrote:
>>>>>
>>>>> Thanks Steven,
>>>>>
>>>>> I really appreciate that. Super useful!
>>>>>
>>>>> All the best,
>>>>> Peiman
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> www.peimankhosravi.co.uk
>>>>>
>>>>> To receive emails about upcoming concerts visit this page & enter your
>>>>> email address in the 'follow' section.
>>>>>
>>>>>
>>>>>
>>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>
>>>>>> Hi Peiman,
>>>>>>
>>>>>> Thought I'd mention, you may want to consider using formatting strings
>>>>>> [1] to modify:
>>>>>>
>>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>>
>>>>>> to:
>>>>>>
>>>>>>     paramName = '"%s.%g"'%(p4, p1)
>>>>>>
>>>>>> You may also want to use list slicing  [2] with multiple assignment
>>>>>> [2] to do something like this:
>>>>>>
>>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>>>>>>
>>>>>> String formatting is good to know as you can get a lot of control
>>>>>> about the string formatting, and the template string can be easier to
>>>>>> use and understand, especially when using a lot of replacement values.
>>>>>>  List slicing and multiple assignment are also handy syntax sugar to
>>>>>> write more terser code.
>>>>>>
>>>>>> Hope that's useful!
>>>>>> steven
>>>>>>
>>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> > No thank you and Steven for all your comments and contributions.
>>>>>> >
>>>>>> > I've had enough of staring at the computer tonight. Here's the
>>>>>> > latest
>>>>>> > function I came up with.
>>>>>> >
>>>>>> > Best,
>>>>>> > P
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > from csd.pysco import PythonScore
>>>>>> > from random import choice
>>>>>> >
>>>>>> > score = PythonScore()
>>>>>> > cue = score.cue
>>>>>> >
>>>>>> > score.write('f1 0 8192 10 1')
>>>>>> >
>>>>>> > def parameter(p1, name, type, envelope):
>>>>>> >
>>>>>> >
>>>>>> >     if "l" in type:
>>>>>> >         p7 = 1
>>>>>> >     else:
>>>>>> >         p7 = 0
>>>>>> >
>>>>>> >     p4 = name
>>>>>> >     linseg = envelope
>>>>>> >
>>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >
>>>>>> >     for i in range(len(linseg)-4):
>>>>>> >
>>>>>> >         if i > 0:
>>>>>> >             i = i+1
>>>>>> >
>>>>>> >         t1 = linseg[i]
>>>>>> >         v1 = linseg[i+1]
>>>>>> >         t2 = linseg[i+2]
>>>>>> >         v2 = linseg[i+3]
>>>>>> >         start = t1
>>>>>> >         dur = t2-t1
>>>>>> >         point1 = v1
>>>>>> >         point2 = v2
>>>>>> >
>>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >
>>>>>> >
>>>>>> > score.i(3.1, 0, 10)
>>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > score.end();
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > www.peimankhosravi.co.uk
>>>>>> >
>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>> > your email
>>>>>> > address in the 'follow' section.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> > wrote:
>>>>>> >>
>>>>>> >> Thanks for posting these. I'm definitely reading and running them.
>>>>>> >> Here's
>>>>>> >> an supported featured debugging feature that might help, which will
>>>>>> >> eventually be transformed into an official feature. To see what
>>>>>> >> data is
>>>>>> >> currently in the score object, do this:
>>>>>> >>
>>>>>> >> for L in score.score_data:
>>>>>> >>     print L
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>>>>>> >> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>
>>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>>>>>> >>> latest.
>>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>>>>>> >>> probably not
>>>>>> >>> the most efficient of doing it.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> from csd.pysco import PythonScore
>>>>>> >>> from random import choice
>>>>>> >>>
>>>>>> >>> score = PythonScore()
>>>>>> >>> cue = score.cue
>>>>>> >>>
>>>>>> >>> score.write('f1 0 8192 10 1')
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> def note(p1, p2, p3, list):
>>>>>> >>>
>>>>>> >>>     type = list.pop(1)
>>>>>> >>>
>>>>>> >>>     if "l" in type:
>>>>>> >>>         p7 = 1
>>>>>> >>>     else:
>>>>>> >>>         p7 = 0
>>>>>> >>>
>>>>>> >>>     p4 = list.pop(0)
>>>>>> >>>     linseg = list[0:]
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     score.i(p1, p2, p3)
>>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     for i in range(len(linseg)-4):
>>>>>> >>>
>>>>>> >>>         if i > 0:
>>>>>> >>>             i = i+1
>>>>>> >>>
>>>>>> >>>         t1 = linseg[i]
>>>>>> >>>         v1 = linseg[i+1]
>>>>>> >>>         t2 = linseg[i+2]
>>>>>> >>>         v2 = linseg[i+3]
>>>>>> >>>
>>>>>> >>>         start = t1
>>>>>> >>>         dur = t2-t1
>>>>>> >>>         point1 = v1
>>>>>> >>>         point2 = v2
>>>>>> >>>
>>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> score.end();
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> www.peimankhosravi.co.uk
>>>>>> >>>
>>>>>> >>> To receive emails about upcoming concerts visit this page & enter
>>>>>> >>> your
>>>>>> >>> email address in the 'follow' section.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> >>> wrote:
>>>>>> >>>>
>>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>>>>>> >>>> examples in
>>>>>> >>>> the master branch of the CSD module:
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>>> >>>>
>>>>>> >>>> The plan is to create/collect lots of examples as a way to start
>>>>>> >>>> identifying some of the design patterns that Python brings to the
>>>>>> >>>> score
>>>>>> >>>> environment. Once enough are collected and we have a sense of
>>>>>> >>>> good ways of
>>>>>> >>>> approaching common problems, functions and classes that reside in
>>>>>> >>>> these
>>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and placed
>>>>>> >>>> into
>>>>>> >>>> modules that come with CSD. The examples will be updated in the
>>>>>> >>>> process.
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>>>>>> >>>> <jacobjoaquin@gmail.com>
>>>>>> >>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> Here is another approach:
>>>>>> >>>>>
>>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>> >>>>>
>>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>>>>>> >>>>> include
>>>>>> >>>>> it as an example case with PythonScore. In the meantime, here's
>>>>>> >>>>> the
>>>>>> >>>>> explanation of how it works.
>>>>>> >>>>>
>>>>>> >>>>> Envelope shapes are generated as tables. They are created
>>>>>> >>>>> dynamically
>>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>>>>>> >>>>> they're being
>>>>>> >>>>> played, I created the table_cycler that cycles through a range
>>>>>> >>>>> of table
>>>>>> >>>>> indexes every time a new table is created. In this case, the
>>>>>> >>>>> range is
>>>>>> >>>>> between 100 and 120.
>>>>>> >>>>>
>>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>>>>>> >>>>>
>>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>>>>>> >>>>> list of
>>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>>>>>> >>>>> args are the
>>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>>>>>> >>>>> event pfields
>>>>>> >>>>> are automatically handled:
>>>>>> >>>>>
>>>>>> >>>>> def gen_envelope(*args):
>>>>>> >>>>>     global table_cycler
>>>>>> >>>>>
>>>>>> >>>>>     table = table_cycler.next()
>>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>>>>>> >>>>>     return table
>>>>>> >>>>>
>>>>>> >>>>> That function returns the number of the table generated. So a
>>>>>> >>>>> value
>>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>>>>>> >>>>> performance,
>>>>>> >>>>> you'll see it cycle through this range.
>>>>>> >>>>>
>>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>>>>>> >>>>> first 5
>>>>>> >>>>> notes in the score demo this explicitly:
>>>>>> >>>>>
>>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1,
>>>>>> >>>>> 7991,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>>
>>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>>>>>> >>>>> pattern
>>>>>> >>>>> and an envelope pattern.
>>>>>> >>>>>
>>>>>> >>>>> Best,
>>>>>> >>>>> Jake
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>>>>>> >>>>> <jacobjoaquin@gmail.com>
>>>>>> >>>>> wrote:
>>>>>> >>>>>>
>>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>>>>>> >>>>>> arrays in C6
>>>>>> >>>>>> will support something like the following. To solve the problem
>>>>>> >>>>>> you
>>>>>> >>>>>> presented, I think it would require two things. First, the
>>>>>> >>>>>> ability to pass
>>>>>> >>>>>> an as a pfield in the score:
>>>>>> >>>>>>
>>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>> >>>>>>
>>>>>> >>>>>> And then in the score, pass the array in as a list of args for
>>>>>> >>>>>> opcodes:
>>>>>> >>>>>>
>>>>>> >>>>>> ienvpoints getarray p6
>>>>>> >>>>>> kenv linseg *ienvpoints
>>>>>> >>>>>>
>>>>>> >>>>>> There may need to be a third step required for scaling the even
>>>>>> >>>>>> fields
>>>>>> >>>>>> of the array, though is probably already supported by orchestra
>>>>>> >>>>>> loop
>>>>>> >>>>>> statements.
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>
>>>>>> >>>>>>> Thanks very much Steven,
>>>>>> >>>>>>>
>>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>>>>>> >>>>>>> initial
>>>>>> >>>>>>> impression is that this is possibly too convoluted for quick
>>>>>> >>>>>>> and dirty
>>>>>> >>>>>>> experimentation. I think it should be easier than that. Maybe
>>>>>> >>>>>>> with array in
>>>>>> >>>>>>> csound6 it will be possible?
>>>>>> >>>>>>>
>>>>>> >>>>>>> Cheers,
>>>>>> >>>>>>> Peiman
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> www.peimankhosravi.co.uk
>>>>>> >>>>>>>
>>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>> enter
>>>>>> >>>>>>> your email address in the 'follow' section.
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hi Peiman,
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> I've done a couple of ways using score generation:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a pfield
>>>>>> >>>>>>>> that
>>>>>> >>>>>>>> is
>>>>>> >>>>>>>> used as an index to choose what envelope to generate
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>>>>>> >>>>>>>> numbers
>>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment becomes
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic streams.
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> used this in pieces (you can check
>>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>>>>>> >>>>>>>> "StrA -
>>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>>>>>> >>>>>>>> group
>>>>>> >>>>>>>> glissandi sounds.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit tricky,
>>>>>> >>>>>>>> but
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>> >>>>>>>> building
>>>>>> >>>>>>>> instruments that will work with different p-fields given for
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>> >>>>>>>> 5-fields,
>>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>>>>>> >>>>>>>> work with
>>>>>> >>>>>>>> live, for quick sketching, or for generation.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> For example, code from my current piece uses:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> def scoreFunc():
>>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>>>>>> >>>>>>>> (10,-50)]),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>>>>>> >>>>>>>> (10,-50)]))
>>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     return createUnstableGroup3(50,
>>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>>>>>> >>>>>>>> functions to
>>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>>>>>> >>>>>>>> generate
>>>>>> >>>>>>>> notes like:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> If that's of use, I can post some more of the code or create
>>>>>> >>>>>>>> a more
>>>>>> >>>>>>>> isolated example from my piece.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hope that helps!
>>>>>> >>>>>>>> steven
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>>>>>> >>>>>>>> > managed
>>>>>> >>>>>>>> > to make a
>>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now for
>>>>>> >>>>>>>> > the next
>>>>>> >>>>>>>> > step.
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>>>>>> >>>>>>>> > alongside
>>>>>> >>>>>>>> > PythonScore. It's great for generating score event but what
>>>>>> >>>>>>>> > if you
>>>>>> >>>>>>>> > also want
>>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>>>>>> >>>>>>>> > segments for
>>>>>> >>>>>>>> > each
>>>>>> >>>>>>>> > note? What if you want the envelop function to be generated
>>>>>> >>>>>>>> > by a
>>>>>> >>>>>>>> > python
>>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>>>>>> >>>>>>>> > think.
>>>>>> >>>>>>>> > What are the
>>>>>> >>>>>>>> > options? I
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Thanks
>>>>>> >>>>>>>> > P
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>>> > enter
>>>>>> >>>>>>>> > your email
>>>>>> >>>>>>>> > address in the 'follow' section.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> >>>>>>>> "unsubscribe csound"
>>>>>> >>>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> --
>>>>>> >>>>>> codehop.com | #code #art #music
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> codehop.com | #code #art #music
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> codehop.com | #code #art #music
>>>>>> >>>
>>>>>> >>>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> --
>>>>>> >> codehop.com | #code #art #music
>>>>>> >
>>>>>> >
>>>>>>
>>>>>>
>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>
>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> Discussions of bugs and features can be posted here
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe csound"
>>>>>>
>>>>>
>>>>
>>>
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
codehop.com | #code #art #music

Date2013-04-20 00:45
Frompeiman khosravi
SubjectRe: [Csnd] more python
+1

But would this be possible when not using the API?

P






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 20 April 2013 00:04, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I second this.


On Fri, Apr 19, 2013 at 3:59 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:
I was thinking it would be great if when you send a score event text, you got back an id, which you could then use to remove the scheduled notes from the scheduler.

Would that be too complicated? It would make retracting a set of events scheduled into the future easier.

Cheers,
Andrés


On Fri, Apr 19, 2013 at 5:23 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Steven,

On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Nice webpage!  Any thought to adding RSS or Atom so people can
subscribe to the page?

I don't know how to do this, other than linking to an external blog. I'm making everything in a text editor and my html skills are minimal! it seems like a good idea to link to a wordpress page though. Unless you have a better suggestions. 
 
 

As for polyphonic management, I use my orchestral composition library
[1] to do this.  The library is quite small.  There are Performer
objects that have things like instrument numbers assigned to them.
Each performer might have an instr num like "1.01" or "1.03". The
Performer has a space attribute and amplitude adjustment attribute.
The layers of the library allow for notes to be generated and the
Performer to "perform" the notes, applying their amp, space, and instr
num to the notes.  Other things can be applied here too. The
processing is like this

NoteGenerator => [notes] => Performer => [modified notes] => output


Sounds nice. I must have a look. I have the book so I'll have a read later. And thanks for the link to the python library,


 
I'm not sure if Jake's CSD library works to return note objects/lists
that you can further manipulate or not.  If so, then you could create
your own function to decorate the contents of the list with further
values.

I realize though re-reading your email that this technique isn't quite
automatic polyphony management per-se, but might be useful.

Cheers!
steven

[1] This orchestra library is described in my chapter in "The Audio
Programming Book".  The python library is browsable online at:
http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/


On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> I've added a little something here:
> http://www.peimankhosravi.co.uk/miscellaneous.html
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>
>> Here's an improved version:
>> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>>
>> Now the question is how to have an automated polyphonic management so one
>> doesn't need to bother writing in the fractional part of the instrument
>> manually?
>>
>> An another question: how to make other types of interpolation, say, for
>> creating a periodic LFO sine function?
>>
>> Cheers,
>> P
>>
>>
>>
>>
>>
>>
>>
>> www.peimankhosravi.co.uk
>>
>> To receive emails about upcoming concerts visit this page & enter your
>> email address in the 'follow' section.
>>
>>
>>
>> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>
>>> BTW I'm totally a convert to python. What a beauty. I don't know what
>>> those SC3 people are doing! Honestly!
>>>
>>> All I need to do now is to make the function into a class and the next
>>> time just write:
>>>
>>>
>>> <CsScore bin="python">
>>> from csd.pysco import PythonScore
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 32768 10 1')
>>>
>>> with cue(0):
>>>     score.i(3.1, 0, 10)
>>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>>>
>>> score.end();
>>> </CsScore>
>>>
>>> What's more, one could have as many 'parameters' as one wishes without
>>> defining any extra functions in python.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>>
>>>> In fact what I had was also stupid on so many other levels! This is the
>>>> corrected one (attached). Also added amplitude automation.
>>>>
>>>> P
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>>>> wrote:
>>>>>
>>>>> Thanks Steven,
>>>>>
>>>>> I really appreciate that. Super useful!
>>>>>
>>>>> All the best,
>>>>> Peiman
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> www.peimankhosravi.co.uk
>>>>>
>>>>> To receive emails about upcoming concerts visit this page & enter your
>>>>> email address in the 'follow' section.
>>>>>
>>>>>
>>>>>
>>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>
>>>>>> Hi Peiman,
>>>>>>
>>>>>> Thought I'd mention, you may want to consider using formatting strings
>>>>>> [1] to modify:
>>>>>>
>>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>>
>>>>>> to:
>>>>>>
>>>>>>     paramName = '"%s.%g"'%(p4, p1)
>>>>>>
>>>>>> You may also want to use list slicing  [2] with multiple assignment
>>>>>> [2] to do something like this:
>>>>>>
>>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>>>>>>
>>>>>> String formatting is good to know as you can get a lot of control
>>>>>> about the string formatting, and the template string can be easier to
>>>>>> use and understand, especially when using a lot of replacement values.
>>>>>>  List slicing and multiple assignment are also handy syntax sugar to
>>>>>> write more terser code.
>>>>>>
>>>>>> Hope that's useful!
>>>>>> steven
>>>>>>
>>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> > No thank you and Steven for all your comments and contributions.
>>>>>> >
>>>>>> > I've had enough of staring at the computer tonight. Here's the
>>>>>> > latest
>>>>>> > function I came up with.
>>>>>> >
>>>>>> > Best,
>>>>>> > P
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > from csd.pysco import PythonScore
>>>>>> > from random import choice
>>>>>> >
>>>>>> > score = PythonScore()
>>>>>> > cue = score.cue
>>>>>> >
>>>>>> > score.write('f1 0 8192 10 1')
>>>>>> >
>>>>>> > def parameter(p1, name, type, envelope):
>>>>>> >
>>>>>> >
>>>>>> >     if "l" in type:
>>>>>> >         p7 = 1
>>>>>> >     else:
>>>>>> >         p7 = 0
>>>>>> >
>>>>>> >     p4 = name
>>>>>> >     linseg = envelope
>>>>>> >
>>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >
>>>>>> >     for i in range(len(linseg)-4):
>>>>>> >
>>>>>> >         if i > 0:
>>>>>> >             i = i+1
>>>>>> >
>>>>>> >         t1 = linseg[i]
>>>>>> >         v1 = linseg[i+1]
>>>>>> >         t2 = linseg[i+2]
>>>>>> >         v2 = linseg[i+3]
>>>>>> >         start = t1
>>>>>> >         dur = t2-t1
>>>>>> >         point1 = v1
>>>>>> >         point2 = v2
>>>>>> >
>>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >
>>>>>> >
>>>>>> > score.i(3.1, 0, 10)
>>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > score.end();
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > www.peimankhosravi.co.uk
>>>>>> >
>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>> > your email
>>>>>> > address in the 'follow' section.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> > wrote:
>>>>>> >>
>>>>>> >> Thanks for posting these. I'm definitely reading and running them.
>>>>>> >> Here's
>>>>>> >> an supported featured debugging feature that might help, which will
>>>>>> >> eventually be transformed into an official feature. To see what
>>>>>> >> data is
>>>>>> >> currently in the score object, do this:
>>>>>> >>
>>>>>> >> for L in score.score_data:
>>>>>> >>     print L
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>>>>>> >> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>
>>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>>>>>> >>> latest.
>>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>>>>>> >>> probably not
>>>>>> >>> the most efficient of doing it.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> from csd.pysco import PythonScore
>>>>>> >>> from random import choice
>>>>>> >>>
>>>>>> >>> score = PythonScore()
>>>>>> >>> cue = score.cue
>>>>>> >>>
>>>>>> >>> score.write('f1 0 8192 10 1')
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> def note(p1, p2, p3, list):
>>>>>> >>>
>>>>>> >>>     type = list.pop(1)
>>>>>> >>>
>>>>>> >>>     if "l" in type:
>>>>>> >>>         p7 = 1
>>>>>> >>>     else:
>>>>>> >>>         p7 = 0
>>>>>> >>>
>>>>>> >>>     p4 = list.pop(0)
>>>>>> >>>     linseg = list[0:]
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     score.i(p1, p2, p3)
>>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     for i in range(len(linseg)-4):
>>>>>> >>>
>>>>>> >>>         if i > 0:
>>>>>> >>>             i = i+1
>>>>>> >>>
>>>>>> >>>         t1 = linseg[i]
>>>>>> >>>         v1 = linseg[i+1]
>>>>>> >>>         t2 = linseg[i+2]
>>>>>> >>>         v2 = linseg[i+3]
>>>>>> >>>
>>>>>> >>>         start = t1
>>>>>> >>>         dur = t2-t1
>>>>>> >>>         point1 = v1
>>>>>> >>>         point2 = v2
>>>>>> >>>
>>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> score.end();
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> www.peimankhosravi.co.uk
>>>>>> >>>
>>>>>> >>> To receive emails about upcoming concerts visit this page & enter
>>>>>> >>> your
>>>>>> >>> email address in the 'follow' section.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> >>> wrote:
>>>>>> >>>>
>>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>>>>>> >>>> examples in
>>>>>> >>>> the master branch of the CSD module:
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>>> >>>>
>>>>>> >>>> The plan is to create/collect lots of examples as a way to start
>>>>>> >>>> identifying some of the design patterns that Python brings to the
>>>>>> >>>> score
>>>>>> >>>> environment. Once enough are collected and we have a sense of
>>>>>> >>>> good ways of
>>>>>> >>>> approaching common problems, functions and classes that reside in
>>>>>> >>>> these
>>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and placed
>>>>>> >>>> into
>>>>>> >>>> modules that come with CSD. The examples will be updated in the
>>>>>> >>>> process.
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>>>>>> >>>> <jacobjoaquin@gmail.com>
>>>>>> >>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> Here is another approach:
>>>>>> >>>>>
>>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>> >>>>>
>>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>>>>>> >>>>> include
>>>>>> >>>>> it as an example case with PythonScore. In the meantime, here's
>>>>>> >>>>> the
>>>>>> >>>>> explanation of how it works.
>>>>>> >>>>>
>>>>>> >>>>> Envelope shapes are generated as tables. They are created
>>>>>> >>>>> dynamically
>>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>>>>>> >>>>> they're being
>>>>>> >>>>> played, I created the table_cycler that cycles through a range
>>>>>> >>>>> of table
>>>>>> >>>>> indexes every time a new table is created. In this case, the
>>>>>> >>>>> range is
>>>>>> >>>>> between 100 and 120.
>>>>>> >>>>>
>>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>>>>>> >>>>>
>>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>>>>>> >>>>> list of
>>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>>>>>> >>>>> args are the
>>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>>>>>> >>>>> event pfields
>>>>>> >>>>> are automatically handled:
>>>>>> >>>>>
>>>>>> >>>>> def gen_envelope(*args):
>>>>>> >>>>>     global table_cycler
>>>>>> >>>>>
>>>>>> >>>>>     table = table_cycler.next()
>>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>>>>>> >>>>>     return table
>>>>>> >>>>>
>>>>>> >>>>> That function returns the number of the table generated. So a
>>>>>> >>>>> value
>>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>>>>>> >>>>> performance,
>>>>>> >>>>> you'll see it cycle through this range.
>>>>>> >>>>>
>>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>>>>>> >>>>> first 5
>>>>>> >>>>> notes in the score demo this explicitly:
>>>>>> >>>>>
>>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1,
>>>>>> >>>>> 7991,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>>
>>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>>>>>> >>>>> pattern
>>>>>> >>>>> and an envelope pattern.
>>>>>> >>>>>
>>>>>> >>>>> Best,
>>>>>> >>>>> Jake
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>>>>>> >>>>> <jacobjoaquin@gmail.com>
>>>>>> >>>>> wrote:
>>>>>> >>>>>>
>>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>>>>>> >>>>>> arrays in C6
>>>>>> >>>>>> will support something like the following. To solve the problem
>>>>>> >>>>>> you
>>>>>> >>>>>> presented, I think it would require two things. First, the
>>>>>> >>>>>> ability to pass
>>>>>> >>>>>> an as a pfield in the score:
>>>>>> >>>>>>
>>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>> >>>>>>
>>>>>> >>>>>> And then in the score, pass the array in as a list of args for
>>>>>> >>>>>> opcodes:
>>>>>> >>>>>>
>>>>>> >>>>>> ienvpoints getarray p6
>>>>>> >>>>>> kenv linseg *ienvpoints
>>>>>> >>>>>>
>>>>>> >>>>>> There may need to be a third step required for scaling the even
>>>>>> >>>>>> fields
>>>>>> >>>>>> of the array, though is probably already supported by orchestra
>>>>>> >>>>>> loop
>>>>>> >>>>>> statements.
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>
>>>>>> >>>>>>> Thanks very much Steven,
>>>>>> >>>>>>>
>>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>>>>>> >>>>>>> initial
>>>>>> >>>>>>> impression is that this is possibly too convoluted for quick
>>>>>> >>>>>>> and dirty
>>>>>> >>>>>>> experimentation. I think it should be easier than that. Maybe
>>>>>> >>>>>>> with array in
>>>>>> >>>>>>> csound6 it will be possible?
>>>>>> >>>>>>>
>>>>>> >>>>>>> Cheers,
>>>>>> >>>>>>> Peiman
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> www.peimankhosravi.co.uk
>>>>>> >>>>>>>
>>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>> enter
>>>>>> >>>>>>> your email address in the 'follow' section.
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hi Peiman,
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> I've done a couple of ways using score generation:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a pfield
>>>>>> >>>>>>>> that
>>>>>> >>>>>>>> is
>>>>>> >>>>>>>> used as an index to choose what envelope to generate
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>>>>>> >>>>>>>> numbers
>>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment becomes
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic streams.
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> used this in pieces (you can check
>>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>>>>>> >>>>>>>> "StrA -
>>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>>>>>> >>>>>>>> group
>>>>>> >>>>>>>> glissandi sounds.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit tricky,
>>>>>> >>>>>>>> but
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>> >>>>>>>> building
>>>>>> >>>>>>>> instruments that will work with different p-fields given for
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>> >>>>>>>> 5-fields,
>>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>>>>>> >>>>>>>> work with
>>>>>> >>>>>>>> live, for quick sketching, or for generation.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> For example, code from my current piece uses:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> def scoreFunc():
>>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>>>>>> >>>>>>>> (10,-50)]),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>>>>>> >>>>>>>> (10,-50)]))
>>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     return createUnstableGroup3(50,
>>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>>>>>> >>>>>>>> functions to
>>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>>>>>> >>>>>>>> generate
>>>>>> >>>>>>>> notes like:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> If that's of use, I can post some more of the code or create
>>>>>> >>>>>>>> a more
>>>>>> >>>>>>>> isolated example from my piece.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hope that helps!
>>>>>> >>>>>>>> steven
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>>>>>> >>>>>>>> > managed
>>>>>> >>>>>>>> > to make a
>>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now for
>>>>>> >>>>>>>> > the next
>>>>>> >>>>>>>> > step.
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>>>>>> >>>>>>>> > alongside
>>>>>> >>>>>>>> > PythonScore. It's great for generating score event but what
>>>>>> >>>>>>>> > if you
>>>>>> >>>>>>>> > also want
>>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>>>>>> >>>>>>>> > segments for
>>>>>> >>>>>>>> > each
>>>>>> >>>>>>>> > note? What if you want the envelop function to be generated
>>>>>> >>>>>>>> > by a
>>>>>> >>>>>>>> > python
>>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>>>>>> >>>>>>>> > think.
>>>>>> >>>>>>>> > What are the
>>>>>> >>>>>>>> > options? I
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Thanks
>>>>>> >>>>>>>> > P
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>>> > enter
>>>>>> >>>>>>>> > your email
>>>>>> >>>>>>>> > address in the 'follow' section.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> >>>>>>>> "unsubscribe csound"
>>>>>> >>>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> --
>>>>>> >>>>>> codehop.com | #code #art #music
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> codehop.com | #code #art #music
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> codehop.com | #code #art #music
>>>>>> >>>
>>>>>> >>>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> --
>>>>>> >> codehop.com | #code #art #music
>>>>>> >
>>>>>> >
>>>>>>
>>>>>>
>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>
>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> Discussions of bugs and features can be posted here
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe csound"
>>>>>>
>>>>>
>>>>
>>>
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
codehop.com | #code #art #music


Date2013-04-20 00:56
Frompeiman khosravi
SubjectRe: [Csnd] more python
To answer my own question, yes of course it would be! Some sort of global variable.






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 20 April 2013 00:45, peiman khosravi <peimankhosravi@gmail.com> wrote:
+1

But would this be possible when not using the API?

P






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 20 April 2013 00:04, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I second this.


On Fri, Apr 19, 2013 at 3:59 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:
I was thinking it would be great if when you send a score event text, you got back an id, which you could then use to remove the scheduled notes from the scheduler.

Would that be too complicated? It would make retracting a set of events scheduled into the future easier.

Cheers,
Andrés


On Fri, Apr 19, 2013 at 5:23 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Steven,

On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Nice webpage!  Any thought to adding RSS or Atom so people can
subscribe to the page?

I don't know how to do this, other than linking to an external blog. I'm making everything in a text editor and my html skills are minimal! it seems like a good idea to link to a wordpress page though. Unless you have a better suggestions. 
 
 

As for polyphonic management, I use my orchestral composition library
[1] to do this.  The library is quite small.  There are Performer
objects that have things like instrument numbers assigned to them.
Each performer might have an instr num like "1.01" or "1.03". The
Performer has a space attribute and amplitude adjustment attribute.
The layers of the library allow for notes to be generated and the
Performer to "perform" the notes, applying their amp, space, and instr
num to the notes.  Other things can be applied here too. The
processing is like this

NoteGenerator => [notes] => Performer => [modified notes] => output


Sounds nice. I must have a look. I have the book so I'll have a read later. And thanks for the link to the python library,


 
I'm not sure if Jake's CSD library works to return note objects/lists
that you can further manipulate or not.  If so, then you could create
your own function to decorate the contents of the list with further
values.

I realize though re-reading your email that this technique isn't quite
automatic polyphony management per-se, but might be useful.

Cheers!
steven

[1] This orchestra library is described in my chapter in "The Audio
Programming Book".  The python library is browsable online at:
http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/


On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> I've added a little something here:
> http://www.peimankhosravi.co.uk/miscellaneous.html
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>
>> Here's an improved version:
>> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>>
>> Now the question is how to have an automated polyphonic management so one
>> doesn't need to bother writing in the fractional part of the instrument
>> manually?
>>
>> An another question: how to make other types of interpolation, say, for
>> creating a periodic LFO sine function?
>>
>> Cheers,
>> P
>>
>>
>>
>>
>>
>>
>>
>> www.peimankhosravi.co.uk
>>
>> To receive emails about upcoming concerts visit this page & enter your
>> email address in the 'follow' section.
>>
>>
>>
>> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>
>>> BTW I'm totally a convert to python. What a beauty. I don't know what
>>> those SC3 people are doing! Honestly!
>>>
>>> All I need to do now is to make the function into a class and the next
>>> time just write:
>>>
>>>
>>> <CsScore bin="python">
>>> from csd.pysco import PythonScore
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 32768 10 1')
>>>
>>> with cue(0):
>>>     score.i(3.1, 0, 10)
>>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>>>
>>> score.end();
>>> </CsScore>
>>>
>>> What's more, one could have as many 'parameters' as one wishes without
>>> defining any extra functions in python.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>>
>>>> In fact what I had was also stupid on so many other levels! This is the
>>>> corrected one (attached). Also added amplitude automation.
>>>>
>>>> P
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>>>> wrote:
>>>>>
>>>>> Thanks Steven,
>>>>>
>>>>> I really appreciate that. Super useful!
>>>>>
>>>>> All the best,
>>>>> Peiman
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> www.peimankhosravi.co.uk
>>>>>
>>>>> To receive emails about upcoming concerts visit this page & enter your
>>>>> email address in the 'follow' section.
>>>>>
>>>>>
>>>>>
>>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>
>>>>>> Hi Peiman,
>>>>>>
>>>>>> Thought I'd mention, you may want to consider using formatting strings
>>>>>> [1] to modify:
>>>>>>
>>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>>
>>>>>> to:
>>>>>>
>>>>>>     paramName = '"%s.%g"'%(p4, p1)
>>>>>>
>>>>>> You may also want to use list slicing  [2] with multiple assignment
>>>>>> [2] to do something like this:
>>>>>>
>>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>>>>>>
>>>>>> String formatting is good to know as you can get a lot of control
>>>>>> about the string formatting, and the template string can be easier to
>>>>>> use and understand, especially when using a lot of replacement values.
>>>>>>  List slicing and multiple assignment are also handy syntax sugar to
>>>>>> write more terser code.
>>>>>>
>>>>>> Hope that's useful!
>>>>>> steven
>>>>>>
>>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> > No thank you and Steven for all your comments and contributions.
>>>>>> >
>>>>>> > I've had enough of staring at the computer tonight. Here's the
>>>>>> > latest
>>>>>> > function I came up with.
>>>>>> >
>>>>>> > Best,
>>>>>> > P
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > from csd.pysco import PythonScore
>>>>>> > from random import choice
>>>>>> >
>>>>>> > score = PythonScore()
>>>>>> > cue = score.cue
>>>>>> >
>>>>>> > score.write('f1 0 8192 10 1')
>>>>>> >
>>>>>> > def parameter(p1, name, type, envelope):
>>>>>> >
>>>>>> >
>>>>>> >     if "l" in type:
>>>>>> >         p7 = 1
>>>>>> >     else:
>>>>>> >         p7 = 0
>>>>>> >
>>>>>> >     p4 = name
>>>>>> >     linseg = envelope
>>>>>> >
>>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >
>>>>>> >     for i in range(len(linseg)-4):
>>>>>> >
>>>>>> >         if i > 0:
>>>>>> >             i = i+1
>>>>>> >
>>>>>> >         t1 = linseg[i]
>>>>>> >         v1 = linseg[i+1]
>>>>>> >         t2 = linseg[i+2]
>>>>>> >         v2 = linseg[i+3]
>>>>>> >         start = t1
>>>>>> >         dur = t2-t1
>>>>>> >         point1 = v1
>>>>>> >         point2 = v2
>>>>>> >
>>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >
>>>>>> >
>>>>>> > score.i(3.1, 0, 10)
>>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > score.end();
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > www.peimankhosravi.co.uk
>>>>>> >
>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>> > your email
>>>>>> > address in the 'follow' section.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> > wrote:
>>>>>> >>
>>>>>> >> Thanks for posting these. I'm definitely reading and running them.
>>>>>> >> Here's
>>>>>> >> an supported featured debugging feature that might help, which will
>>>>>> >> eventually be transformed into an official feature. To see what
>>>>>> >> data is
>>>>>> >> currently in the score object, do this:
>>>>>> >>
>>>>>> >> for L in score.score_data:
>>>>>> >>     print L
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>>>>>> >> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>
>>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>>>>>> >>> latest.
>>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>>>>>> >>> probably not
>>>>>> >>> the most efficient of doing it.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> from csd.pysco import PythonScore
>>>>>> >>> from random import choice
>>>>>> >>>
>>>>>> >>> score = PythonScore()
>>>>>> >>> cue = score.cue
>>>>>> >>>
>>>>>> >>> score.write('f1 0 8192 10 1')
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> def note(p1, p2, p3, list):
>>>>>> >>>
>>>>>> >>>     type = list.pop(1)
>>>>>> >>>
>>>>>> >>>     if "l" in type:
>>>>>> >>>         p7 = 1
>>>>>> >>>     else:
>>>>>> >>>         p7 = 0
>>>>>> >>>
>>>>>> >>>     p4 = list.pop(0)
>>>>>> >>>     linseg = list[0:]
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     score.i(p1, p2, p3)
>>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     for i in range(len(linseg)-4):
>>>>>> >>>
>>>>>> >>>         if i > 0:
>>>>>> >>>             i = i+1
>>>>>> >>>
>>>>>> >>>         t1 = linseg[i]
>>>>>> >>>         v1 = linseg[i+1]
>>>>>> >>>         t2 = linseg[i+2]
>>>>>> >>>         v2 = linseg[i+3]
>>>>>> >>>
>>>>>> >>>         start = t1
>>>>>> >>>         dur = t2-t1
>>>>>> >>>         point1 = v1
>>>>>> >>>         point2 = v2
>>>>>> >>>
>>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> score.end();
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> www.peimankhosravi.co.uk
>>>>>> >>>
>>>>>> >>> To receive emails about upcoming concerts visit this page & enter
>>>>>> >>> your
>>>>>> >>> email address in the 'follow' section.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> >>> wrote:
>>>>>> >>>>
>>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>>>>>> >>>> examples in
>>>>>> >>>> the master branch of the CSD module:
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>>> >>>>
>>>>>> >>>> The plan is to create/collect lots of examples as a way to start
>>>>>> >>>> identifying some of the design patterns that Python brings to the
>>>>>> >>>> score
>>>>>> >>>> environment. Once enough are collected and we have a sense of
>>>>>> >>>> good ways of
>>>>>> >>>> approaching common problems, functions and classes that reside in
>>>>>> >>>> these
>>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and placed
>>>>>> >>>> into
>>>>>> >>>> modules that come with CSD. The examples will be updated in the
>>>>>> >>>> process.
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>>>>>> >>>> <jacobjoaquin@gmail.com>
>>>>>> >>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> Here is another approach:
>>>>>> >>>>>
>>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>> >>>>>
>>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>>>>>> >>>>> include
>>>>>> >>>>> it as an example case with PythonScore. In the meantime, here's
>>>>>> >>>>> the
>>>>>> >>>>> explanation of how it works.
>>>>>> >>>>>
>>>>>> >>>>> Envelope shapes are generated as tables. They are created
>>>>>> >>>>> dynamically
>>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>>>>>> >>>>> they're being
>>>>>> >>>>> played, I created the table_cycler that cycles through a range
>>>>>> >>>>> of table
>>>>>> >>>>> indexes every time a new table is created. In this case, the
>>>>>> >>>>> range is
>>>>>> >>>>> between 100 and 120.
>>>>>> >>>>>
>>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>>>>>> >>>>>
>>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>>>>>> >>>>> list of
>>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>>>>>> >>>>> args are the
>>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>>>>>> >>>>> event pfields
>>>>>> >>>>> are automatically handled:
>>>>>> >>>>>
>>>>>> >>>>> def gen_envelope(*args):
>>>>>> >>>>>     global table_cycler
>>>>>> >>>>>
>>>>>> >>>>>     table = table_cycler.next()
>>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>>>>>> >>>>>     return table
>>>>>> >>>>>
>>>>>> >>>>> That function returns the number of the table generated. So a
>>>>>> >>>>> value
>>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>>>>>> >>>>> performance,
>>>>>> >>>>> you'll see it cycle through this range.
>>>>>> >>>>>
>>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>>>>>> >>>>> first 5
>>>>>> >>>>> notes in the score demo this explicitly:
>>>>>> >>>>>
>>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1,
>>>>>> >>>>> 7991,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>>
>>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>>>>>> >>>>> pattern
>>>>>> >>>>> and an envelope pattern.
>>>>>> >>>>>
>>>>>> >>>>> Best,
>>>>>> >>>>> Jake
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>>>>>> >>>>> <jacobjoaquin@gmail.com>
>>>>>> >>>>> wrote:
>>>>>> >>>>>>
>>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>>>>>> >>>>>> arrays in C6
>>>>>> >>>>>> will support something like the following. To solve the problem
>>>>>> >>>>>> you
>>>>>> >>>>>> presented, I think it would require two things. First, the
>>>>>> >>>>>> ability to pass
>>>>>> >>>>>> an as a pfield in the score:
>>>>>> >>>>>>
>>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>> >>>>>>
>>>>>> >>>>>> And then in the score, pass the array in as a list of args for
>>>>>> >>>>>> opcodes:
>>>>>> >>>>>>
>>>>>> >>>>>> ienvpoints getarray p6
>>>>>> >>>>>> kenv linseg *ienvpoints
>>>>>> >>>>>>
>>>>>> >>>>>> There may need to be a third step required for scaling the even
>>>>>> >>>>>> fields
>>>>>> >>>>>> of the array, though is probably already supported by orchestra
>>>>>> >>>>>> loop
>>>>>> >>>>>> statements.
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>
>>>>>> >>>>>>> Thanks very much Steven,
>>>>>> >>>>>>>
>>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>>>>>> >>>>>>> initial
>>>>>> >>>>>>> impression is that this is possibly too convoluted for quick
>>>>>> >>>>>>> and dirty
>>>>>> >>>>>>> experimentation. I think it should be easier than that. Maybe
>>>>>> >>>>>>> with array in
>>>>>> >>>>>>> csound6 it will be possible?
>>>>>> >>>>>>>
>>>>>> >>>>>>> Cheers,
>>>>>> >>>>>>> Peiman
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> www.peimankhosravi.co.uk
>>>>>> >>>>>>>
>>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>> enter
>>>>>> >>>>>>> your email address in the 'follow' section.
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hi Peiman,
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> I've done a couple of ways using score generation:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a pfield
>>>>>> >>>>>>>> that
>>>>>> >>>>>>>> is
>>>>>> >>>>>>>> used as an index to choose what envelope to generate
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>>>>>> >>>>>>>> numbers
>>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment becomes
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic streams.
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> used this in pieces (you can check
>>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>>>>>> >>>>>>>> "StrA -
>>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>>>>>> >>>>>>>> group
>>>>>> >>>>>>>> glissandi sounds.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit tricky,
>>>>>> >>>>>>>> but
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>> >>>>>>>> building
>>>>>> >>>>>>>> instruments that will work with different p-fields given for
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>> >>>>>>>> 5-fields,
>>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>>>>>> >>>>>>>> work with
>>>>>> >>>>>>>> live, for quick sketching, or for generation.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> For example, code from my current piece uses:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> def scoreFunc():
>>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>>>>>> >>>>>>>> (10,-50)]),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>>>>>> >>>>>>>> (10,-50)]))
>>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     return createUnstableGroup3(50,
>>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>>>>>> >>>>>>>> functions to
>>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>>>>>> >>>>>>>> generate
>>>>>> >>>>>>>> notes like:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> If that's of use, I can post some more of the code or create
>>>>>> >>>>>>>> a more
>>>>>> >>>>>>>> isolated example from my piece.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hope that helps!
>>>>>> >>>>>>>> steven
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>>>>>> >>>>>>>> > managed
>>>>>> >>>>>>>> > to make a
>>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now for
>>>>>> >>>>>>>> > the next
>>>>>> >>>>>>>> > step.
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>>>>>> >>>>>>>> > alongside
>>>>>> >>>>>>>> > PythonScore. It's great for generating score event but what
>>>>>> >>>>>>>> > if you
>>>>>> >>>>>>>> > also want
>>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>>>>>> >>>>>>>> > segments for
>>>>>> >>>>>>>> > each
>>>>>> >>>>>>>> > note? What if you want the envelop function to be generated
>>>>>> >>>>>>>> > by a
>>>>>> >>>>>>>> > python
>>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>>>>>> >>>>>>>> > think.
>>>>>> >>>>>>>> > What are the
>>>>>> >>>>>>>> > options? I
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Thanks
>>>>>> >>>>>>>> > P
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>>> > enter
>>>>>> >>>>>>>> > your email
>>>>>> >>>>>>>> > address in the 'follow' section.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> >>>>>>>> "unsubscribe csound"
>>>>>> >>>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> --
>>>>>> >>>>>> codehop.com | #code #art #music
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> codehop.com | #code #art #music
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> codehop.com | #code #art #music
>>>>>> >>>
>>>>>> >>>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> --
>>>>>> >> codehop.com | #code #art #music
>>>>>> >
>>>>>> >
>>>>>>
>>>>>>
>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>
>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> Discussions of bugs and features can be posted here
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe csound"
>>>>>>
>>>>>
>>>>
>>>
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
codehop.com | #code #art #music



Date2013-04-20 01:50
FromAndres Cabrera
SubjectRe: [Csnd] more python
I would think so. A new opcode like scorelina that returned a value could be added.

Cheers,
Andrés


On Fri, Apr 19, 2013 at 4:56 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
To answer my own question, yes of course it would be! Some sort of global variable.






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 20 April 2013 00:45, peiman khosravi <peimankhosravi@gmail.com> wrote:
+1

But would this be possible when not using the API?

P






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 20 April 2013 00:04, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I second this.


On Fri, Apr 19, 2013 at 3:59 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:
I was thinking it would be great if when you send a score event text, you got back an id, which you could then use to remove the scheduled notes from the scheduler.

Would that be too complicated? It would make retracting a set of events scheduled into the future easier.

Cheers,
Andrés


On Fri, Apr 19, 2013 at 5:23 AM, peiman khosravi <peimankhosravi@gmail.com> wrote:
Thanks Steven,

On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Nice webpage!  Any thought to adding RSS or Atom so people can
subscribe to the page?

I don't know how to do this, other than linking to an external blog. I'm making everything in a text editor and my html skills are minimal! it seems like a good idea to link to a wordpress page though. Unless you have a better suggestions. 
 
 

As for polyphonic management, I use my orchestral composition library
[1] to do this.  The library is quite small.  There are Performer
objects that have things like instrument numbers assigned to them.
Each performer might have an instr num like "1.01" or "1.03". The
Performer has a space attribute and amplitude adjustment attribute.
The layers of the library allow for notes to be generated and the
Performer to "perform" the notes, applying their amp, space, and instr
num to the notes.  Other things can be applied here too. The
processing is like this

NoteGenerator => [notes] => Performer => [modified notes] => output


Sounds nice. I must have a look. I have the book so I'll have a read later. And thanks for the link to the python library,


 
I'm not sure if Jake's CSD library works to return note objects/lists
that you can further manipulate or not.  If so, then you could create
your own function to decorate the contents of the list with further
values.

I realize though re-reading your email that this technique isn't quite
automatic polyphony management per-se, but might be useful.

Cheers!
steven

[1] This orchestra library is described in my chapter in "The Audio
Programming Book".  The python library is browsable online at:
http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/


On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> I've added a little something here:
> http://www.peimankhosravi.co.uk/miscellaneous.html
> P
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>
>> Here's an improved version:
>> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>>
>> Now the question is how to have an automated polyphonic management so one
>> doesn't need to bother writing in the fractional part of the instrument
>> manually?
>>
>> An another question: how to make other types of interpolation, say, for
>> creating a periodic LFO sine function?
>>
>> Cheers,
>> P
>>
>>
>>
>>
>>
>>
>>
>> www.peimankhosravi.co.uk
>>
>> To receive emails about upcoming concerts visit this page & enter your
>> email address in the 'follow' section.
>>
>>
>>
>> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>
>>> BTW I'm totally a convert to python. What a beauty. I don't know what
>>> those SC3 people are doing! Honestly!
>>>
>>> All I need to do now is to make the function into a class and the next
>>> time just write:
>>>
>>>
>>> <CsScore bin="python">
>>> from csd.pysco import PythonScore
>>> score = PythonScore()
>>> cue = score.cue
>>>
>>> score.write('f1 0 32768 10 1')
>>>
>>> with cue(0):
>>>     score.i(3.1, 0, 10)
>>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>>>
>>> score.end();
>>> </CsScore>
>>>
>>> What's more, one could have as many 'parameters' as one wishes without
>>> defining any extra functions in python.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> www.peimankhosravi.co.uk
>>>
>>> To receive emails about upcoming concerts visit this page & enter your
>>> email address in the 'follow' section.
>>>
>>>
>>>
>>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com> wrote:
>>>>
>>>> In fact what I had was also stupid on so many other levels! This is the
>>>> corrected one (attached). Also added amplitude automation.
>>>>
>>>> P
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> www.peimankhosravi.co.uk
>>>>
>>>> To receive emails about upcoming concerts visit this page & enter your
>>>> email address in the 'follow' section.
>>>>
>>>>
>>>>
>>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>>>> wrote:
>>>>>
>>>>> Thanks Steven,
>>>>>
>>>>> I really appreciate that. Super useful!
>>>>>
>>>>> All the best,
>>>>> Peiman
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> www.peimankhosravi.co.uk
>>>>>
>>>>> To receive emails about upcoming concerts visit this page & enter your
>>>>> email address in the 'follow' section.
>>>>>
>>>>>
>>>>>
>>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>>
>>>>>> Hi Peiman,
>>>>>>
>>>>>> Thought I'd mention, you may want to consider using formatting strings
>>>>>> [1] to modify:
>>>>>>
>>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>>
>>>>>> to:
>>>>>>
>>>>>>     paramName = '"%s.%g"'%(p4, p1)
>>>>>>
>>>>>> You may also want to use list slicing  [2] with multiple assignment
>>>>>> [2] to do something like this:
>>>>>>
>>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>>>>>>
>>>>>> String formatting is good to know as you can get a lot of control
>>>>>> about the string formatting, and the template string can be easier to
>>>>>> use and understand, especially when using a lot of replacement values.
>>>>>>  List slicing and multiple assignment are also handy syntax sugar to
>>>>>> write more terser code.
>>>>>>
>>>>>> Hope that's useful!
>>>>>> steven
>>>>>>
>>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>>>>>>
>>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> > No thank you and Steven for all your comments and contributions.
>>>>>> >
>>>>>> > I've had enough of staring at the computer tonight. Here's the
>>>>>> > latest
>>>>>> > function I came up with.
>>>>>> >
>>>>>> > Best,
>>>>>> > P
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > from csd.pysco import PythonScore
>>>>>> > from random import choice
>>>>>> >
>>>>>> > score = PythonScore()
>>>>>> > cue = score.cue
>>>>>> >
>>>>>> > score.write('f1 0 8192 10 1')
>>>>>> >
>>>>>> > def parameter(p1, name, type, envelope):
>>>>>> >
>>>>>> >
>>>>>> >     if "l" in type:
>>>>>> >         p7 = 1
>>>>>> >     else:
>>>>>> >         p7 = 0
>>>>>> >
>>>>>> >     p4 = name
>>>>>> >     linseg = envelope
>>>>>> >
>>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >
>>>>>> >     for i in range(len(linseg)-4):
>>>>>> >
>>>>>> >         if i > 0:
>>>>>> >             i = i+1
>>>>>> >
>>>>>> >         t1 = linseg[i]
>>>>>> >         v1 = linseg[i+1]
>>>>>> >         t2 = linseg[i+2]
>>>>>> >         v2 = linseg[i+3]
>>>>>> >         start = t1
>>>>>> >         dur = t2-t1
>>>>>> >         point1 = v1
>>>>>> >         point2 = v2
>>>>>> >
>>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >
>>>>>> >
>>>>>> > score.i(3.1, 0, 10)
>>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > score.end();
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > www.peimankhosravi.co.uk
>>>>>> >
>>>>>> > To receive emails about upcoming concerts visit this page & enter
>>>>>> > your email
>>>>>> > address in the 'follow' section.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> > wrote:
>>>>>> >>
>>>>>> >> Thanks for posting these. I'm definitely reading and running them.
>>>>>> >> Here's
>>>>>> >> an supported featured debugging feature that might help, which will
>>>>>> >> eventually be transformed into an official feature. To see what
>>>>>> >> data is
>>>>>> >> currently in the score object, do this:
>>>>>> >>
>>>>>> >> for L in score.score_data:
>>>>>> >>     print L
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>>>>>> >> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>
>>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>>>>>> >>> latest.
>>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>>>>>> >>> probably not
>>>>>> >>> the most efficient of doing it.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> from csd.pysco import PythonScore
>>>>>> >>> from random import choice
>>>>>> >>>
>>>>>> >>> score = PythonScore()
>>>>>> >>> cue = score.cue
>>>>>> >>>
>>>>>> >>> score.write('f1 0 8192 10 1')
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> def note(p1, p2, p3, list):
>>>>>> >>>
>>>>>> >>>     type = list.pop(1)
>>>>>> >>>
>>>>>> >>>     if "l" in type:
>>>>>> >>>         p7 = 1
>>>>>> >>>     else:
>>>>>> >>>         p7 = 0
>>>>>> >>>
>>>>>> >>>     p4 = list.pop(0)
>>>>>> >>>     linseg = list[0:]
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     score.i(p1, p2, p3)
>>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>     for i in range(len(linseg)-4):
>>>>>> >>>
>>>>>> >>>         if i > 0:
>>>>>> >>>             i = i+1
>>>>>> >>>
>>>>>> >>>         t1 = linseg[i]
>>>>>> >>>         v1 = linseg[i+1]
>>>>>> >>>         t2 = linseg[i+2]
>>>>>> >>>         v2 = linseg[i+3]
>>>>>> >>>
>>>>>> >>>         start = t1
>>>>>> >>>         dur = t2-t1
>>>>>> >>>         point1 = v1
>>>>>> >>>         point2 = v2
>>>>>> >>>
>>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> score.end();
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> www.peimankhosravi.co.uk
>>>>>> >>>
>>>>>> >>> To receive emails about upcoming concerts visit this page & enter
>>>>>> >>> your
>>>>>> >>> email address in the 'follow' section.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>>>>>> >>> wrote:
>>>>>> >>>>
>>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>>>>>> >>>> examples in
>>>>>> >>>> the master branch of the CSD module:
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>>>>>> >>>>
>>>>>> >>>> The plan is to create/collect lots of examples as a way to start
>>>>>> >>>> identifying some of the design patterns that Python brings to the
>>>>>> >>>> score
>>>>>> >>>> environment. Once enough are collected and we have a sense of
>>>>>> >>>> good ways of
>>>>>> >>>> approaching common problems, functions and classes that reside in
>>>>>> >>>> these
>>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and placed
>>>>>> >>>> into
>>>>>> >>>> modules that come with CSD. The examples will be updated in the
>>>>>> >>>> process.
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>>>>>> >>>> <jacobjoaquin@gmail.com>
>>>>>> >>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> Here is another approach:
>>>>>> >>>>>
>>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>>>>>> >>>>>
>>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>>>>>> >>>>> include
>>>>>> >>>>> it as an example case with PythonScore. In the meantime, here's
>>>>>> >>>>> the
>>>>>> >>>>> explanation of how it works.
>>>>>> >>>>>
>>>>>> >>>>> Envelope shapes are generated as tables. They are created
>>>>>> >>>>> dynamically
>>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>>>>>> >>>>> they're being
>>>>>> >>>>> played, I created the table_cycler that cycles through a range
>>>>>> >>>>> of table
>>>>>> >>>>> indexes every time a new table is created. In this case, the
>>>>>> >>>>> range is
>>>>>> >>>>> between 100 and 120.
>>>>>> >>>>>
>>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>>>>>> >>>>>
>>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>>>>>> >>>>> list of
>>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>>>>>> >>>>> args are the
>>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>>>>>> >>>>> event pfields
>>>>>> >>>>> are automatically handled:
>>>>>> >>>>>
>>>>>> >>>>> def gen_envelope(*args):
>>>>>> >>>>>     global table_cycler
>>>>>> >>>>>
>>>>>> >>>>>     table = table_cycler.next()
>>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>>>>>> >>>>>     return table
>>>>>> >>>>>
>>>>>> >>>>> That function returns the number of the table generated. So a
>>>>>> >>>>> value
>>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>>>>>> >>>>> performance,
>>>>>> >>>>> you'll see it cycle through this range.
>>>>>> >>>>>
>>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>>>>>> >>>>> first 5
>>>>>> >>>>> notes in the score demo this explicitly:
>>>>>> >>>>>
>>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1, 8191,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100, 1,
>>>>>> >>>>> 7991,
>>>>>> >>>>> 0))
>>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1, 100,
>>>>>> >>>>> 0))
>>>>>> >>>>>
>>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>>>>>> >>>>> pattern
>>>>>> >>>>> and an envelope pattern.
>>>>>> >>>>>
>>>>>> >>>>> Best,
>>>>>> >>>>> Jake
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>>>>>> >>>>> <jacobjoaquin@gmail.com>
>>>>>> >>>>> wrote:
>>>>>> >>>>>>
>>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>>>>>> >>>>>> arrays in C6
>>>>>> >>>>>> will support something like the following. To solve the problem
>>>>>> >>>>>> you
>>>>>> >>>>>> presented, I think it would require two things. First, the
>>>>>> >>>>>> ability to pass
>>>>>> >>>>>> an as a pfield in the score:
>>>>>> >>>>>>
>>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>>>>>> >>>>>>
>>>>>> >>>>>> And then in the score, pass the array in as a list of args for
>>>>>> >>>>>> opcodes:
>>>>>> >>>>>>
>>>>>> >>>>>> ienvpoints getarray p6
>>>>>> >>>>>> kenv linseg *ienvpoints
>>>>>> >>>>>>
>>>>>> >>>>>> There may need to be a third step required for scaling the even
>>>>>> >>>>>> fields
>>>>>> >>>>>> of the array, though is probably already supported by orchestra
>>>>>> >>>>>> loop
>>>>>> >>>>>> statements.
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>
>>>>>> >>>>>>> Thanks very much Steven,
>>>>>> >>>>>>>
>>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>>>>>> >>>>>>> initial
>>>>>> >>>>>>> impression is that this is possibly too convoluted for quick
>>>>>> >>>>>>> and dirty
>>>>>> >>>>>>> experimentation. I think it should be easier than that. Maybe
>>>>>> >>>>>>> with array in
>>>>>> >>>>>>> csound6 it will be possible?
>>>>>> >>>>>>>
>>>>>> >>>>>>> Cheers,
>>>>>> >>>>>>> Peiman
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> www.peimankhosravi.co.uk
>>>>>> >>>>>>>
>>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>> enter
>>>>>> >>>>>>> your email address in the 'follow' section.
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com> wrote:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hi Peiman,
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> I've done a couple of ways using score generation:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a pfield
>>>>>> >>>>>>>> that
>>>>>> >>>>>>>> is
>>>>>> >>>>>>>> used as an index to choose what envelope to generate
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>>>>>> >>>>>>>> numbers
>>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment becomes
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic streams.
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> used this in pieces (you can check
>>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>>>>>> >>>>>>>> "StrA -
>>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>>>>>> >>>>>>>> group
>>>>>> >>>>>>>> glissandi sounds.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit tricky,
>>>>>> >>>>>>>> but
>>>>>> >>>>>>>> I've
>>>>>> >>>>>>>> got a set of UDO's now that I use together as a template when
>>>>>> >>>>>>>> building
>>>>>> >>>>>>>> instruments that will work with different p-fields given for
>>>>>> >>>>>>>> a note.
>>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score with
>>>>>> >>>>>>>> 5-fields,
>>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>>>>>> >>>>>>>> work with
>>>>>> >>>>>>>> live, for quick sketching, or for generation.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> For example, code from my current piece uses:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> def scoreFunc():
>>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>>>>>> >>>>>>>> (10,-50)]),
>>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>>>>>> >>>>>>>> (10,-50)]))
>>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>     return createUnstableGroup3(50,
>>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>>>>>> >>>>>>>> functions to
>>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>>>>>> >>>>>>>> generate
>>>>>> >>>>>>>> notes like:
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25 3
>>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327 -0.25
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>>>>>> >>>>>>>> -0.25 3
>>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2 3
>>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>>>>>> >>>>>>>> -0.2 3
>>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476 -0.2
>>>>>> >>>>>>>> 3
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> If that's of use, I can post some more of the code or create
>>>>>> >>>>>>>> a more
>>>>>> >>>>>>>> isolated example from my piece.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Hope that helps!
>>>>>> >>>>>>>> steven
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>>>>>> >>>>>>>> > managed
>>>>>> >>>>>>>> > to make a
>>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now for
>>>>>> >>>>>>>> > the next
>>>>>> >>>>>>>> > step.
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>>>>>> >>>>>>>> > alongside
>>>>>> >>>>>>>> > PythonScore. It's great for generating score event but what
>>>>>> >>>>>>>> > if you
>>>>>> >>>>>>>> > also want
>>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>>>>>> >>>>>>>> > segments for
>>>>>> >>>>>>>> > each
>>>>>> >>>>>>>> > note? What if you want the envelop function to be generated
>>>>>> >>>>>>>> > by a
>>>>>> >>>>>>>> > python
>>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>>>>>> >>>>>>>> > think.
>>>>>> >>>>>>>> > What are the
>>>>>> >>>>>>>> > options? I
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > Thanks
>>>>>> >>>>>>>> > P
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>>>>>> >>>>>>>> >
>>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this page &
>>>>>> >>>>>>>> > enter
>>>>>> >>>>>>>> > your email
>>>>>> >>>>>>>> > address in the 'follow' section.
>>>>>> >>>>>>>>
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> >>>>>>>> "unsubscribe csound"
>>>>>> >>>>>>>>
>>>>>> >>>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>> --
>>>>>> >>>>>> codehop.com | #code #art #music
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> codehop.com | #code #art #music
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> codehop.com | #code #art #music
>>>>>> >>>
>>>>>> >>>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> --
>>>>>> >> codehop.com | #code #art #music
>>>>>> >
>>>>>> >
>>>>>>
>>>>>>
>>>>>> Send bugs reports to the Sourceforge bug tracker
>>>>>>
>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>>> Discussions of bugs and features can be posted here
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe csound"
>>>>>>
>>>>>
>>>>
>>>
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
codehop.com | #code #art #music




Date2013-04-21 14:31
FromSteven Yi
SubjectRe: [Csnd] more python
Hi Peiman,

I use Wordpress for my own website and like it quite a bit. It has a
concept of pages and posts, the first being a static page (though can
have comments too), and posts that are for news/blog items.  I think
most blogging and Content Management System platforms have these
abstractions these days.  Making themes for Wordpress isn't so bad,
and there's plenty you can choose from to start with and then modify.
A bit harder than just doing straight HTML probably, but overall a lot
easier to manage a site IMO.

Maybe you could try setting up an account on wordpress.org and test
out the administration console, make some pages, etc.  to see if you
like using it.  Nice thing is its easy to setup and account and test
without having to install anything.

Cheers!
steven


On Fri, Apr 19, 2013 at 1:23 PM, peiman khosravi
 wrote:
> Thanks Steven,
>
> On 19 April 2013 12:58, Steven Yi  wrote:
>>
>> Hi Peiman,
>>
>> Nice webpage!  Any thought to adding RSS or Atom so people can
>> subscribe to the page?
>
>
> I don't know how to do this, other than linking to an external blog. I'm
> making everything in a text editor and my html skills are minimal! it seems
> like a good idea to link to a wordpress page though. Unless you have a
> better suggestions.
>
>
>>
>>
>> As for polyphonic management, I use my orchestral composition library
>> [1] to do this.  The library is quite small.  There are Performer
>> objects that have things like instrument numbers assigned to them.
>> Each performer might have an instr num like "1.01" or "1.03". The
>> Performer has a space attribute and amplitude adjustment attribute.
>> The layers of the library allow for notes to be generated and the
>> Performer to "perform" the notes, applying their amp, space, and instr
>> num to the notes.  Other things can be applied here too. The
>> processing is like this
>>
>> NoteGenerator => [notes] => Performer => [modified notes] => output
>>
>
> Sounds nice. I must have a look. I have the book so I'll have a read later.
> And thanks for the link to the python library,
>
> P
>
>>
>> I'm not sure if Jake's CSD library works to return note objects/lists
>> that you can further manipulate or not.  If so, then you could create
>> your own function to decorate the contents of the list with further
>> values.
>>
>> I realize though re-reading your email that this technique isn't quite
>> automatic polyphony management per-se, but might be useful.
>>
>> Cheers!
>> steven
>>
>> [1] This orchestra library is described in my chapter in "The Audio
>> Programming Book".  The python library is browsable online at:
>>
>> http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/
>>
>>
>> On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
>>  wrote:
>> > I've added a little something here:
>> > http://www.peimankhosravi.co.uk/miscellaneous.html
>> > P
>> >
>> >
>> >
>> >
>> >
>> >
>> > www.peimankhosravi.co.uk
>> >
>> > To receive emails about upcoming concerts visit this page & enter your
>> > email
>> > address in the 'follow' section.
>> >
>> >
>> >
>> > On 19 April 2013 10:45, peiman khosravi 
>> > wrote:
>> >>
>> >> Here's an improved version:
>> >> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>> >>
>> >> Now the question is how to have an automated polyphonic management so
>> >> one
>> >> doesn't need to bother writing in the fractional part of the instrument
>> >> manually?
>> >>
>> >> An another question: how to make other types of interpolation, say, for
>> >> creating a periodic LFO sine function?
>> >>
>> >> Cheers,
>> >> P
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> www.peimankhosravi.co.uk
>> >>
>> >> To receive emails about upcoming concerts visit this page & enter your
>> >> email address in the 'follow' section.
>> >>
>> >>
>> >>
>> >> On 19 April 2013 01:30, peiman khosravi 
>> >> wrote:
>> >>>
>> >>> BTW I'm totally a convert to python. What a beauty. I don't know what
>> >>> those SC3 people are doing! Honestly!
>> >>>
>> >>> All I need to do now is to make the function into a class and the next
>> >>> time just write:
>> >>>
>> >>>
>> >>> 
>> >>> from csd.pysco import PythonScore
>> >>> score = PythonScore()
>> >>> cue = score.cue
>> >>>
>> >>> score.write('f1 0 32768 10 1')
>> >>>
>> >>> with cue(0):
>> >>>     score.i(3.1, 0, 10)
>> >>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>> >>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>> >>>
>> >>> score.end();
>> >>> 
>> >>>
>> >>> What's more, one could have as many 'parameters' as one wishes without
>> >>> defining any extra functions in python.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> www.peimankhosravi.co.uk
>> >>>
>> >>> To receive emails about upcoming concerts visit this page & enter your
>> >>> email address in the 'follow' section.
>> >>>
>> >>>
>> >>>
>> >>> On 19 April 2013 01:17, peiman khosravi 
>> >>> wrote:
>> >>>>
>> >>>> In fact what I had was also stupid on so many other levels! This is
>> >>>> the
>> >>>> corrected one (attached). Also added amplitude automation.
>> >>>>
>> >>>> P
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> www.peimankhosravi.co.uk
>> >>>>
>> >>>> To receive emails about upcoming concerts visit this page & enter
>> >>>> your
>> >>>> email address in the 'follow' section.
>> >>>>
>> >>>>
>> >>>>
>> >>>> On 19 April 2013 00:07, peiman khosravi 
>> >>>> wrote:
>> >>>>>
>> >>>>> Thanks Steven,
>> >>>>>
>> >>>>> I really appreciate that. Super useful!
>> >>>>>
>> >>>>> All the best,
>> >>>>> Peiman
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> www.peimankhosravi.co.uk
>> >>>>>
>> >>>>> To receive emails about upcoming concerts visit this page & enter
>> >>>>> your
>> >>>>> email address in the 'follow' section.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> On 18 April 2013 23:45, Steven Yi  wrote:
>> >>>>>>
>> >>>>>> Hi Peiman,
>> >>>>>>
>> >>>>>> Thought I'd mention, you may want to consider using formatting
>> >>>>>> strings
>> >>>>>> [1] to modify:
>> >>>>>>
>> >>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>>
>> >>>>>> to:
>> >>>>>>
>> >>>>>>     paramName = '"%s.%g"'%(p4, p1)
>> >>>>>>
>> >>>>>> You may also want to use list slicing  [2] with multiple assignment
>> >>>>>> [2] to do something like this:
>> >>>>>>
>> >>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>> >>>>>>
>> >>>>>> String formatting is good to know as you can get a lot of control
>> >>>>>> about the string formatting, and the template string can be easier
>> >>>>>> to
>> >>>>>> use and understand, especially when using a lot of replacement
>> >>>>>> values.
>> >>>>>>  List slicing and multiple assignment are also handy syntax sugar
>> >>>>>> to
>> >>>>>> write more terser code.
>> >>>>>>
>> >>>>>> Hope that's useful!
>> >>>>>> steven
>> >>>>>>
>> >>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>> >>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>> >>>>>>
>> >>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>> >>>>>>  wrote:
>> >>>>>> > No thank you and Steven for all your comments and contributions.
>> >>>>>> >
>> >>>>>> > I've had enough of staring at the computer tonight. Here's the
>> >>>>>> > latest
>> >>>>>> > function I came up with.
>> >>>>>> >
>> >>>>>> > Best,
>> >>>>>> > P
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > from csd.pysco import PythonScore
>> >>>>>> > from random import choice
>> >>>>>> >
>> >>>>>> > score = PythonScore()
>> >>>>>> > cue = score.cue
>> >>>>>> >
>> >>>>>> > score.write('f1 0 8192 10 1')
>> >>>>>> >
>> >>>>>> > def parameter(p1, name, type, envelope):
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >     if "l" in type:
>> >>>>>> >         p7 = 1
>> >>>>>> >     else:
>> >>>>>> >         p7 = 0
>> >>>>>> >
>> >>>>>> >     p4 = name
>> >>>>>> >     linseg = envelope
>> >>>>>> >
>> >>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >
>> >>>>>> >     for i in range(len(linseg)-4):
>> >>>>>> >
>> >>>>>> >         if i > 0:
>> >>>>>> >             i = i+1
>> >>>>>> >
>> >>>>>> >         t1 = linseg[i]
>> >>>>>> >         v1 = linseg[i+1]
>> >>>>>> >         t2 = linseg[i+2]
>> >>>>>> >         v2 = linseg[i+3]
>> >>>>>> >         start = t1
>> >>>>>> >         dur = t2-t1
>> >>>>>> >         point1 = v1
>> >>>>>> >         point2 = v2
>> >>>>>> >
>> >>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.i(3.1, 0, 10)
>> >>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.end();
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >
>> >>>>>> > To receive emails about upcoming concerts visit this page & enter
>> >>>>>> > your email
>> >>>>>> > address in the 'follow' section.
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > On 18 April 2013 23:09, Jacob Joaquin 
>> >>>>>> > wrote:
>> >>>>>> >>
>> >>>>>> >> Thanks for posting these. I'm definitely reading and running
>> >>>>>> >> them.
>> >>>>>> >> Here's
>> >>>>>> >> an supported featured debugging feature that might help, which
>> >>>>>> >> will
>> >>>>>> >> eventually be transformed into an official feature. To see what
>> >>>>>> >> data is
>> >>>>>> >> currently in the score object, do this:
>> >>>>>> >>
>> >>>>>> >> for L in score.score_data:
>> >>>>>> >>     print L
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> >>>>>> >>  wrote:
>> >>>>>> >>>
>> >>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>> >>>>>> >>> latest.
>> >>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>> >>>>>> >>> probably not
>> >>>>>> >>> the most efficient of doing it.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> from csd.pysco import PythonScore
>> >>>>>> >>> from random import choice
>> >>>>>> >>>
>> >>>>>> >>> score = PythonScore()
>> >>>>>> >>> cue = score.cue
>> >>>>>> >>>
>> >>>>>> >>> score.write('f1 0 8192 10 1')
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> def note(p1, p2, p3, list):
>> >>>>>> >>>
>> >>>>>> >>>     type = list.pop(1)
>> >>>>>> >>>
>> >>>>>> >>>     if "l" in type:
>> >>>>>> >>>         p7 = 1
>> >>>>>> >>>     else:
>> >>>>>> >>>         p7 = 0
>> >>>>>> >>>
>> >>>>>> >>>     p4 = list.pop(0)
>> >>>>>> >>>     linseg = list[0:]
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     score.i(p1, p2, p3)
>> >>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     for i in range(len(linseg)-4):
>> >>>>>> >>>
>> >>>>>> >>>         if i > 0:
>> >>>>>> >>>             i = i+1
>> >>>>>> >>>
>> >>>>>> >>>         t1 = linseg[i]
>> >>>>>> >>>         v1 = linseg[i+1]
>> >>>>>> >>>         t2 = linseg[i+2]
>> >>>>>> >>>         v2 = linseg[i+3]
>> >>>>>> >>>
>> >>>>>> >>>         start = t1
>> >>>>>> >>>         dur = t2-t1
>> >>>>>> >>>         point1 = v1
>> >>>>>> >>>         point2 = v2
>> >>>>>> >>>
>> >>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> score.end();
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> www.peimankhosravi.co.uk
>> >>>>>> >>>
>> >>>>>> >>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>> enter
>> >>>>>> >>> your
>> >>>>>> >>> email address in the 'follow' section.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin 
>> >>>>>> >>> wrote:
>> >>>>>> >>>>
>> >>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>> >>>>>> >>>> examples in
>> >>>>>> >>>> the master branch of the CSD module:
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>> >>>>>> >>>>
>> >>>>>> >>>> The plan is to create/collect lots of examples as a way to
>> >>>>>> >>>> start
>> >>>>>> >>>> identifying some of the design patterns that Python brings to
>> >>>>>> >>>> the
>> >>>>>> >>>> score
>> >>>>>> >>>> environment. Once enough are collected and we have a sense of
>> >>>>>> >>>> good ways of
>> >>>>>> >>>> approaching common problems, functions and classes that reside
>> >>>>>> >>>> in
>> >>>>>> >>>> these
>> >>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and
>> >>>>>> >>>> placed
>> >>>>>> >>>> into
>> >>>>>> >>>> modules that come with CSD. The examples will be updated in
>> >>>>>> >>>> the
>> >>>>>> >>>> process.
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>> >>>>>> >>>> 
>> >>>>>> >>>> wrote:
>> >>>>>> >>>>>
>> >>>>>> >>>>> Here is another approach:
>> >>>>>> >>>>>
>> >>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>> >>>>>> >>>>>
>> >>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>> >>>>>> >>>>> include
>> >>>>>> >>>>> it as an example case with PythonScore. In the meantime,
>> >>>>>> >>>>> here's
>> >>>>>> >>>>> the
>> >>>>>> >>>>> explanation of how it works.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Envelope shapes are generated as tables. They are created
>> >>>>>> >>>>> dynamically
>> >>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>> >>>>>> >>>>> they're being
>> >>>>>> >>>>> played, I created the table_cycler that cycles through a
>> >>>>>> >>>>> range
>> >>>>>> >>>>> of table
>> >>>>>> >>>>> indexes every time a new table is created. In this case, the
>> >>>>>> >>>>> range is
>> >>>>>> >>>>> between 100 and 120.
>> >>>>>> >>>>>
>> >>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>> >>>>>> >>>>>
>> >>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>> >>>>>> >>>>> list of
>> >>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>> >>>>>> >>>>> args are the
>> >>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>> >>>>>> >>>>> event pfields
>> >>>>>> >>>>> are automatically handled:
>> >>>>>> >>>>>
>> >>>>>> >>>>> def gen_envelope(*args):
>> >>>>>> >>>>>     global table_cycler
>> >>>>>> >>>>>
>> >>>>>> >>>>>     table = table_cycler.next()
>> >>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>> >>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>> >>>>>> >>>>>     return table
>> >>>>>> >>>>>
>> >>>>>> >>>>> That function returns the number of the table generated. So a
>> >>>>>> >>>>> value
>> >>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>> >>>>>> >>>>> performance,
>> >>>>>> >>>>> you'll see it cycle through this range.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>> >>>>>> >>>>> first 5
>> >>>>>> >>>>> notes in the score demo this explicitly:
>> >>>>>> >>>>>
>> >>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1,
>> >>>>>> >>>>> 8191,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> >>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100,
>> >>>>>> >>>>> 1,
>> >>>>>> >>>>> 7991,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>>
>> >>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>> >>>>>> >>>>> pattern
>> >>>>>> >>>>> and an envelope pattern.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Best,
>> >>>>>> >>>>> Jake
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>> >>>>>> >>>>> 
>> >>>>>> >>>>> wrote:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>> >>>>>> >>>>>> arrays in C6
>> >>>>>> >>>>>> will support something like the following. To solve the
>> >>>>>> >>>>>> problem
>> >>>>>> >>>>>> you
>> >>>>>> >>>>>> presented, I think it would require two things. First, the
>> >>>>>> >>>>>> ability to pass
>> >>>>>> >>>>>> an as a pfield in the score:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> And then in the score, pass the array in as a list of args
>> >>>>>> >>>>>> for
>> >>>>>> >>>>>> opcodes:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> ienvpoints getarray p6
>> >>>>>> >>>>>> kenv linseg *ienvpoints
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> There may need to be a third step required for scaling the
>> >>>>>> >>>>>> even
>> >>>>>> >>>>>> fields
>> >>>>>> >>>>>> of the array, though is probably already supported by
>> >>>>>> >>>>>> orchestra
>> >>>>>> >>>>>> loop
>> >>>>>> >>>>>> statements.
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>> >>>>>> >>>>>>  wrote:
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Thanks very much Steven,
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>> >>>>>> >>>>>>> initial
>> >>>>>> >>>>>>> impression is that this is possibly too convoluted for
>> >>>>>> >>>>>>> quick
>> >>>>>> >>>>>>> and dirty
>> >>>>>> >>>>>>> experimentation. I think it should be easier than that.
>> >>>>>> >>>>>>> Maybe
>> >>>>>> >>>>>>> with array in
>> >>>>>> >>>>>>> csound6 it will be possible?
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Cheers,
>> >>>>>> >>>>>>> Peiman
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>>>>>> enter
>> >>>>>> >>>>>>> your email address in the 'follow' section.
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi 
>> >>>>>> >>>>>>> wrote:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hi Peiman,
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> I've done a couple of ways using score generation:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a
>> >>>>>> >>>>>>>> pfield
>> >>>>>> >>>>>>>> that
>> >>>>>> >>>>>>>> is
>> >>>>>> >>>>>>>> used as an index to choose what envelope to generate
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>> >>>>>> >>>>>>>> numbers
>> >>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment
>> >>>>>> >>>>>>>> becomes
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic
>> >>>>>> >>>>>>>> streams.
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> used this in pieces (you can check
>> >>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>> >>>>>> >>>>>>>> "StrA -
>> >>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>> >>>>>> >>>>>>>> group
>> >>>>>> >>>>>>>> glissandi sounds.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit
>> >>>>>> >>>>>>>> tricky,
>> >>>>>> >>>>>>>> but
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> got a set of UDO's now that I use together as a template
>> >>>>>> >>>>>>>> when
>> >>>>>> >>>>>>>> building
>> >>>>>> >>>>>>>> instruments that will work with different p-fields given
>> >>>>>> >>>>>>>> for
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score
>> >>>>>> >>>>>>>> with
>> >>>>>> >>>>>>>> 5-fields,
>> >>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>> >>>>>> >>>>>>>> work with
>> >>>>>> >>>>>>>> live, for quick sketching, or for generation.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> For example, code from my current piece uses:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> def scoreFunc():
>> >>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>> >>>>>> >>>>>>>> (10,-50)]),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>> >>>>>> >>>>>>>> (10,-50)]))
>> >>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>> >>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     return createUnstableGroup3(50,
>> >>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>> >>>>>> >>>>>>>> functions to
>> >>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>> >>>>>> >>>>>>>> generate
>> >>>>>> >>>>>>>> notes like:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327
>> >>>>>> >>>>>>>> -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> If that's of use, I can post some more of the code or
>> >>>>>> >>>>>>>> create
>> >>>>>> >>>>>>>> a more
>> >>>>>> >>>>>>>> isolated example from my piece.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hope that helps!
>> >>>>>> >>>>>>>> steven
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>> >>>>>> >>>>>>>>  wrote:
>> >>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>> >>>>>> >>>>>>>> > managed
>> >>>>>> >>>>>>>> > to make a
>> >>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now
>> >>>>>> >>>>>>>> > for
>> >>>>>> >>>>>>>> > the next
>> >>>>>> >>>>>>>> > step.
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>> >>>>>> >>>>>>>> > alongside
>> >>>>>> >>>>>>>> > PythonScore. It's great for generating score event but
>> >>>>>> >>>>>>>> > what
>> >>>>>> >>>>>>>> > if you
>> >>>>>> >>>>>>>> > also want
>> >>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>> >>>>>> >>>>>>>> > segments for
>> >>>>>> >>>>>>>> > each
>> >>>>>> >>>>>>>> > note? What if you want the envelop function to be
>> >>>>>> >>>>>>>> > generated
>> >>>>>> >>>>>>>> > by a
>> >>>>>> >>>>>>>> > python
>> >>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>> >>>>>> >>>>>>>> > think.
>> >>>>>> >>>>>>>> > What are the
>> >>>>>> >>>>>>>> > options? I
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Thanks
>> >>>>>> >>>>>>>> > P
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this
>> >>>>>> >>>>>>>> > page &
>> >>>>>> >>>>>>>> > enter
>> >>>>>> >>>>>>>> > your email
>> >>>>>> >>>>>>>> > address in the 'follow' section.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>> >>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with
>> >>>>>> >>>>>>>> body
>> >>>>>> >>>>>>>> "unsubscribe csound"
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> --
>> >>>>>> >>>>>> codehop.com | #code #art #music
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> --
>> >>>>>> >>>>> codehop.com | #code #art #music
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> --
>> >>>>>> >>>> codehop.com | #code #art #music
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> --
>> >>>>>> >> codehop.com | #code #art #music
>> >>>>>> >
>> >>>>>> >
>> >>>>>>
>> >>>>>>
>> >>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>>
>> >>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> Discussions of bugs and features can be posted here
>> >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>>>>> "unsubscribe csound"
>> >>>>>>
>> >>>>>
>> >>>>
>> >>>
>> >>
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>

Date2013-04-21 14:56
FromMark Brophy
SubjectRe: [Csnd] more python
I use Wordpress for my site and recommend it, too. I own my domain but using the Wordpress site attracts more traffic. If you have questions about customizing your site, you can usually get fast answers and there are meetups in every major city.


On Sun, Apr 21, 2013 at 8:31 AM, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I use Wordpress for my own website and like it quite a bit. It has a
concept of pages and posts, the first being a static page (though can
have comments too), and posts that are for news/blog items.  I think
most blogging and Content Management System platforms have these
abstractions these days.  Making themes for Wordpress isn't so bad,
and there's plenty you can choose from to start with and then modify.
A bit harder than just doing straight HTML probably, but overall a lot
easier to manage a site IMO.

Maybe you could try setting up an account on wordpress.org and test
out the administration console, make some pages, etc.  to see if you
like using it.  Nice thing is its easy to setup and account and test
without having to install anything.

Cheers!
steven


On Fri, Apr 19, 2013 at 1:23 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> Thanks Steven,
>
> On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
>>
>> Hi Peiman,
>>
>> Nice webpage!  Any thought to adding RSS or Atom so people can
>> subscribe to the page?
>
>
> I don't know how to do this, other than linking to an external blog. I'm
> making everything in a text editor and my html skills are minimal! it seems
> like a good idea to link to a wordpress page though. Unless you have a
> better suggestions.
>
>
>>
>>
>> As for polyphonic management, I use my orchestral composition library
>> [1] to do this.  The library is quite small.  There are Performer
>> objects that have things like instrument numbers assigned to them.
>> Each performer might have an instr num like "1.01" or "1.03". The
>> Performer has a space attribute and amplitude adjustment attribute.
>> The layers of the library allow for notes to be generated and the
>> Performer to "perform" the notes, applying their amp, space, and instr
>> num to the notes.  Other things can be applied here too. The
>> processing is like this
>>
>> NoteGenerator => [notes] => Performer => [modified notes] => output
>>
>
> Sounds nice. I must have a look. I have the book so I'll have a read later.
> And thanks for the link to the python library,
>
> P
>
>>
>> I'm not sure if Jake's CSD library works to return note objects/lists
>> that you can further manipulate or not.  If so, then you could create
>> your own function to decorate the contents of the list with further
>> values.
>>
>> I realize though re-reading your email that this technique isn't quite
>> automatic polyphony management per-se, but might be useful.
>>
>> Cheers!
>> steven
>>
>> [1] This orchestra library is described in my chapter in "The Audio
>> Programming Book".  The python library is browsable online at:
>>
>> http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/
>>
>>
>> On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>> > I've added a little something here:
>> > http://www.peimankhosravi.co.uk/miscellaneous.html
>> > P
>> >
>> >
>> >
>> >
>> >
>> >
>> > www.peimankhosravi.co.uk
>> >
>> > To receive emails about upcoming concerts visit this page & enter your
>> > email
>> > address in the 'follow' section.
>> >
>> >
>> >
>> > On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com>
>> > wrote:
>> >>
>> >> Here's an improved version:
>> >> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>> >>
>> >> Now the question is how to have an automated polyphonic management so
>> >> one
>> >> doesn't need to bother writing in the fractional part of the instrument
>> >> manually?
>> >>
>> >> An another question: how to make other types of interpolation, say, for
>> >> creating a periodic LFO sine function?
>> >>
>> >> Cheers,
>> >> P
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> www.peimankhosravi.co.uk
>> >>
>> >> To receive emails about upcoming concerts visit this page & enter your
>> >> email address in the 'follow' section.
>> >>
>> >>
>> >>
>> >> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com>
>> >> wrote:
>> >>>
>> >>> BTW I'm totally a convert to python. What a beauty. I don't know what
>> >>> those SC3 people are doing! Honestly!
>> >>>
>> >>> All I need to do now is to make the function into a class and the next
>> >>> time just write:
>> >>>
>> >>>
>> >>> <CsScore bin="python">
>> >>> from csd.pysco import PythonScore
>> >>> score = PythonScore()
>> >>> cue = score.cue
>> >>>
>> >>> score.write('f1 0 32768 10 1')
>> >>>
>> >>> with cue(0):
>> >>>     score.i(3.1, 0, 10)
>> >>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>> >>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>> >>>
>> >>> score.end();
>> >>> </CsScore>
>> >>>
>> >>> What's more, one could have as many 'parameters' as one wishes without
>> >>> defining any extra functions in python.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> www.peimankhosravi.co.uk
>> >>>
>> >>> To receive emails about upcoming concerts visit this page & enter your
>> >>> email address in the 'follow' section.
>> >>>
>> >>>
>> >>>
>> >>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com>
>> >>> wrote:
>> >>>>
>> >>>> In fact what I had was also stupid on so many other levels! This is
>> >>>> the
>> >>>> corrected one (attached). Also added amplitude automation.
>> >>>>
>> >>>> P
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> www.peimankhosravi.co.uk
>> >>>>
>> >>>> To receive emails about upcoming concerts visit this page & enter
>> >>>> your
>> >>>> email address in the 'follow' section.
>> >>>>
>> >>>>
>> >>>>
>> >>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>> >>>> wrote:
>> >>>>>
>> >>>>> Thanks Steven,
>> >>>>>
>> >>>>> I really appreciate that. Super useful!
>> >>>>>
>> >>>>> All the best,
>> >>>>> Peiman
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> www.peimankhosravi.co.uk
>> >>>>>
>> >>>>> To receive emails about upcoming concerts visit this page & enter
>> >>>>> your
>> >>>>> email address in the 'follow' section.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>> >>>>>>
>> >>>>>> Hi Peiman,
>> >>>>>>
>> >>>>>> Thought I'd mention, you may want to consider using formatting
>> >>>>>> strings
>> >>>>>> [1] to modify:
>> >>>>>>
>> >>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>>
>> >>>>>> to:
>> >>>>>>
>> >>>>>>     paramName = '"%s.%g"'%(p4, p1)
>> >>>>>>
>> >>>>>> You may also want to use list slicing  [2] with multiple assignment
>> >>>>>> [2] to do something like this:
>> >>>>>>
>> >>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>> >>>>>>
>> >>>>>> String formatting is good to know as you can get a lot of control
>> >>>>>> about the string formatting, and the template string can be easier
>> >>>>>> to
>> >>>>>> use and understand, especially when using a lot of replacement
>> >>>>>> values.
>> >>>>>>  List slicing and multiple assignment are also handy syntax sugar
>> >>>>>> to
>> >>>>>> write more terser code.
>> >>>>>>
>> >>>>>> Hope that's useful!
>> >>>>>> steven
>> >>>>>>
>> >>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>> >>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>> >>>>>>
>> >>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> > No thank you and Steven for all your comments and contributions.
>> >>>>>> >
>> >>>>>> > I've had enough of staring at the computer tonight. Here's the
>> >>>>>> > latest
>> >>>>>> > function I came up with.
>> >>>>>> >
>> >>>>>> > Best,
>> >>>>>> > P
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > from csd.pysco import PythonScore
>> >>>>>> > from random import choice
>> >>>>>> >
>> >>>>>> > score = PythonScore()
>> >>>>>> > cue = score.cue
>> >>>>>> >
>> >>>>>> > score.write('f1 0 8192 10 1')
>> >>>>>> >
>> >>>>>> > def parameter(p1, name, type, envelope):
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >     if "l" in type:
>> >>>>>> >         p7 = 1
>> >>>>>> >     else:
>> >>>>>> >         p7 = 0
>> >>>>>> >
>> >>>>>> >     p4 = name
>> >>>>>> >     linseg = envelope
>> >>>>>> >
>> >>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >
>> >>>>>> >     for i in range(len(linseg)-4):
>> >>>>>> >
>> >>>>>> >         if i > 0:
>> >>>>>> >             i = i+1
>> >>>>>> >
>> >>>>>> >         t1 = linseg[i]
>> >>>>>> >         v1 = linseg[i+1]
>> >>>>>> >         t2 = linseg[i+2]
>> >>>>>> >         v2 = linseg[i+3]
>> >>>>>> >         start = t1
>> >>>>>> >         dur = t2-t1
>> >>>>>> >         point1 = v1
>> >>>>>> >         point2 = v2
>> >>>>>> >
>> >>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.i(3.1, 0, 10)
>> >>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.end();
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >
>> >>>>>> > To receive emails about upcoming concerts visit this page & enter
>> >>>>>> > your email
>> >>>>>> > address in the 'follow' section.
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>> >>>>>> > wrote:
>> >>>>>> >>
>> >>>>>> >> Thanks for posting these. I'm definitely reading and running
>> >>>>>> >> them.
>> >>>>>> >> Here's
>> >>>>>> >> an supported featured debugging feature that might help, which
>> >>>>>> >> will
>> >>>>>> >> eventually be transformed into an official feature. To see what
>> >>>>>> >> data is
>> >>>>>> >> currently in the score object, do this:
>> >>>>>> >>
>> >>>>>> >> for L in score.score_data:
>> >>>>>> >>     print L
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> >>>>>> >> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>
>> >>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>> >>>>>> >>> latest.
>> >>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>> >>>>>> >>> probably not
>> >>>>>> >>> the most efficient of doing it.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> from csd.pysco import PythonScore
>> >>>>>> >>> from random import choice
>> >>>>>> >>>
>> >>>>>> >>> score = PythonScore()
>> >>>>>> >>> cue = score.cue
>> >>>>>> >>>
>> >>>>>> >>> score.write('f1 0 8192 10 1')
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> def note(p1, p2, p3, list):
>> >>>>>> >>>
>> >>>>>> >>>     type = list.pop(1)
>> >>>>>> >>>
>> >>>>>> >>>     if "l" in type:
>> >>>>>> >>>         p7 = 1
>> >>>>>> >>>     else:
>> >>>>>> >>>         p7 = 0
>> >>>>>> >>>
>> >>>>>> >>>     p4 = list.pop(0)
>> >>>>>> >>>     linseg = list[0:]
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     score.i(p1, p2, p3)
>> >>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     for i in range(len(linseg)-4):
>> >>>>>> >>>
>> >>>>>> >>>         if i > 0:
>> >>>>>> >>>             i = i+1
>> >>>>>> >>>
>> >>>>>> >>>         t1 = linseg[i]
>> >>>>>> >>>         v1 = linseg[i+1]
>> >>>>>> >>>         t2 = linseg[i+2]
>> >>>>>> >>>         v2 = linseg[i+3]
>> >>>>>> >>>
>> >>>>>> >>>         start = t1
>> >>>>>> >>>         dur = t2-t1
>> >>>>>> >>>         point1 = v1
>> >>>>>> >>>         point2 = v2
>> >>>>>> >>>
>> >>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> score.end();
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> www.peimankhosravi.co.uk
>> >>>>>> >>>
>> >>>>>> >>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>> enter
>> >>>>>> >>> your
>> >>>>>> >>> email address in the 'follow' section.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>> >>>>>> >>> wrote:
>> >>>>>> >>>>
>> >>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>> >>>>>> >>>> examples in
>> >>>>>> >>>> the master branch of the CSD module:
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>> >>>>>> >>>>
>> >>>>>> >>>> The plan is to create/collect lots of examples as a way to
>> >>>>>> >>>> start
>> >>>>>> >>>> identifying some of the design patterns that Python brings to
>> >>>>>> >>>> the
>> >>>>>> >>>> score
>> >>>>>> >>>> environment. Once enough are collected and we have a sense of
>> >>>>>> >>>> good ways of
>> >>>>>> >>>> approaching common problems, functions and classes that reside
>> >>>>>> >>>> in
>> >>>>>> >>>> these
>> >>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and
>> >>>>>> >>>> placed
>> >>>>>> >>>> into
>> >>>>>> >>>> modules that come with CSD. The examples will be updated in
>> >>>>>> >>>> the
>> >>>>>> >>>> process.
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>> >>>>>> >>>> <jacobjoaquin@gmail.com>
>> >>>>>> >>>> wrote:
>> >>>>>> >>>>>
>> >>>>>> >>>>> Here is another approach:
>> >>>>>> >>>>>
>> >>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>> >>>>>> >>>>>
>> >>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>> >>>>>> >>>>> include
>> >>>>>> >>>>> it as an example case with PythonScore. In the meantime,
>> >>>>>> >>>>> here's
>> >>>>>> >>>>> the
>> >>>>>> >>>>> explanation of how it works.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Envelope shapes are generated as tables. They are created
>> >>>>>> >>>>> dynamically
>> >>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>> >>>>>> >>>>> they're being
>> >>>>>> >>>>> played, I created the table_cycler that cycles through a
>> >>>>>> >>>>> range
>> >>>>>> >>>>> of table
>> >>>>>> >>>>> indexes every time a new table is created. In this case, the
>> >>>>>> >>>>> range is
>> >>>>>> >>>>> between 100 and 120.
>> >>>>>> >>>>>
>> >>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>> >>>>>> >>>>>
>> >>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>> >>>>>> >>>>> list of
>> >>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>> >>>>>> >>>>> args are the
>> >>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>> >>>>>> >>>>> event pfields
>> >>>>>> >>>>> are automatically handled:
>> >>>>>> >>>>>
>> >>>>>> >>>>> def gen_envelope(*args):
>> >>>>>> >>>>>     global table_cycler
>> >>>>>> >>>>>
>> >>>>>> >>>>>     table = table_cycler.next()
>> >>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>> >>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>> >>>>>> >>>>>     return table
>> >>>>>> >>>>>
>> >>>>>> >>>>> That function returns the number of the table generated. So a
>> >>>>>> >>>>> value
>> >>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>> >>>>>> >>>>> performance,
>> >>>>>> >>>>> you'll see it cycle through this range.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>> >>>>>> >>>>> first 5
>> >>>>>> >>>>> notes in the score demo this explicitly:
>> >>>>>> >>>>>
>> >>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1,
>> >>>>>> >>>>> 8191,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> >>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100,
>> >>>>>> >>>>> 1,
>> >>>>>> >>>>> 7991,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>>
>> >>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>> >>>>>> >>>>> pattern
>> >>>>>> >>>>> and an envelope pattern.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Best,
>> >>>>>> >>>>> Jake
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>> >>>>>> >>>>> <jacobjoaquin@gmail.com>
>> >>>>>> >>>>> wrote:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>> >>>>>> >>>>>> arrays in C6
>> >>>>>> >>>>>> will support something like the following. To solve the
>> >>>>>> >>>>>> problem
>> >>>>>> >>>>>> you
>> >>>>>> >>>>>> presented, I think it would require two things. First, the
>> >>>>>> >>>>>> ability to pass
>> >>>>>> >>>>>> an as a pfield in the score:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> And then in the score, pass the array in as a list of args
>> >>>>>> >>>>>> for
>> >>>>>> >>>>>> opcodes:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> ienvpoints getarray p6
>> >>>>>> >>>>>> kenv linseg *ienvpoints
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> There may need to be a third step required for scaling the
>> >>>>>> >>>>>> even
>> >>>>>> >>>>>> fields
>> >>>>>> >>>>>> of the array, though is probably already supported by
>> >>>>>> >>>>>> orchestra
>> >>>>>> >>>>>> loop
>> >>>>>> >>>>>> statements.
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>> >>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Thanks very much Steven,
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>> >>>>>> >>>>>>> initial
>> >>>>>> >>>>>>> impression is that this is possibly too convoluted for
>> >>>>>> >>>>>>> quick
>> >>>>>> >>>>>>> and dirty
>> >>>>>> >>>>>>> experimentation. I think it should be easier than that.
>> >>>>>> >>>>>>> Maybe
>> >>>>>> >>>>>>> with array in
>> >>>>>> >>>>>>> csound6 it will be possible?
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Cheers,
>> >>>>>> >>>>>>> Peiman
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>>>>>> enter
>> >>>>>> >>>>>>> your email address in the 'follow' section.
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com>
>> >>>>>> >>>>>>> wrote:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hi Peiman,
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> I've done a couple of ways using score generation:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a
>> >>>>>> >>>>>>>> pfield
>> >>>>>> >>>>>>>> that
>> >>>>>> >>>>>>>> is
>> >>>>>> >>>>>>>> used as an index to choose what envelope to generate
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>> >>>>>> >>>>>>>> numbers
>> >>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment
>> >>>>>> >>>>>>>> becomes
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic
>> >>>>>> >>>>>>>> streams.
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> used this in pieces (you can check
>> >>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>> >>>>>> >>>>>>>> "StrA -
>> >>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>> >>>>>> >>>>>>>> group
>> >>>>>> >>>>>>>> glissandi sounds.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit
>> >>>>>> >>>>>>>> tricky,
>> >>>>>> >>>>>>>> but
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> got a set of UDO's now that I use together as a template
>> >>>>>> >>>>>>>> when
>> >>>>>> >>>>>>>> building
>> >>>>>> >>>>>>>> instruments that will work with different p-fields given
>> >>>>>> >>>>>>>> for
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score
>> >>>>>> >>>>>>>> with
>> >>>>>> >>>>>>>> 5-fields,
>> >>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>> >>>>>> >>>>>>>> work with
>> >>>>>> >>>>>>>> live, for quick sketching, or for generation.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> For example, code from my current piece uses:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> def scoreFunc():
>> >>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>> >>>>>> >>>>>>>> (10,-50)]),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>> >>>>>> >>>>>>>> (10,-50)]))
>> >>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>> >>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     return createUnstableGroup3(50,
>> >>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>> >>>>>> >>>>>>>> functions to
>> >>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>> >>>>>> >>>>>>>> generate
>> >>>>>> >>>>>>>> notes like:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327
>> >>>>>> >>>>>>>> -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> If that's of use, I can post some more of the code or
>> >>>>>> >>>>>>>> create
>> >>>>>> >>>>>>>> a more
>> >>>>>> >>>>>>>> isolated example from my piece.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hope that helps!
>> >>>>>> >>>>>>>> steven
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>> >>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>> >>>>>> >>>>>>>> > managed
>> >>>>>> >>>>>>>> > to make a
>> >>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now
>> >>>>>> >>>>>>>> > for
>> >>>>>> >>>>>>>> > the next
>> >>>>>> >>>>>>>> > step.
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>> >>>>>> >>>>>>>> > alongside
>> >>>>>> >>>>>>>> > PythonScore. It's great for generating score event but
>> >>>>>> >>>>>>>> > what
>> >>>>>> >>>>>>>> > if you
>> >>>>>> >>>>>>>> > also want
>> >>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>> >>>>>> >>>>>>>> > segments for
>> >>>>>> >>>>>>>> > each
>> >>>>>> >>>>>>>> > note? What if you want the envelop function to be
>> >>>>>> >>>>>>>> > generated
>> >>>>>> >>>>>>>> > by a
>> >>>>>> >>>>>>>> > python
>> >>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>> >>>>>> >>>>>>>> > think.
>> >>>>>> >>>>>>>> > What are the
>> >>>>>> >>>>>>>> > options? I
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Thanks
>> >>>>>> >>>>>>>> > P
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this
>> >>>>>> >>>>>>>> > page &
>> >>>>>> >>>>>>>> > enter
>> >>>>>> >>>>>>>> > your email
>> >>>>>> >>>>>>>> > address in the 'follow' section.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>> >>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with
>> >>>>>> >>>>>>>> body
>> >>>>>> >>>>>>>> "unsubscribe csound"
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> --
>> >>>>>> >>>>>> codehop.com | #code #art #music
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> --
>> >>>>>> >>>>> codehop.com | #code #art #music
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> --
>> >>>>>> >>>> codehop.com | #code #art #music
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> --
>> >>>>>> >> codehop.com | #code #art #music
>> >>>>>> >
>> >>>>>> >
>> >>>>>>
>> >>>>>>
>> >>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>>
>> >>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> Discussions of bugs and features can be posted here
>> >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>>>>> "unsubscribe csound"
>> >>>>>>
>> >>>>>
>> >>>>
>> >>>
>> >>
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-04-21 16:30
FromMichael Gogins
SubjectRe: [Csnd] more python
I just use tumblr. I do this because there are free themes that have both posts and pages, because it's easy to upload pages,and because you can post soundfiles. All this is free. I wish they would allow posts of PDF files, though. But you can link to externally hosted ones.

I did evaluate Wordpress as a hosting site but I went with tumblr because with Wordpress you have to pay for the ability to post soundfiles.

Regards,
Mike


On Sun, Apr 21, 2013 at 9:56 AM, Mark Brophy <mark@brophyworld.com> wrote:
I use Wordpress for my site and recommend it, too. I own my domain but using the Wordpress site attracts more traffic. If you have questions about customizing your site, you can usually get fast answers and there are meetups in every major city.


On Sun, Apr 21, 2013 at 8:31 AM, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I use Wordpress for my own website and like it quite a bit. It has a
concept of pages and posts, the first being a static page (though can
have comments too), and posts that are for news/blog items.  I think
most blogging and Content Management System platforms have these
abstractions these days.  Making themes for Wordpress isn't so bad,
and there's plenty you can choose from to start with and then modify.
A bit harder than just doing straight HTML probably, but overall a lot
easier to manage a site IMO.

Maybe you could try setting up an account on wordpress.org and test
out the administration console, make some pages, etc.  to see if you
like using it.  Nice thing is its easy to setup and account and test
without having to install anything.

Cheers!
steven


On Fri, Apr 19, 2013 at 1:23 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> Thanks Steven,
>
> On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
>>
>> Hi Peiman,
>>
>> Nice webpage!  Any thought to adding RSS or Atom so people can
>> subscribe to the page?
>
>
> I don't know how to do this, other than linking to an external blog. I'm
> making everything in a text editor and my html skills are minimal! it seems
> like a good idea to link to a wordpress page though. Unless you have a
> better suggestions.
>
>
>>
>>
>> As for polyphonic management, I use my orchestral composition library
>> [1] to do this.  The library is quite small.  There are Performer
>> objects that have things like instrument numbers assigned to them.
>> Each performer might have an instr num like "1.01" or "1.03". The
>> Performer has a space attribute and amplitude adjustment attribute.
>> The layers of the library allow for notes to be generated and the
>> Performer to "perform" the notes, applying their amp, space, and instr
>> num to the notes.  Other things can be applied here too. The
>> processing is like this
>>
>> NoteGenerator => [notes] => Performer => [modified notes] => output
>>
>
> Sounds nice. I must have a look. I have the book so I'll have a read later.
> And thanks for the link to the python library,
>
> P
>
>>
>> I'm not sure if Jake's CSD library works to return note objects/lists
>> that you can further manipulate or not.  If so, then you could create
>> your own function to decorate the contents of the list with further
>> values.
>>
>> I realize though re-reading your email that this technique isn't quite
>> automatic polyphony management per-se, but might be useful.
>>
>> Cheers!
>> steven
>>
>> [1] This orchestra library is described in my chapter in "The Audio
>> Programming Book".  The python library is browsable online at:
>>
>> http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/
>>
>>
>> On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>> > I've added a little something here:
>> > http://www.peimankhosravi.co.uk/miscellaneous.html
>> > P
>> >
>> >
>> >
>> >
>> >
>> >
>> > www.peimankhosravi.co.uk
>> >
>> > To receive emails about upcoming concerts visit this page & enter your
>> > email
>> > address in the 'follow' section.
>> >
>> >
>> >
>> > On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com>
>> > wrote:
>> >>
>> >> Here's an improved version:
>> >> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>> >>
>> >> Now the question is how to have an automated polyphonic management so
>> >> one
>> >> doesn't need to bother writing in the fractional part of the instrument
>> >> manually?
>> >>
>> >> An another question: how to make other types of interpolation, say, for
>> >> creating a periodic LFO sine function?
>> >>
>> >> Cheers,
>> >> P
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> www.peimankhosravi.co.uk
>> >>
>> >> To receive emails about upcoming concerts visit this page & enter your
>> >> email address in the 'follow' section.
>> >>
>> >>
>> >>
>> >> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com>
>> >> wrote:
>> >>>
>> >>> BTW I'm totally a convert to python. What a beauty. I don't know what
>> >>> those SC3 people are doing! Honestly!
>> >>>
>> >>> All I need to do now is to make the function into a class and the next
>> >>> time just write:
>> >>>
>> >>>
>> >>> <CsScore bin="python">
>> >>> from csd.pysco import PythonScore
>> >>> score = PythonScore()
>> >>> cue = score.cue
>> >>>
>> >>> score.write('f1 0 32768 10 1')
>> >>>
>> >>> with cue(0):
>> >>>     score.i(3.1, 0, 10)
>> >>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>> >>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>> >>>
>> >>> score.end();
>> >>> </CsScore>
>> >>>
>> >>> What's more, one could have as many 'parameters' as one wishes without
>> >>> defining any extra functions in python.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> www.peimankhosravi.co.uk
>> >>>
>> >>> To receive emails about upcoming concerts visit this page & enter your
>> >>> email address in the 'follow' section.
>> >>>
>> >>>
>> >>>
>> >>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com>
>> >>> wrote:
>> >>>>
>> >>>> In fact what I had was also stupid on so many other levels! This is
>> >>>> the
>> >>>> corrected one (attached). Also added amplitude automation.
>> >>>>
>> >>>> P
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> www.peimankhosravi.co.uk
>> >>>>
>> >>>> To receive emails about upcoming concerts visit this page & enter
>> >>>> your
>> >>>> email address in the 'follow' section.
>> >>>>
>> >>>>
>> >>>>
>> >>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>> >>>> wrote:
>> >>>>>
>> >>>>> Thanks Steven,
>> >>>>>
>> >>>>> I really appreciate that. Super useful!
>> >>>>>
>> >>>>> All the best,
>> >>>>> Peiman
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> www.peimankhosravi.co.uk
>> >>>>>
>> >>>>> To receive emails about upcoming concerts visit this page & enter
>> >>>>> your
>> >>>>> email address in the 'follow' section.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>> >>>>>>
>> >>>>>> Hi Peiman,
>> >>>>>>
>> >>>>>> Thought I'd mention, you may want to consider using formatting
>> >>>>>> strings
>> >>>>>> [1] to modify:
>> >>>>>>
>> >>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>>
>> >>>>>> to:
>> >>>>>>
>> >>>>>>     paramName = '"%s.%g"'%(p4, p1)
>> >>>>>>
>> >>>>>> You may also want to use list slicing  [2] with multiple assignment
>> >>>>>> [2] to do something like this:
>> >>>>>>
>> >>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>> >>>>>>
>> >>>>>> String formatting is good to know as you can get a lot of control
>> >>>>>> about the string formatting, and the template string can be easier
>> >>>>>> to
>> >>>>>> use and understand, especially when using a lot of replacement
>> >>>>>> values.
>> >>>>>>  List slicing and multiple assignment are also handy syntax sugar
>> >>>>>> to
>> >>>>>> write more terser code.
>> >>>>>>
>> >>>>>> Hope that's useful!
>> >>>>>> steven
>> >>>>>>
>> >>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>> >>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>> >>>>>>
>> >>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> > No thank you and Steven for all your comments and contributions.
>> >>>>>> >
>> >>>>>> > I've had enough of staring at the computer tonight. Here's the
>> >>>>>> > latest
>> >>>>>> > function I came up with.
>> >>>>>> >
>> >>>>>> > Best,
>> >>>>>> > P
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > from csd.pysco import PythonScore
>> >>>>>> > from random import choice
>> >>>>>> >
>> >>>>>> > score = PythonScore()
>> >>>>>> > cue = score.cue
>> >>>>>> >
>> >>>>>> > score.write('f1 0 8192 10 1')
>> >>>>>> >
>> >>>>>> > def parameter(p1, name, type, envelope):
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >     if "l" in type:
>> >>>>>> >         p7 = 1
>> >>>>>> >     else:
>> >>>>>> >         p7 = 0
>> >>>>>> >
>> >>>>>> >     p4 = name
>> >>>>>> >     linseg = envelope
>> >>>>>> >
>> >>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >
>> >>>>>> >     for i in range(len(linseg)-4):
>> >>>>>> >
>> >>>>>> >         if i > 0:
>> >>>>>> >             i = i+1
>> >>>>>> >
>> >>>>>> >         t1 = linseg[i]
>> >>>>>> >         v1 = linseg[i+1]
>> >>>>>> >         t2 = linseg[i+2]
>> >>>>>> >         v2 = linseg[i+3]
>> >>>>>> >         start = t1
>> >>>>>> >         dur = t2-t1
>> >>>>>> >         point1 = v1
>> >>>>>> >         point2 = v2
>> >>>>>> >
>> >>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.i(3.1, 0, 10)
>> >>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.end();
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >
>> >>>>>> > To receive emails about upcoming concerts visit this page & enter
>> >>>>>> > your email
>> >>>>>> > address in the 'follow' section.
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>> >>>>>> > wrote:
>> >>>>>> >>
>> >>>>>> >> Thanks for posting these. I'm definitely reading and running
>> >>>>>> >> them.
>> >>>>>> >> Here's
>> >>>>>> >> an supported featured debugging feature that might help, which
>> >>>>>> >> will
>> >>>>>> >> eventually be transformed into an official feature. To see what
>> >>>>>> >> data is
>> >>>>>> >> currently in the score object, do this:
>> >>>>>> >>
>> >>>>>> >> for L in score.score_data:
>> >>>>>> >>     print L
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> >>>>>> >> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>
>> >>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>> >>>>>> >>> latest.
>> >>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>> >>>>>> >>> probably not
>> >>>>>> >>> the most efficient of doing it.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> from csd.pysco import PythonScore
>> >>>>>> >>> from random import choice
>> >>>>>> >>>
>> >>>>>> >>> score = PythonScore()
>> >>>>>> >>> cue = score.cue
>> >>>>>> >>>
>> >>>>>> >>> score.write('f1 0 8192 10 1')
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> def note(p1, p2, p3, list):
>> >>>>>> >>>
>> >>>>>> >>>     type = list.pop(1)
>> >>>>>> >>>
>> >>>>>> >>>     if "l" in type:
>> >>>>>> >>>         p7 = 1
>> >>>>>> >>>     else:
>> >>>>>> >>>         p7 = 0
>> >>>>>> >>>
>> >>>>>> >>>     p4 = list.pop(0)
>> >>>>>> >>>     linseg = list[0:]
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     score.i(p1, p2, p3)
>> >>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     for i in range(len(linseg)-4):
>> >>>>>> >>>
>> >>>>>> >>>         if i > 0:
>> >>>>>> >>>             i = i+1
>> >>>>>> >>>
>> >>>>>> >>>         t1 = linseg[i]
>> >>>>>> >>>         v1 = linseg[i+1]
>> >>>>>> >>>         t2 = linseg[i+2]
>> >>>>>> >>>         v2 = linseg[i+3]
>> >>>>>> >>>
>> >>>>>> >>>         start = t1
>> >>>>>> >>>         dur = t2-t1
>> >>>>>> >>>         point1 = v1
>> >>>>>> >>>         point2 = v2
>> >>>>>> >>>
>> >>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> score.end();
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> www.peimankhosravi.co.uk
>> >>>>>> >>>
>> >>>>>> >>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>> enter
>> >>>>>> >>> your
>> >>>>>> >>> email address in the 'follow' section.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>> >>>>>> >>> wrote:
>> >>>>>> >>>>
>> >>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>> >>>>>> >>>> examples in
>> >>>>>> >>>> the master branch of the CSD module:
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>> >>>>>> >>>>
>> >>>>>> >>>> The plan is to create/collect lots of examples as a way to
>> >>>>>> >>>> start
>> >>>>>> >>>> identifying some of the design patterns that Python brings to
>> >>>>>> >>>> the
>> >>>>>> >>>> score
>> >>>>>> >>>> environment. Once enough are collected and we have a sense of
>> >>>>>> >>>> good ways of
>> >>>>>> >>>> approaching common problems, functions and classes that reside
>> >>>>>> >>>> in
>> >>>>>> >>>> these
>> >>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and
>> >>>>>> >>>> placed
>> >>>>>> >>>> into
>> >>>>>> >>>> modules that come with CSD. The examples will be updated in
>> >>>>>> >>>> the
>> >>>>>> >>>> process.
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>> >>>>>> >>>> <jacobjoaquin@gmail.com>
>> >>>>>> >>>> wrote:
>> >>>>>> >>>>>
>> >>>>>> >>>>> Here is another approach:
>> >>>>>> >>>>>
>> >>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>> >>>>>> >>>>>
>> >>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>> >>>>>> >>>>> include
>> >>>>>> >>>>> it as an example case with PythonScore. In the meantime,
>> >>>>>> >>>>> here's
>> >>>>>> >>>>> the
>> >>>>>> >>>>> explanation of how it works.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Envelope shapes are generated as tables. They are created
>> >>>>>> >>>>> dynamically
>> >>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>> >>>>>> >>>>> they're being
>> >>>>>> >>>>> played, I created the table_cycler that cycles through a
>> >>>>>> >>>>> range
>> >>>>>> >>>>> of table
>> >>>>>> >>>>> indexes every time a new table is created. In this case, the
>> >>>>>> >>>>> range is
>> >>>>>> >>>>> between 100 and 120.
>> >>>>>> >>>>>
>> >>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>> >>>>>> >>>>>
>> >>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>> >>>>>> >>>>> list of
>> >>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>> >>>>>> >>>>> args are the
>> >>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>> >>>>>> >>>>> event pfields
>> >>>>>> >>>>> are automatically handled:
>> >>>>>> >>>>>
>> >>>>>> >>>>> def gen_envelope(*args):
>> >>>>>> >>>>>     global table_cycler
>> >>>>>> >>>>>
>> >>>>>> >>>>>     table = table_cycler.next()
>> >>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>> >>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>> >>>>>> >>>>>     return table
>> >>>>>> >>>>>
>> >>>>>> >>>>> That function returns the number of the table generated. So a
>> >>>>>> >>>>> value
>> >>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>> >>>>>> >>>>> performance,
>> >>>>>> >>>>> you'll see it cycle through this range.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>> >>>>>> >>>>> first 5
>> >>>>>> >>>>> notes in the score demo this explicitly:
>> >>>>>> >>>>>
>> >>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1,
>> >>>>>> >>>>> 8191,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> >>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100,
>> >>>>>> >>>>> 1,
>> >>>>>> >>>>> 7991,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>>
>> >>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>> >>>>>> >>>>> pattern
>> >>>>>> >>>>> and an envelope pattern.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Best,
>> >>>>>> >>>>> Jake
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>> >>>>>> >>>>> <jacobjoaquin@gmail.com>
>> >>>>>> >>>>> wrote:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>> >>>>>> >>>>>> arrays in C6
>> >>>>>> >>>>>> will support something like the following. To solve the
>> >>>>>> >>>>>> problem
>> >>>>>> >>>>>> you
>> >>>>>> >>>>>> presented, I think it would require two things. First, the
>> >>>>>> >>>>>> ability to pass
>> >>>>>> >>>>>> an as a pfield in the score:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> And then in the score, pass the array in as a list of args
>> >>>>>> >>>>>> for
>> >>>>>> >>>>>> opcodes:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> ienvpoints getarray p6
>> >>>>>> >>>>>> kenv linseg *ienvpoints
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> There may need to be a third step required for scaling the
>> >>>>>> >>>>>> even
>> >>>>>> >>>>>> fields
>> >>>>>> >>>>>> of the array, though is probably already supported by
>> >>>>>> >>>>>> orchestra
>> >>>>>> >>>>>> loop
>> >>>>>> >>>>>> statements.
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>> >>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Thanks very much Steven,
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>> >>>>>> >>>>>>> initial
>> >>>>>> >>>>>>> impression is that this is possibly too convoluted for
>> >>>>>> >>>>>>> quick
>> >>>>>> >>>>>>> and dirty
>> >>>>>> >>>>>>> experimentation. I think it should be easier than that.
>> >>>>>> >>>>>>> Maybe
>> >>>>>> >>>>>>> with array in
>> >>>>>> >>>>>>> csound6 it will be possible?
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Cheers,
>> >>>>>> >>>>>>> Peiman
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>>>>>> enter
>> >>>>>> >>>>>>> your email address in the 'follow' section.
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com>
>> >>>>>> >>>>>>> wrote:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hi Peiman,
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> I've done a couple of ways using score generation:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a
>> >>>>>> >>>>>>>> pfield
>> >>>>>> >>>>>>>> that
>> >>>>>> >>>>>>>> is
>> >>>>>> >>>>>>>> used as an index to choose what envelope to generate
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>> >>>>>> >>>>>>>> numbers
>> >>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment
>> >>>>>> >>>>>>>> becomes
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic
>> >>>>>> >>>>>>>> streams.
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> used this in pieces (you can check
>> >>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>> >>>>>> >>>>>>>> "StrA -
>> >>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>> >>>>>> >>>>>>>> group
>> >>>>>> >>>>>>>> glissandi sounds.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit
>> >>>>>> >>>>>>>> tricky,
>> >>>>>> >>>>>>>> but
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> got a set of UDO's now that I use together as a template
>> >>>>>> >>>>>>>> when
>> >>>>>> >>>>>>>> building
>> >>>>>> >>>>>>>> instruments that will work with different p-fields given
>> >>>>>> >>>>>>>> for
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score
>> >>>>>> >>>>>>>> with
>> >>>>>> >>>>>>>> 5-fields,
>> >>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>> >>>>>> >>>>>>>> work with
>> >>>>>> >>>>>>>> live, for quick sketching, or for generation.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> For example, code from my current piece uses:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> def scoreFunc():
>> >>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>> >>>>>> >>>>>>>> (10,-50)]),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>> >>>>>> >>>>>>>> (10,-50)]))
>> >>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>> >>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     return createUnstableGroup3(50,
>> >>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>> >>>>>> >>>>>>>> functions to
>> >>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>> >>>>>> >>>>>>>> generate
>> >>>>>> >>>>>>>> notes like:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327
>> >>>>>> >>>>>>>> -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> If that's of use, I can post some more of the code or
>> >>>>>> >>>>>>>> create
>> >>>>>> >>>>>>>> a more
>> >>>>>> >>>>>>>> isolated example from my piece.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hope that helps!
>> >>>>>> >>>>>>>> steven
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>> >>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>> >>>>>> >>>>>>>> > managed
>> >>>>>> >>>>>>>> > to make a
>> >>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now
>> >>>>>> >>>>>>>> > for
>> >>>>>> >>>>>>>> > the next
>> >>>>>> >>>>>>>> > step.
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>> >>>>>> >>>>>>>> > alongside
>> >>>>>> >>>>>>>> > PythonScore. It's great for generating score event but
>> >>>>>> >>>>>>>> > what
>> >>>>>> >>>>>>>> > if you
>> >>>>>> >>>>>>>> > also want
>> >>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>> >>>>>> >>>>>>>> > segments for
>> >>>>>> >>>>>>>> > each
>> >>>>>> >>>>>>>> > note? What if you want the envelop function to be
>> >>>>>> >>>>>>>> > generated
>> >>>>>> >>>>>>>> > by a
>> >>>>>> >>>>>>>> > python
>> >>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>> >>>>>> >>>>>>>> > think.
>> >>>>>> >>>>>>>> > What are the
>> >>>>>> >>>>>>>> > options? I
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Thanks
>> >>>>>> >>>>>>>> > P
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this
>> >>>>>> >>>>>>>> > page &
>> >>>>>> >>>>>>>> > enter
>> >>>>>> >>>>>>>> > your email
>> >>>>>> >>>>>>>> > address in the 'follow' section.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>> >>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with
>> >>>>>> >>>>>>>> body
>> >>>>>> >>>>>>>> "unsubscribe csound"
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> --
>> >>>>>> >>>>>> codehop.com | #code #art #music
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> --
>> >>>>>> >>>>> codehop.com | #code #art #music
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> --
>> >>>>>> >>>> codehop.com | #code #art #music
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> --
>> >>>>>> >> codehop.com | #code #art #music
>> >>>>>> >
>> >>>>>> >
>> >>>>>>
>> >>>>>>
>> >>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>>
>> >>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> Discussions of bugs and features can be posted here
>> >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>>>>> "unsubscribe csound"
>> >>>>>>
>> >>>>>
>> >>>>
>> >>>
>> >>
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

Date2013-04-21 19:54
Frompeiman khosravi
SubjectRe: [Csnd] more python
Hi Steven,

I've got one page here (http://spectralkimia.wordpress.com) for publishing concert news. It looks like in order to have access to the html code one needs to pay for the 'pro' version or something like that. Maybe I've just missed something? I think for now I will link to another wordpress page from my website for posting miscellaneous stuff.

Thanks
Peiman






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 21 April 2013 14:31, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I use Wordpress for my own website and like it quite a bit. It has a
concept of pages and posts, the first being a static page (though can
have comments too), and posts that are for news/blog items.  I think
most blogging and Content Management System platforms have these
abstractions these days.  Making themes for Wordpress isn't so bad,
and there's plenty you can choose from to start with and then modify.
A bit harder than just doing straight HTML probably, but overall a lot
easier to manage a site IMO.

Maybe you could try setting up an account on wordpress.org and test
out the administration console, make some pages, etc.  to see if you
like using it.  Nice thing is its easy to setup and account and test
without having to install anything.

Cheers!
steven


On Fri, Apr 19, 2013 at 1:23 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> Thanks Steven,
>
> On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
>>
>> Hi Peiman,
>>
>> Nice webpage!  Any thought to adding RSS or Atom so people can
>> subscribe to the page?
>
>
> I don't know how to do this, other than linking to an external blog. I'm
> making everything in a text editor and my html skills are minimal! it seems
> like a good idea to link to a wordpress page though. Unless you have a
> better suggestions.
>
>
>>
>>
>> As for polyphonic management, I use my orchestral composition library
>> [1] to do this.  The library is quite small.  There are Performer
>> objects that have things like instrument numbers assigned to them.
>> Each performer might have an instr num like "1.01" or "1.03". The
>> Performer has a space attribute and amplitude adjustment attribute.
>> The layers of the library allow for notes to be generated and the
>> Performer to "perform" the notes, applying their amp, space, and instr
>> num to the notes.  Other things can be applied here too. The
>> processing is like this
>>
>> NoteGenerator => [notes] => Performer => [modified notes] => output
>>
>
> Sounds nice. I must have a look. I have the book so I'll have a read later.
> And thanks for the link to the python library,
>
> P
>
>>
>> I'm not sure if Jake's CSD library works to return note objects/lists
>> that you can further manipulate or not.  If so, then you could create
>> your own function to decorate the contents of the list with further
>> values.
>>
>> I realize though re-reading your email that this technique isn't quite
>> automatic polyphony management per-se, but might be useful.
>>
>> Cheers!
>> steven
>>
>> [1] This orchestra library is described in my chapter in "The Audio
>> Programming Book".  The python library is browsable online at:
>>
>> http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/
>>
>>
>> On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>> > I've added a little something here:
>> > http://www.peimankhosravi.co.uk/miscellaneous.html
>> > P
>> >
>> >
>> >
>> >
>> >
>> >
>> > www.peimankhosravi.co.uk
>> >
>> > To receive emails about upcoming concerts visit this page & enter your
>> > email
>> > address in the 'follow' section.
>> >
>> >
>> >
>> > On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com>
>> > wrote:
>> >>
>> >> Here's an improved version:
>> >> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>> >>
>> >> Now the question is how to have an automated polyphonic management so
>> >> one
>> >> doesn't need to bother writing in the fractional part of the instrument
>> >> manually?
>> >>
>> >> An another question: how to make other types of interpolation, say, for
>> >> creating a periodic LFO sine function?
>> >>
>> >> Cheers,
>> >> P
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> www.peimankhosravi.co.uk
>> >>
>> >> To receive emails about upcoming concerts visit this page & enter your
>> >> email address in the 'follow' section.
>> >>
>> >>
>> >>
>> >> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com>
>> >> wrote:
>> >>>
>> >>> BTW I'm totally a convert to python. What a beauty. I don't know what
>> >>> those SC3 people are doing! Honestly!
>> >>>
>> >>> All I need to do now is to make the function into a class and the next
>> >>> time just write:
>> >>>
>> >>>
>> >>> <CsScore bin="python">
>> >>> from csd.pysco import PythonScore
>> >>> score = PythonScore()
>> >>> cue = score.cue
>> >>>
>> >>> score.write('f1 0 32768 10 1')
>> >>>
>> >>> with cue(0):
>> >>>     score.i(3.1, 0, 10)
>> >>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>> >>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>> >>>
>> >>> score.end();
>> >>> </CsScore>
>> >>>
>> >>> What's more, one could have as many 'parameters' as one wishes without
>> >>> defining any extra functions in python.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> www.peimankhosravi.co.uk
>> >>>
>> >>> To receive emails about upcoming concerts visit this page & enter your
>> >>> email address in the 'follow' section.
>> >>>
>> >>>
>> >>>
>> >>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com>
>> >>> wrote:
>> >>>>
>> >>>> In fact what I had was also stupid on so many other levels! This is
>> >>>> the
>> >>>> corrected one (attached). Also added amplitude automation.
>> >>>>
>> >>>> P
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> www.peimankhosravi.co.uk
>> >>>>
>> >>>> To receive emails about upcoming concerts visit this page & enter
>> >>>> your
>> >>>> email address in the 'follow' section.
>> >>>>
>> >>>>
>> >>>>
>> >>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>> >>>> wrote:
>> >>>>>
>> >>>>> Thanks Steven,
>> >>>>>
>> >>>>> I really appreciate that. Super useful!
>> >>>>>
>> >>>>> All the best,
>> >>>>> Peiman
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> www.peimankhosravi.co.uk
>> >>>>>
>> >>>>> To receive emails about upcoming concerts visit this page & enter
>> >>>>> your
>> >>>>> email address in the 'follow' section.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>> >>>>>>
>> >>>>>> Hi Peiman,
>> >>>>>>
>> >>>>>> Thought I'd mention, you may want to consider using formatting
>> >>>>>> strings
>> >>>>>> [1] to modify:
>> >>>>>>
>> >>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>>
>> >>>>>> to:
>> >>>>>>
>> >>>>>>     paramName = '"%s.%g"'%(p4, p1)
>> >>>>>>
>> >>>>>> You may also want to use list slicing  [2] with multiple assignment
>> >>>>>> [2] to do something like this:
>> >>>>>>
>> >>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>> >>>>>>
>> >>>>>> String formatting is good to know as you can get a lot of control
>> >>>>>> about the string formatting, and the template string can be easier
>> >>>>>> to
>> >>>>>> use and understand, especially when using a lot of replacement
>> >>>>>> values.
>> >>>>>>  List slicing and multiple assignment are also handy syntax sugar
>> >>>>>> to
>> >>>>>> write more terser code.
>> >>>>>>
>> >>>>>> Hope that's useful!
>> >>>>>> steven
>> >>>>>>
>> >>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>> >>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>> >>>>>>
>> >>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> > No thank you and Steven for all your comments and contributions.
>> >>>>>> >
>> >>>>>> > I've had enough of staring at the computer tonight. Here's the
>> >>>>>> > latest
>> >>>>>> > function I came up with.
>> >>>>>> >
>> >>>>>> > Best,
>> >>>>>> > P
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > from csd.pysco import PythonScore
>> >>>>>> > from random import choice
>> >>>>>> >
>> >>>>>> > score = PythonScore()
>> >>>>>> > cue = score.cue
>> >>>>>> >
>> >>>>>> > score.write('f1 0 8192 10 1')
>> >>>>>> >
>> >>>>>> > def parameter(p1, name, type, envelope):
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >     if "l" in type:
>> >>>>>> >         p7 = 1
>> >>>>>> >     else:
>> >>>>>> >         p7 = 0
>> >>>>>> >
>> >>>>>> >     p4 = name
>> >>>>>> >     linseg = envelope
>> >>>>>> >
>> >>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >
>> >>>>>> >     for i in range(len(linseg)-4):
>> >>>>>> >
>> >>>>>> >         if i > 0:
>> >>>>>> >             i = i+1
>> >>>>>> >
>> >>>>>> >         t1 = linseg[i]
>> >>>>>> >         v1 = linseg[i+1]
>> >>>>>> >         t2 = linseg[i+2]
>> >>>>>> >         v2 = linseg[i+3]
>> >>>>>> >         start = t1
>> >>>>>> >         dur = t2-t1
>> >>>>>> >         point1 = v1
>> >>>>>> >         point2 = v2
>> >>>>>> >
>> >>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.i(3.1, 0, 10)
>> >>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.end();
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >
>> >>>>>> > To receive emails about upcoming concerts visit this page & enter
>> >>>>>> > your email
>> >>>>>> > address in the 'follow' section.
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>> >>>>>> > wrote:
>> >>>>>> >>
>> >>>>>> >> Thanks for posting these. I'm definitely reading and running
>> >>>>>> >> them.
>> >>>>>> >> Here's
>> >>>>>> >> an supported featured debugging feature that might help, which
>> >>>>>> >> will
>> >>>>>> >> eventually be transformed into an official feature. To see what
>> >>>>>> >> data is
>> >>>>>> >> currently in the score object, do this:
>> >>>>>> >>
>> >>>>>> >> for L in score.score_data:
>> >>>>>> >>     print L
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> >>>>>> >> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>
>> >>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>> >>>>>> >>> latest.
>> >>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>> >>>>>> >>> probably not
>> >>>>>> >>> the most efficient of doing it.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> from csd.pysco import PythonScore
>> >>>>>> >>> from random import choice
>> >>>>>> >>>
>> >>>>>> >>> score = PythonScore()
>> >>>>>> >>> cue = score.cue
>> >>>>>> >>>
>> >>>>>> >>> score.write('f1 0 8192 10 1')
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> def note(p1, p2, p3, list):
>> >>>>>> >>>
>> >>>>>> >>>     type = list.pop(1)
>> >>>>>> >>>
>> >>>>>> >>>     if "l" in type:
>> >>>>>> >>>         p7 = 1
>> >>>>>> >>>     else:
>> >>>>>> >>>         p7 = 0
>> >>>>>> >>>
>> >>>>>> >>>     p4 = list.pop(0)
>> >>>>>> >>>     linseg = list[0:]
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     score.i(p1, p2, p3)
>> >>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     for i in range(len(linseg)-4):
>> >>>>>> >>>
>> >>>>>> >>>         if i > 0:
>> >>>>>> >>>             i = i+1
>> >>>>>> >>>
>> >>>>>> >>>         t1 = linseg[i]
>> >>>>>> >>>         v1 = linseg[i+1]
>> >>>>>> >>>         t2 = linseg[i+2]
>> >>>>>> >>>         v2 = linseg[i+3]
>> >>>>>> >>>
>> >>>>>> >>>         start = t1
>> >>>>>> >>>         dur = t2-t1
>> >>>>>> >>>         point1 = v1
>> >>>>>> >>>         point2 = v2
>> >>>>>> >>>
>> >>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> score.end();
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> www.peimankhosravi.co.uk
>> >>>>>> >>>
>> >>>>>> >>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>> enter
>> >>>>>> >>> your
>> >>>>>> >>> email address in the 'follow' section.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>> >>>>>> >>> wrote:
>> >>>>>> >>>>
>> >>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>> >>>>>> >>>> examples in
>> >>>>>> >>>> the master branch of the CSD module:
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>> >>>>>> >>>>
>> >>>>>> >>>> The plan is to create/collect lots of examples as a way to
>> >>>>>> >>>> start
>> >>>>>> >>>> identifying some of the design patterns that Python brings to
>> >>>>>> >>>> the
>> >>>>>> >>>> score
>> >>>>>> >>>> environment. Once enough are collected and we have a sense of
>> >>>>>> >>>> good ways of
>> >>>>>> >>>> approaching common problems, functions and classes that reside
>> >>>>>> >>>> in
>> >>>>>> >>>> these
>> >>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and
>> >>>>>> >>>> placed
>> >>>>>> >>>> into
>> >>>>>> >>>> modules that come with CSD. The examples will be updated in
>> >>>>>> >>>> the
>> >>>>>> >>>> process.
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>> >>>>>> >>>> <jacobjoaquin@gmail.com>
>> >>>>>> >>>> wrote:
>> >>>>>> >>>>>
>> >>>>>> >>>>> Here is another approach:
>> >>>>>> >>>>>
>> >>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>> >>>>>> >>>>>
>> >>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>> >>>>>> >>>>> include
>> >>>>>> >>>>> it as an example case with PythonScore. In the meantime,
>> >>>>>> >>>>> here's
>> >>>>>> >>>>> the
>> >>>>>> >>>>> explanation of how it works.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Envelope shapes are generated as tables. They are created
>> >>>>>> >>>>> dynamically
>> >>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>> >>>>>> >>>>> they're being
>> >>>>>> >>>>> played, I created the table_cycler that cycles through a
>> >>>>>> >>>>> range
>> >>>>>> >>>>> of table
>> >>>>>> >>>>> indexes every time a new table is created. In this case, the
>> >>>>>> >>>>> range is
>> >>>>>> >>>>> between 100 and 120.
>> >>>>>> >>>>>
>> >>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>> >>>>>> >>>>>
>> >>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>> >>>>>> >>>>> list of
>> >>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>> >>>>>> >>>>> args are the
>> >>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>> >>>>>> >>>>> event pfields
>> >>>>>> >>>>> are automatically handled:
>> >>>>>> >>>>>
>> >>>>>> >>>>> def gen_envelope(*args):
>> >>>>>> >>>>>     global table_cycler
>> >>>>>> >>>>>
>> >>>>>> >>>>>     table = table_cycler.next()
>> >>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>> >>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>> >>>>>> >>>>>     return table
>> >>>>>> >>>>>
>> >>>>>> >>>>> That function returns the number of the table generated. So a
>> >>>>>> >>>>> value
>> >>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>> >>>>>> >>>>> performance,
>> >>>>>> >>>>> you'll see it cycle through this range.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>> >>>>>> >>>>> first 5
>> >>>>>> >>>>> notes in the score demo this explicitly:
>> >>>>>> >>>>>
>> >>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1,
>> >>>>>> >>>>> 8191,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> >>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100,
>> >>>>>> >>>>> 1,
>> >>>>>> >>>>> 7991,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>>
>> >>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>> >>>>>> >>>>> pattern
>> >>>>>> >>>>> and an envelope pattern.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Best,
>> >>>>>> >>>>> Jake
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>> >>>>>> >>>>> <jacobjoaquin@gmail.com>
>> >>>>>> >>>>> wrote:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>> >>>>>> >>>>>> arrays in C6
>> >>>>>> >>>>>> will support something like the following. To solve the
>> >>>>>> >>>>>> problem
>> >>>>>> >>>>>> you
>> >>>>>> >>>>>> presented, I think it would require two things. First, the
>> >>>>>> >>>>>> ability to pass
>> >>>>>> >>>>>> an as a pfield in the score:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> And then in the score, pass the array in as a list of args
>> >>>>>> >>>>>> for
>> >>>>>> >>>>>> opcodes:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> ienvpoints getarray p6
>> >>>>>> >>>>>> kenv linseg *ienvpoints
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> There may need to be a third step required for scaling the
>> >>>>>> >>>>>> even
>> >>>>>> >>>>>> fields
>> >>>>>> >>>>>> of the array, though is probably already supported by
>> >>>>>> >>>>>> orchestra
>> >>>>>> >>>>>> loop
>> >>>>>> >>>>>> statements.
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>> >>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Thanks very much Steven,
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>> >>>>>> >>>>>>> initial
>> >>>>>> >>>>>>> impression is that this is possibly too convoluted for
>> >>>>>> >>>>>>> quick
>> >>>>>> >>>>>>> and dirty
>> >>>>>> >>>>>>> experimentation. I think it should be easier than that.
>> >>>>>> >>>>>>> Maybe
>> >>>>>> >>>>>>> with array in
>> >>>>>> >>>>>>> csound6 it will be possible?
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Cheers,
>> >>>>>> >>>>>>> Peiman
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>>>>>> enter
>> >>>>>> >>>>>>> your email address in the 'follow' section.
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com>
>> >>>>>> >>>>>>> wrote:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hi Peiman,
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> I've done a couple of ways using score generation:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a
>> >>>>>> >>>>>>>> pfield
>> >>>>>> >>>>>>>> that
>> >>>>>> >>>>>>>> is
>> >>>>>> >>>>>>>> used as an index to choose what envelope to generate
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>> >>>>>> >>>>>>>> numbers
>> >>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment
>> >>>>>> >>>>>>>> becomes
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic
>> >>>>>> >>>>>>>> streams.
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> used this in pieces (you can check
>> >>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>> >>>>>> >>>>>>>> "StrA -
>> >>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>> >>>>>> >>>>>>>> group
>> >>>>>> >>>>>>>> glissandi sounds.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit
>> >>>>>> >>>>>>>> tricky,
>> >>>>>> >>>>>>>> but
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> got a set of UDO's now that I use together as a template
>> >>>>>> >>>>>>>> when
>> >>>>>> >>>>>>>> building
>> >>>>>> >>>>>>>> instruments that will work with different p-fields given
>> >>>>>> >>>>>>>> for
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score
>> >>>>>> >>>>>>>> with
>> >>>>>> >>>>>>>> 5-fields,
>> >>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>> >>>>>> >>>>>>>> work with
>> >>>>>> >>>>>>>> live, for quick sketching, or for generation.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> For example, code from my current piece uses:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> def scoreFunc():
>> >>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>> >>>>>> >>>>>>>> (10,-50)]),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>> >>>>>> >>>>>>>> (10,-50)]))
>> >>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>> >>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     return createUnstableGroup3(50,
>> >>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>> >>>>>> >>>>>>>> functions to
>> >>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>> >>>>>> >>>>>>>> generate
>> >>>>>> >>>>>>>> notes like:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327
>> >>>>>> >>>>>>>> -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> If that's of use, I can post some more of the code or
>> >>>>>> >>>>>>>> create
>> >>>>>> >>>>>>>> a more
>> >>>>>> >>>>>>>> isolated example from my piece.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hope that helps!
>> >>>>>> >>>>>>>> steven
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>> >>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>> >>>>>> >>>>>>>> > managed
>> >>>>>> >>>>>>>> > to make a
>> >>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now
>> >>>>>> >>>>>>>> > for
>> >>>>>> >>>>>>>> > the next
>> >>>>>> >>>>>>>> > step.
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>> >>>>>> >>>>>>>> > alongside
>> >>>>>> >>>>>>>> > PythonScore. It's great for generating score event but
>> >>>>>> >>>>>>>> > what
>> >>>>>> >>>>>>>> > if you
>> >>>>>> >>>>>>>> > also want
>> >>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>> >>>>>> >>>>>>>> > segments for
>> >>>>>> >>>>>>>> > each
>> >>>>>> >>>>>>>> > note? What if you want the envelop function to be
>> >>>>>> >>>>>>>> > generated
>> >>>>>> >>>>>>>> > by a
>> >>>>>> >>>>>>>> > python
>> >>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>> >>>>>> >>>>>>>> > think.
>> >>>>>> >>>>>>>> > What are the
>> >>>>>> >>>>>>>> > options? I
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Thanks
>> >>>>>> >>>>>>>> > P
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this
>> >>>>>> >>>>>>>> > page &
>> >>>>>> >>>>>>>> > enter
>> >>>>>> >>>>>>>> > your email
>> >>>>>> >>>>>>>> > address in the 'follow' section.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>> >>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with
>> >>>>>> >>>>>>>> body
>> >>>>>> >>>>>>>> "unsubscribe csound"
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> --
>> >>>>>> >>>>>> codehop.com | #code #art #music
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> --
>> >>>>>> >>>>> codehop.com | #code #art #music
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> --
>> >>>>>> >>>> codehop.com | #code #art #music
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> --
>> >>>>>> >> codehop.com | #code #art #music
>> >>>>>> >
>> >>>>>> >
>> >>>>>>
>> >>>>>>
>> >>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>>
>> >>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> Discussions of bugs and features can be posted here
>> >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>>>>> "unsubscribe csound"
>> >>>>>>
>> >>>>>
>> >>>>
>> >>>
>> >>
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-04-21 21:01
Frompeiman khosravi
SubjectRe: [Csnd] more python
Thank you for the info Mark and Michael. 

All the Best,
Peiman






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 21 April 2013 16:30, Michael Gogins <michael.gogins@gmail.com> wrote:
I just use tumblr. I do this because there are free themes that have both posts and pages, because it's easy to upload pages,and because you can post soundfiles. All this is free. I wish they would allow posts of PDF files, though. But you can link to externally hosted ones.

I did evaluate Wordpress as a hosting site but I went with tumblr because with Wordpress you have to pay for the ability to post soundfiles.

Regards,
Mike


On Sun, Apr 21, 2013 at 9:56 AM, Mark Brophy <mark@brophyworld.com> wrote:
I use Wordpress for my site and recommend it, too. I own my domain but using the Wordpress site attracts more traffic. If you have questions about customizing your site, you can usually get fast answers and there are meetups in every major city.


On Sun, Apr 21, 2013 at 8:31 AM, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I use Wordpress for my own website and like it quite a bit. It has a
concept of pages and posts, the first being a static page (though can
have comments too), and posts that are for news/blog items.  I think
most blogging and Content Management System platforms have these
abstractions these days.  Making themes for Wordpress isn't so bad,
and there's plenty you can choose from to start with and then modify.
A bit harder than just doing straight HTML probably, but overall a lot
easier to manage a site IMO.

Maybe you could try setting up an account on wordpress.org and test
out the administration console, make some pages, etc.  to see if you
like using it.  Nice thing is its easy to setup and account and test
without having to install anything.

Cheers!
steven


On Fri, Apr 19, 2013 at 1:23 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> Thanks Steven,
>
> On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
>>
>> Hi Peiman,
>>
>> Nice webpage!  Any thought to adding RSS or Atom so people can
>> subscribe to the page?
>
>
> I don't know how to do this, other than linking to an external blog. I'm
> making everything in a text editor and my html skills are minimal! it seems
> like a good idea to link to a wordpress page though. Unless you have a
> better suggestions.
>
>
>>
>>
>> As for polyphonic management, I use my orchestral composition library
>> [1] to do this.  The library is quite small.  There are Performer
>> objects that have things like instrument numbers assigned to them.
>> Each performer might have an instr num like "1.01" or "1.03". The
>> Performer has a space attribute and amplitude adjustment attribute.
>> The layers of the library allow for notes to be generated and the
>> Performer to "perform" the notes, applying their amp, space, and instr
>> num to the notes.  Other things can be applied here too. The
>> processing is like this
>>
>> NoteGenerator => [notes] => Performer => [modified notes] => output
>>
>
> Sounds nice. I must have a look. I have the book so I'll have a read later.
> And thanks for the link to the python library,
>
> P
>
>>
>> I'm not sure if Jake's CSD library works to return note objects/lists
>> that you can further manipulate or not.  If so, then you could create
>> your own function to decorate the contents of the list with further
>> values.
>>
>> I realize though re-reading your email that this technique isn't quite
>> automatic polyphony management per-se, but might be useful.
>>
>> Cheers!
>> steven
>>
>> [1] This orchestra library is described in my chapter in "The Audio
>> Programming Book".  The python library is browsable online at:
>>
>> http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/
>>
>>
>> On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>> > I've added a little something here:
>> > http://www.peimankhosravi.co.uk/miscellaneous.html
>> > P
>> >
>> >
>> >
>> >
>> >
>> >
>> > www.peimankhosravi.co.uk
>> >
>> > To receive emails about upcoming concerts visit this page & enter your
>> > email
>> > address in the 'follow' section.
>> >
>> >
>> >
>> > On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com>
>> > wrote:
>> >>
>> >> Here's an improved version:
>> >> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>> >>
>> >> Now the question is how to have an automated polyphonic management so
>> >> one
>> >> doesn't need to bother writing in the fractional part of the instrument
>> >> manually?
>> >>
>> >> An another question: how to make other types of interpolation, say, for
>> >> creating a periodic LFO sine function?
>> >>
>> >> Cheers,
>> >> P
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> www.peimankhosravi.co.uk
>> >>
>> >> To receive emails about upcoming concerts visit this page & enter your
>> >> email address in the 'follow' section.
>> >>
>> >>
>> >>
>> >> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com>
>> >> wrote:
>> >>>
>> >>> BTW I'm totally a convert to python. What a beauty. I don't know what
>> >>> those SC3 people are doing! Honestly!
>> >>>
>> >>> All I need to do now is to make the function into a class and the next
>> >>> time just write:
>> >>>
>> >>>
>> >>> <CsScore bin="python">
>> >>> from csd.pysco import PythonScore
>> >>> score = PythonScore()
>> >>> cue = score.cue
>> >>>
>> >>> score.write('f1 0 32768 10 1')
>> >>>
>> >>> with cue(0):
>> >>>     score.i(3.1, 0, 10)
>> >>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>> >>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10, 0.00001])
>> >>>
>> >>> score.end();
>> >>> </CsScore>
>> >>>
>> >>> What's more, one could have as many 'parameters' as one wishes without
>> >>> defining any extra functions in python.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> www.peimankhosravi.co.uk
>> >>>
>> >>> To receive emails about upcoming concerts visit this page & enter your
>> >>> email address in the 'follow' section.
>> >>>
>> >>>
>> >>>
>> >>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com>
>> >>> wrote:
>> >>>>
>> >>>> In fact what I had was also stupid on so many other levels! This is
>> >>>> the
>> >>>> corrected one (attached). Also added amplitude automation.
>> >>>>
>> >>>> P
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> www.peimankhosravi.co.uk
>> >>>>
>> >>>> To receive emails about upcoming concerts visit this page & enter
>> >>>> your
>> >>>> email address in the 'follow' section.
>> >>>>
>> >>>>
>> >>>>
>> >>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>> >>>> wrote:
>> >>>>>
>> >>>>> Thanks Steven,
>> >>>>>
>> >>>>> I really appreciate that. Super useful!
>> >>>>>
>> >>>>> All the best,
>> >>>>> Peiman
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> www.peimankhosravi.co.uk
>> >>>>>
>> >>>>> To receive emails about upcoming concerts visit this page & enter
>> >>>>> your
>> >>>>> email address in the 'follow' section.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>> >>>>>>
>> >>>>>> Hi Peiman,
>> >>>>>>
>> >>>>>> Thought I'd mention, you may want to consider using formatting
>> >>>>>> strings
>> >>>>>> [1] to modify:
>> >>>>>>
>> >>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>>
>> >>>>>> to:
>> >>>>>>
>> >>>>>>     paramName = '"%s.%g"'%(p4, p1)
>> >>>>>>
>> >>>>>> You may also want to use list slicing  [2] with multiple assignment
>> >>>>>> [2] to do something like this:
>> >>>>>>
>> >>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>> >>>>>>
>> >>>>>> String formatting is good to know as you can get a lot of control
>> >>>>>> about the string formatting, and the template string can be easier
>> >>>>>> to
>> >>>>>> use and understand, especially when using a lot of replacement
>> >>>>>> values.
>> >>>>>>  List slicing and multiple assignment are also handy syntax sugar
>> >>>>>> to
>> >>>>>> write more terser code.
>> >>>>>>
>> >>>>>> Hope that's useful!
>> >>>>>> steven
>> >>>>>>
>> >>>>>> [1] http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>> >>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>> >>>>>>
>> >>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> > No thank you and Steven for all your comments and contributions.
>> >>>>>> >
>> >>>>>> > I've had enough of staring at the computer tonight. Here's the
>> >>>>>> > latest
>> >>>>>> > function I came up with.
>> >>>>>> >
>> >>>>>> > Best,
>> >>>>>> > P
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > from csd.pysco import PythonScore
>> >>>>>> > from random import choice
>> >>>>>> >
>> >>>>>> > score = PythonScore()
>> >>>>>> > cue = score.cue
>> >>>>>> >
>> >>>>>> > score.write('f1 0 8192 10 1')
>> >>>>>> >
>> >>>>>> > def parameter(p1, name, type, envelope):
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >     if "l" in type:
>> >>>>>> >         p7 = 1
>> >>>>>> >     else:
>> >>>>>> >         p7 = 0
>> >>>>>> >
>> >>>>>> >     p4 = name
>> >>>>>> >     linseg = envelope
>> >>>>>> >
>> >>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >
>> >>>>>> >     for i in range(len(linseg)-4):
>> >>>>>> >
>> >>>>>> >         if i > 0:
>> >>>>>> >             i = i+1
>> >>>>>> >
>> >>>>>> >         t1 = linseg[i]
>> >>>>>> >         v1 = linseg[i+1]
>> >>>>>> >         t2 = linseg[i+2]
>> >>>>>> >         v2 = linseg[i+3]
>> >>>>>> >         start = t1
>> >>>>>> >         dur = t2-t1
>> >>>>>> >         point1 = v1
>> >>>>>> >         point2 = v2
>> >>>>>> >
>> >>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.i(3.1, 0, 10)
>> >>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > score.end();
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >
>> >>>>>> > To receive emails about upcoming concerts visit this page & enter
>> >>>>>> > your email
>> >>>>>> > address in the 'follow' section.
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>> >>>>>> > wrote:
>> >>>>>> >>
>> >>>>>> >> Thanks for posting these. I'm definitely reading and running
>> >>>>>> >> them.
>> >>>>>> >> Here's
>> >>>>>> >> an supported featured debugging feature that might help, which
>> >>>>>> >> will
>> >>>>>> >> eventually be transformed into an official feature. To see what
>> >>>>>> >> data is
>> >>>>>> >> currently in the score object, do this:
>> >>>>>> >>
>> >>>>>> >> for L in score.score_data:
>> >>>>>> >>     print L
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> >>>>>> >> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>
>> >>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's my
>> >>>>>> >>> latest.
>> >>>>>> >>> Much more readable. I'm not so suave with python [yet!] so it's
>> >>>>>> >>> probably not
>> >>>>>> >>> the most efficient of doing it.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> from csd.pysco import PythonScore
>> >>>>>> >>> from random import choice
>> >>>>>> >>>
>> >>>>>> >>> score = PythonScore()
>> >>>>>> >>> cue = score.cue
>> >>>>>> >>>
>> >>>>>> >>> score.write('f1 0 8192 10 1')
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> def note(p1, p2, p3, list):
>> >>>>>> >>>
>> >>>>>> >>>     type = list.pop(1)
>> >>>>>> >>>
>> >>>>>> >>>     if "l" in type:
>> >>>>>> >>>         p7 = 1
>> >>>>>> >>>     else:
>> >>>>>> >>>         p7 = 0
>> >>>>>> >>>
>> >>>>>> >>>     p4 = list.pop(0)
>> >>>>>> >>>     linseg = list[0:]
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     score.i(p1, p2, p3)
>> >>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>     for i in range(len(linseg)-4):
>> >>>>>> >>>
>> >>>>>> >>>         if i > 0:
>> >>>>>> >>>             i = i+1
>> >>>>>> >>>
>> >>>>>> >>>         t1 = linseg[i]
>> >>>>>> >>>         v1 = linseg[i+1]
>> >>>>>> >>>         t2 = linseg[i+2]
>> >>>>>> >>>         v2 = linseg[i+3]
>> >>>>>> >>>
>> >>>>>> >>>         start = t1
>> >>>>>> >>>         dur = t2-t1
>> >>>>>> >>>         point1 = v1
>> >>>>>> >>>         point2 = v2
>> >>>>>> >>>
>> >>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>> >>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> score.end();
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> www.peimankhosravi.co.uk
>> >>>>>> >>>
>> >>>>>> >>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>> enter
>> >>>>>> >>> your
>> >>>>>> >>> email address in the 'follow' section.
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin <jacobjoaquin@gmail.com>
>> >>>>>> >>> wrote:
>> >>>>>> >>>>
>> >>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>> >>>>>> >>>> examples in
>> >>>>>> >>>> the master branch of the CSD module:
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>> >>>>>> >>>>
>> >>>>>> >>>> The plan is to create/collect lots of examples as a way to
>> >>>>>> >>>> start
>> >>>>>> >>>> identifying some of the design patterns that Python brings to
>> >>>>>> >>>> the
>> >>>>>> >>>> score
>> >>>>>> >>>> environment. Once enough are collected and we have a sense of
>> >>>>>> >>>> good ways of
>> >>>>>> >>>> approaching common problems, functions and classes that reside
>> >>>>>> >>>> in
>> >>>>>> >>>> these
>> >>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and
>> >>>>>> >>>> placed
>> >>>>>> >>>> into
>> >>>>>> >>>> modules that come with CSD. The examples will be updated in
>> >>>>>> >>>> the
>> >>>>>> >>>> process.
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>> >>>>>> >>>> <jacobjoaquin@gmail.com>
>> >>>>>> >>>> wrote:
>> >>>>>> >>>>>
>> >>>>>> >>>>> Here is another approach:
>> >>>>>> >>>>>
>> >>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>> >>>>>> >>>>>
>> >>>>>> >>>>> I feel I can reduce this example further, and when I do, I'll
>> >>>>>> >>>>> include
>> >>>>>> >>>>> it as an example case with PythonScore. In the meantime,
>> >>>>>> >>>>> here's
>> >>>>>> >>>>> the
>> >>>>>> >>>>> explanation of how it works.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Envelope shapes are generated as tables. They are created
>> >>>>>> >>>>> dynamically
>> >>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>> >>>>>> >>>>> they're being
>> >>>>>> >>>>> played, I created the table_cycler that cycles through a
>> >>>>>> >>>>> range
>> >>>>>> >>>>> of table
>> >>>>>> >>>>> indexes every time a new table is created. In this case, the
>> >>>>>> >>>>> range is
>> >>>>>> >>>>> between 100 and 120.
>> >>>>>> >>>>>
>> >>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>> >>>>>> >>>>>
>> >>>>>> >>>>> The function that handles this is gen_envelope(). It takes a
>> >>>>>> >>>>> list of
>> >>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event. The
>> >>>>>> >>>>> args are the
>> >>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5 "f"
>> >>>>>> >>>>> event pfields
>> >>>>>> >>>>> are automatically handled:
>> >>>>>> >>>>>
>> >>>>>> >>>>> def gen_envelope(*args):
>> >>>>>> >>>>>     global table_cycler
>> >>>>>> >>>>>
>> >>>>>> >>>>>     table = table_cycler.next()
>> >>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] + list(args)
>> >>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>> >>>>>> >>>>>     return table
>> >>>>>> >>>>>
>> >>>>>> >>>>> That function returns the number of the table generated. So a
>> >>>>>> >>>>> value
>> >>>>>> >>>>> between 100 and 120. If you watch the table numbers during a
>> >>>>>> >>>>> performance,
>> >>>>>> >>>>> you'll see it cycle through this range.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Now, one can pass an arbitrary number of envelope points. The
>> >>>>>> >>>>> first 5
>> >>>>>> >>>>> notes in the score demo this explicitly:
>> >>>>>> >>>>>
>> >>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1,
>> >>>>>> >>>>> 8191,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> >>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1, 100,
>> >>>>>> >>>>> 1,
>> >>>>>> >>>>> 7991,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1,
>> >>>>>> >>>>> 100,
>> >>>>>> >>>>> 0))
>> >>>>>> >>>>>
>> >>>>>> >>>>> For the rest of the piece, it auto-cycles between a frequency
>> >>>>>> >>>>> pattern
>> >>>>>> >>>>> and an envelope pattern.
>> >>>>>> >>>>>
>> >>>>>> >>>>> Best,
>> >>>>>> >>>>> Jake
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>> >>>>>> >>>>> <jacobjoaquin@gmail.com>
>> >>>>>> >>>>> wrote:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>> >>>>>> >>>>>> arrays in C6
>> >>>>>> >>>>>> will support something like the following. To solve the
>> >>>>>> >>>>>> problem
>> >>>>>> >>>>>> you
>> >>>>>> >>>>>> presented, I think it would require two things. First, the
>> >>>>>> >>>>>> ability to pass
>> >>>>>> >>>>>> an as a pfield in the score:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> And then in the score, pass the array in as a list of args
>> >>>>>> >>>>>> for
>> >>>>>> >>>>>> opcodes:
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> ienvpoints getarray p6
>> >>>>>> >>>>>> kenv linseg *ienvpoints
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> There may need to be a third step required for scaling the
>> >>>>>> >>>>>> even
>> >>>>>> >>>>>> fields
>> >>>>>> >>>>>> of the array, though is probably already supported by
>> >>>>>> >>>>>> orchestra
>> >>>>>> >>>>>> loop
>> >>>>>> >>>>>> statements.
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>> >>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Thanks very much Steven,
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> I'm going to have a proper look at the code you posted. My
>> >>>>>> >>>>>>> initial
>> >>>>>> >>>>>>> impression is that this is possibly too convoluted for
>> >>>>>> >>>>>>> quick
>> >>>>>> >>>>>>> and dirty
>> >>>>>> >>>>>>> experimentation. I think it should be easier than that.
>> >>>>>> >>>>>>> Maybe
>> >>>>>> >>>>>>> with array in
>> >>>>>> >>>>>>> csound6 it will be possible?
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> Cheers,
>> >>>>>> >>>>>>> Peiman
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> To receive emails about upcoming concerts visit this page &
>> >>>>>> >>>>>>> enter
>> >>>>>> >>>>>>> your email address in the 'follow' section.
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com>
>> >>>>>> >>>>>>> wrote:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hi Peiman,
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> I've done a couple of ways using score generation:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a
>> >>>>>> >>>>>>>> pfield
>> >>>>>> >>>>>>>> that
>> >>>>>> >>>>>>>> is
>> >>>>>> >>>>>>>> used as an index to choose what envelope to generate
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>> >>>>>> >>>>>>>> numbers
>> >>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment
>> >>>>>> >>>>>>>> becomes
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic
>> >>>>>> >>>>>>>> streams.
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> used this in pieces (you can check
>> >>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue, the
>> >>>>>> >>>>>>>> "StrA -
>> >>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to do
>> >>>>>> >>>>>>>> group
>> >>>>>> >>>>>>>> glissandi sounds.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit
>> >>>>>> >>>>>>>> tricky,
>> >>>>>> >>>>>>>> but
>> >>>>>> >>>>>>>> I've
>> >>>>>> >>>>>>>> got a set of UDO's now that I use together as a template
>> >>>>>> >>>>>>>> when
>> >>>>>> >>>>>>>> building
>> >>>>>> >>>>>>>> instruments that will work with different p-fields given
>> >>>>>> >>>>>>>> for
>> >>>>>> >>>>>>>> a note.
>> >>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score
>> >>>>>> >>>>>>>> with
>> >>>>>> >>>>>>>> 5-fields,
>> >>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice to
>> >>>>>> >>>>>>>> work with
>> >>>>>> >>>>>>>> live, for quick sketching, or for generation.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> For example, code from my current piece uses:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> def scoreFunc():
>> >>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>> >>>>>> >>>>>>>> (10,-50)]),
>> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>> >>>>>> >>>>>>>> (10,-50)]))
>> >>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>> >>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>> >>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>     return createUnstableGroup3(50,
>> >>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>> >>>>>> >>>>>>>> functions to
>> >>>>>> >>>>>>>> generate a score performance func that groupB64A uses to
>> >>>>>> >>>>>>>> generate
>> >>>>>> >>>>>>>> notes like:
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0 -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786 -19.650074
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394 -19.493192
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814 -19.185775
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616 -19.101318
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475 -18.854064
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136 -18.681332
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112 -18.381339
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678 -18.391186
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639 -18.016504
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337 -17.852918
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320 -17.739093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210 -17.638612
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275 -17.281441
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516 -17.084029
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609 -16.852563
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858 -16.765706
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430 -16.53684
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195 -16.509181
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067 -16.071466
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041 -16.044135
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830 -15.876995
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649 -15.334785
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464 -15.10768
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039 -15.110869
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694 -14.97975
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164 -15.162844
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682 -15.031393
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819 -15.081042
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530 -14.882624
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436 -14.896086
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630 -15.091414
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598 -15.158592
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631 -14.899716
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497 -14.702429
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571 -15.131773
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599 -14.636183
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542 -15.131769
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326 -14.890712
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534 -15.07093
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513 -15.454695
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626 -18.76601
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327
>> >>>>>> >>>>>>>> -0.25
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581 -25.679255
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516 -29.276605
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553 -32.679133
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488 -36.302659
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535 -39.657244
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618 -43.120713
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564 -46.535213
>> >>>>>> >>>>>>>> -0.25 3
>> >>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0 -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445 -19.726454
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732 -19.534423
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213 -19.336654
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503 -19.100944
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563 -18.944366
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089 -18.654563
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043 -18.580576
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825 -18.39672
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133 -18.135332
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658 -17.827478
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203 -17.834061
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828 -17.468498
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894 -17.24293
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114 -17.232881
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347 -16.858355
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614 -16.843183
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251 -16.766116
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558 -16.595441
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304 -16.3045
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895 -15.703265
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554 -15.859913
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801 -15.421733
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872 -15.286325
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854 -15.092432
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928 -15.33225
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176 -14.95168
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243 -15.171952
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119 -15.186156
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015 -14.923437
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413 -15.015476
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618 -14.95512
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673 -15.01983
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560 -14.947699
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562 -14.860861
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555 -15.19329
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403 -14.891687
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463 -14.906846
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534 -14.9106
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711 -15.538188
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773 -18.722346
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627 -22.296946
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463 -25.803823
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557 -29.274249
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479 -36.102589
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475 -43.077308
>> >>>>>> >>>>>>>> -0.2 3
>> >>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489 -46.505476
>> >>>>>> >>>>>>>> -0.2
>> >>>>>> >>>>>>>> 3
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> If that's of use, I can post some more of the code or
>> >>>>>> >>>>>>>> create
>> >>>>>> >>>>>>>> a more
>> >>>>>> >>>>>>>> isolated example from my piece.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Hope that helps!
>> >>>>>> >>>>>>>> steven
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>> >>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>> >>>>>> >>>>>>>> > OK, this is very positive. In just one hour last night I
>> >>>>>> >>>>>>>> > managed
>> >>>>>> >>>>>>>> > to make a
>> >>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now
>> >>>>>> >>>>>>>> > for
>> >>>>>> >>>>>>>> > the next
>> >>>>>> >>>>>>>> > step.
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Say we have a pattern library in python that can be used
>> >>>>>> >>>>>>>> > alongside
>> >>>>>> >>>>>>>> > PythonScore. It's great for generating score event but
>> >>>>>> >>>>>>>> > what
>> >>>>>> >>>>>>>> > if you
>> >>>>>> >>>>>>>> > also want
>> >>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>> >>>>>> >>>>>>>> > segments for
>> >>>>>> >>>>>>>> > each
>> >>>>>> >>>>>>>> > note? What if you want the envelop function to be
>> >>>>>> >>>>>>>> > generated
>> >>>>>> >>>>>>>> > by a
>> >>>>>> >>>>>>>> > python
>> >>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant I
>> >>>>>> >>>>>>>> > think.
>> >>>>>> >>>>>>>> > What are the
>> >>>>>> >>>>>>>> > options? I
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > Thanks
>> >>>>>> >>>>>>>> > P
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>> >>>>>> >>>>>>>> >
>> >>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this
>> >>>>>> >>>>>>>> > page &
>> >>>>>> >>>>>>>> > enter
>> >>>>>> >>>>>>>> > your email
>> >>>>>> >>>>>>>> > address in the 'follow' section.
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>> >>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with
>> >>>>>> >>>>>>>> body
>> >>>>>> >>>>>>>> "unsubscribe csound"
>> >>>>>> >>>>>>>>
>> >>>>>> >>>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>>
>> >>>>>> >>>>>> --
>> >>>>>> >>>>>> codehop.com | #code #art #music
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>>
>> >>>>>> >>>>> --
>> >>>>>> >>>>> codehop.com | #code #art #music
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>>
>> >>>>>> >>>> --
>> >>>>>> >>>> codehop.com | #code #art #music
>> >>>>>> >>>
>> >>>>>> >>>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >>
>> >>>>>> >> --
>> >>>>>> >> codehop.com | #code #art #music
>> >>>>>> >
>> >>>>>> >
>> >>>>>>
>> >>>>>>
>> >>>>>> Send bugs reports to the Sourceforge bug tracker
>> >>>>>>
>> >>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >>>>>> Discussions of bugs and features can be posted here
>> >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >>>>>> "unsubscribe csound"
>> >>>>>>
>> >>>>>
>> >>>>
>> >>>
>> >>
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com


Date2013-04-21 22:15
FromSteven Yi
SubjectRe: [Csnd] more python
Hi Peiman,

I'm not sure about wordpress.com's pricing, as I've only ever used a
self-installed version.  I'm not sure if you can install wordpress on
the server that you are using for your main site; if so, I've found it
easy to install an manage.

steven

On Sun, Apr 21, 2013 at 7:54 PM, peiman khosravi
 wrote:
> Hi Steven,
>
> I've got one page here (http://spectralkimia.wordpress.com) for publishing
> concert news. It looks like in order to have access to the html code one
> needs to pay for the 'pro' version or something like that. Maybe I've just
> missed something? I think for now I will link to another wordpress page from
> my website for posting miscellaneous stuff.
>
> Thanks
> Peiman
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 21 April 2013 14:31, Steven Yi  wrote:
>>
>> Hi Peiman,
>>
>> I use Wordpress for my own website and like it quite a bit. It has a
>> concept of pages and posts, the first being a static page (though can
>> have comments too), and posts that are for news/blog items.  I think
>> most blogging and Content Management System platforms have these
>> abstractions these days.  Making themes for Wordpress isn't so bad,
>> and there's plenty you can choose from to start with and then modify.
>> A bit harder than just doing straight HTML probably, but overall a lot
>> easier to manage a site IMO.
>>
>> Maybe you could try setting up an account on wordpress.org and test
>> out the administration console, make some pages, etc.  to see if you
>> like using it.  Nice thing is its easy to setup and account and test
>> without having to install anything.
>>
>> Cheers!
>> steven
>>
>>
>> On Fri, Apr 19, 2013 at 1:23 PM, peiman khosravi
>>  wrote:
>> > Thanks Steven,
>> >
>> > On 19 April 2013 12:58, Steven Yi  wrote:
>> >>
>> >> Hi Peiman,
>> >>
>> >> Nice webpage!  Any thought to adding RSS or Atom so people can
>> >> subscribe to the page?
>> >
>> >
>> > I don't know how to do this, other than linking to an external blog. I'm
>> > making everything in a text editor and my html skills are minimal! it
>> > seems
>> > like a good idea to link to a wordpress page though. Unless you have a
>> > better suggestions.
>> >
>> >
>> >>
>> >>
>> >> As for polyphonic management, I use my orchestral composition library
>> >> [1] to do this.  The library is quite small.  There are Performer
>> >> objects that have things like instrument numbers assigned to them.
>> >> Each performer might have an instr num like "1.01" or "1.03". The
>> >> Performer has a space attribute and amplitude adjustment attribute.
>> >> The layers of the library allow for notes to be generated and the
>> >> Performer to "perform" the notes, applying their amp, space, and instr
>> >> num to the notes.  Other things can be applied here too. The
>> >> processing is like this
>> >>
>> >> NoteGenerator => [notes] => Performer => [modified notes] => output
>> >>
>> >
>> > Sounds nice. I must have a look. I have the book so I'll have a read
>> > later.
>> > And thanks for the link to the python library,
>> >
>> > P
>> >
>> >>
>> >> I'm not sure if Jake's CSD library works to return note objects/lists
>> >> that you can further manipulate or not.  If so, then you could create
>> >> your own function to decorate the contents of the list with further
>> >> values.
>> >>
>> >> I realize though re-reading your email that this technique isn't quite
>> >> automatic polyphony management per-se, but might be useful.
>> >>
>> >> Cheers!
>> >> steven
>> >>
>> >> [1] This orchestra library is described in my chapter in "The Audio
>> >> Programming Book".  The python library is browsable online at:
>> >>
>> >>
>> >> http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/
>> >>
>> >>
>> >> On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
>> >>  wrote:
>> >> > I've added a little something here:
>> >> > http://www.peimankhosravi.co.uk/miscellaneous.html
>> >> > P
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > www.peimankhosravi.co.uk
>> >> >
>> >> > To receive emails about upcoming concerts visit this page & enter
>> >> > your
>> >> > email
>> >> > address in the 'follow' section.
>> >> >
>> >> >
>> >> >
>> >> > On 19 April 2013 10:45, peiman khosravi 
>> >> > wrote:
>> >> >>
>> >> >> Here's an improved version:
>> >> >> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>> >> >>
>> >> >> Now the question is how to have an automated polyphonic management
>> >> >> so
>> >> >> one
>> >> >> doesn't need to bother writing in the fractional part of the
>> >> >> instrument
>> >> >> manually?
>> >> >>
>> >> >> An another question: how to make other types of interpolation, say,
>> >> >> for
>> >> >> creating a periodic LFO sine function?
>> >> >>
>> >> >> Cheers,
>> >> >> P
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> www.peimankhosravi.co.uk
>> >> >>
>> >> >> To receive emails about upcoming concerts visit this page & enter
>> >> >> your
>> >> >> email address in the 'follow' section.
>> >> >>
>> >> >>
>> >> >>
>> >> >> On 19 April 2013 01:30, peiman khosravi 
>> >> >> wrote:
>> >> >>>
>> >> >>> BTW I'm totally a convert to python. What a beauty. I don't know
>> >> >>> what
>> >> >>> those SC3 people are doing! Honestly!
>> >> >>>
>> >> >>> All I need to do now is to make the function into a class and the
>> >> >>> next
>> >> >>> time just write:
>> >> >>>
>> >> >>>
>> >> >>> 
>> >> >>> from csd.pysco import PythonScore
>> >> >>> score = PythonScore()
>> >> >>> cue = score.cue
>> >> >>>
>> >> >>> score.write('f1 0 32768 10 1')
>> >> >>>
>> >> >>> with cue(0):
>> >> >>>     score.i(3.1, 0, 10)
>> >> >>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>> >> >>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10,
>> >> >>> 0.00001])
>> >> >>>
>> >> >>> score.end();
>> >> >>> 
>> >> >>>
>> >> >>> What's more, one could have as many 'parameters' as one wishes
>> >> >>> without
>> >> >>> defining any extra functions in python.
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> www.peimankhosravi.co.uk
>> >> >>>
>> >> >>> To receive emails about upcoming concerts visit this page & enter
>> >> >>> your
>> >> >>> email address in the 'follow' section.
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> On 19 April 2013 01:17, peiman khosravi 
>> >> >>> wrote:
>> >> >>>>
>> >> >>>> In fact what I had was also stupid on so many other levels! This
>> >> >>>> is
>> >> >>>> the
>> >> >>>> corrected one (attached). Also added amplitude automation.
>> >> >>>>
>> >> >>>> P
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> www.peimankhosravi.co.uk
>> >> >>>>
>> >> >>>> To receive emails about upcoming concerts visit this page & enter
>> >> >>>> your
>> >> >>>> email address in the 'follow' section.
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> On 19 April 2013 00:07, peiman khosravi 
>> >> >>>> wrote:
>> >> >>>>>
>> >> >>>>> Thanks Steven,
>> >> >>>>>
>> >> >>>>> I really appreciate that. Super useful!
>> >> >>>>>
>> >> >>>>> All the best,
>> >> >>>>> Peiman
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> www.peimankhosravi.co.uk
>> >> >>>>>
>> >> >>>>> To receive emails about upcoming concerts visit this page & enter
>> >> >>>>> your
>> >> >>>>> email address in the 'follow' section.
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> On 18 April 2013 23:45, Steven Yi  wrote:
>> >> >>>>>>
>> >> >>>>>> Hi Peiman,
>> >> >>>>>>
>> >> >>>>>> Thought I'd mention, you may want to consider using formatting
>> >> >>>>>> strings
>> >> >>>>>> [1] to modify:
>> >> >>>>>>
>> >> >>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >> >>>>>>
>> >> >>>>>> to:
>> >> >>>>>>
>> >> >>>>>>     paramName = '"%s.%g"'%(p4, p1)
>> >> >>>>>>
>> >> >>>>>> You may also want to use list slicing  [2] with multiple
>> >> >>>>>> assignment
>> >> >>>>>> [2] to do something like this:
>> >> >>>>>>
>> >> >>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>> >> >>>>>>
>> >> >>>>>> String formatting is good to know as you can get a lot of
>> >> >>>>>> control
>> >> >>>>>> about the string formatting, and the template string can be
>> >> >>>>>> easier
>> >> >>>>>> to
>> >> >>>>>> use and understand, especially when using a lot of replacement
>> >> >>>>>> values.
>> >> >>>>>>  List slicing and multiple assignment are also handy syntax
>> >> >>>>>> sugar
>> >> >>>>>> to
>> >> >>>>>> write more terser code.
>> >> >>>>>>
>> >> >>>>>> Hope that's useful!
>> >> >>>>>> steven
>> >> >>>>>>
>> >> >>>>>> [1]
>> >> >>>>>> http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>> >> >>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>> >> >>>>>>
>> >> >>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>> >> >>>>>>  wrote:
>> >> >>>>>> > No thank you and Steven for all your comments and
>> >> >>>>>> > contributions.
>> >> >>>>>> >
>> >> >>>>>> > I've had enough of staring at the computer tonight. Here's the
>> >> >>>>>> > latest
>> >> >>>>>> > function I came up with.
>> >> >>>>>> >
>> >> >>>>>> > Best,
>> >> >>>>>> > P
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > from csd.pysco import PythonScore
>> >> >>>>>> > from random import choice
>> >> >>>>>> >
>> >> >>>>>> > score = PythonScore()
>> >> >>>>>> > cue = score.cue
>> >> >>>>>> >
>> >> >>>>>> > score.write('f1 0 8192 10 1')
>> >> >>>>>> >
>> >> >>>>>> > def parameter(p1, name, type, envelope):
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >     if "l" in type:
>> >> >>>>>> >         p7 = 1
>> >> >>>>>> >     else:
>> >> >>>>>> >         p7 = 0
>> >> >>>>>> >
>> >> >>>>>> >     p4 = name
>> >> >>>>>> >     linseg = envelope
>> >> >>>>>> >
>> >> >>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>> >> >>>>>> >
>> >> >>>>>> >     for i in range(len(linseg)-4):
>> >> >>>>>> >
>> >> >>>>>> >         if i > 0:
>> >> >>>>>> >             i = i+1
>> >> >>>>>> >
>> >> >>>>>> >         t1 = linseg[i]
>> >> >>>>>> >         v1 = linseg[i+1]
>> >> >>>>>> >         t2 = linseg[i+2]
>> >> >>>>>> >         v2 = linseg[i+3]
>> >> >>>>>> >         start = t1
>> >> >>>>>> >         dur = t2-t1
>> >> >>>>>> >         point1 = v1
>> >> >>>>>> >         point2 = v2
>> >> >>>>>> >
>> >> >>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > score.i(3.1, 0, 10)
>> >> >>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > score.end();
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > www.peimankhosravi.co.uk
>> >> >>>>>> >
>> >> >>>>>> > To receive emails about upcoming concerts visit this page &
>> >> >>>>>> > enter
>> >> >>>>>> > your email
>> >> >>>>>> > address in the 'follow' section.
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > On 18 April 2013 23:09, Jacob Joaquin 
>> >> >>>>>> > wrote:
>> >> >>>>>> >>
>> >> >>>>>> >> Thanks for posting these. I'm definitely reading and running
>> >> >>>>>> >> them.
>> >> >>>>>> >> Here's
>> >> >>>>>> >> an supported featured debugging feature that might help,
>> >> >>>>>> >> which
>> >> >>>>>> >> will
>> >> >>>>>> >> eventually be transformed into an official feature. To see
>> >> >>>>>> >> what
>> >> >>>>>> >> data is
>> >> >>>>>> >> currently in the score object, do this:
>> >> >>>>>> >>
>> >> >>>>>> >> for L in score.score_data:
>> >> >>>>>> >>     print L
>> >> >>>>>> >>
>> >> >>>>>> >>
>> >> >>>>>> >>
>> >> >>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> >> >>>>>> >>  wrote:
>> >> >>>>>> >>>
>> >> >>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's
>> >> >>>>>> >>> my
>> >> >>>>>> >>> latest.
>> >> >>>>>> >>> Much more readable. I'm not so suave with python [yet!] so
>> >> >>>>>> >>> it's
>> >> >>>>>> >>> probably not
>> >> >>>>>> >>> the most efficient of doing it.
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> from csd.pysco import PythonScore
>> >> >>>>>> >>> from random import choice
>> >> >>>>>> >>>
>> >> >>>>>> >>> score = PythonScore()
>> >> >>>>>> >>> cue = score.cue
>> >> >>>>>> >>>
>> >> >>>>>> >>> score.write('f1 0 8192 10 1')
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> def note(p1, p2, p3, list):
>> >> >>>>>> >>>
>> >> >>>>>> >>>     type = list.pop(1)
>> >> >>>>>> >>>
>> >> >>>>>> >>>     if "l" in type:
>> >> >>>>>> >>>         p7 = 1
>> >> >>>>>> >>>     else:
>> >> >>>>>> >>>         p7 = 0
>> >> >>>>>> >>>
>> >> >>>>>> >>>     p4 = list.pop(0)
>> >> >>>>>> >>>     linseg = list[0:]
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>     score.i(p1, p2, p3)
>> >> >>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>     for i in range(len(linseg)-4):
>> >> >>>>>> >>>
>> >> >>>>>> >>>         if i > 0:
>> >> >>>>>> >>>             i = i+1
>> >> >>>>>> >>>
>> >> >>>>>> >>>         t1 = linseg[i]
>> >> >>>>>> >>>         v1 = linseg[i+1]
>> >> >>>>>> >>>         t2 = linseg[i+2]
>> >> >>>>>> >>>         v2 = linseg[i+3]
>> >> >>>>>> >>>
>> >> >>>>>> >>>         start = t1
>> >> >>>>>> >>>         dur = t2-t1
>> >> >>>>>> >>>         point1 = v1
>> >> >>>>>> >>>         point2 = v2
>> >> >>>>>> >>>
>> >> >>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>> >> >>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> score.end();
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> www.peimankhosravi.co.uk
>> >> >>>>>> >>>
>> >> >>>>>> >>> To receive emails about upcoming concerts visit this page &
>> >> >>>>>> >>> enter
>> >> >>>>>> >>> your
>> >> >>>>>> >>> email address in the 'follow' section.
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin
>> >> >>>>>> >>> 
>> >> >>>>>> >>> wrote:
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>> >> >>>>>> >>>> examples in
>> >> >>>>>> >>>> the master branch of the CSD module:
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> The plan is to create/collect lots of examples as a way to
>> >> >>>>>> >>>> start
>> >> >>>>>> >>>> identifying some of the design patterns that Python brings
>> >> >>>>>> >>>> to
>> >> >>>>>> >>>> the
>> >> >>>>>> >>>> score
>> >> >>>>>> >>>> environment. Once enough are collected and we have a sense
>> >> >>>>>> >>>> of
>> >> >>>>>> >>>> good ways of
>> >> >>>>>> >>>> approaching common problems, functions and classes that
>> >> >>>>>> >>>> reside
>> >> >>>>>> >>>> in
>> >> >>>>>> >>>> these
>> >> >>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and
>> >> >>>>>> >>>> placed
>> >> >>>>>> >>>> into
>> >> >>>>>> >>>> modules that come with CSD. The examples will be updated in
>> >> >>>>>> >>>> the
>> >> >>>>>> >>>> process.
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>> >> >>>>>> >>>> 
>> >> >>>>>> >>>> wrote:
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> Here is another approach:
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> I feel I can reduce this example further, and when I do,
>> >> >>>>>> >>>>> I'll
>> >> >>>>>> >>>>> include
>> >> >>>>>> >>>>> it as an example case with PythonScore. In the meantime,
>> >> >>>>>> >>>>> here's
>> >> >>>>>> >>>>> the
>> >> >>>>>> >>>>> explanation of how it works.
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> Envelope shapes are generated as tables. They are created
>> >> >>>>>> >>>>> dynamically
>> >> >>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>> >> >>>>>> >>>>> they're being
>> >> >>>>>> >>>>> played, I created the table_cycler that cycles through a
>> >> >>>>>> >>>>> range
>> >> >>>>>> >>>>> of table
>> >> >>>>>> >>>>> indexes every time a new table is created. In this case,
>> >> >>>>>> >>>>> the
>> >> >>>>>> >>>>> range is
>> >> >>>>>> >>>>> between 100 and 120.
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> The function that handles this is gen_envelope(). It takes
>> >> >>>>>> >>>>> a
>> >> >>>>>> >>>>> list of
>> >> >>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event.
>> >> >>>>>> >>>>> The
>> >> >>>>>> >>>>> args are the
>> >> >>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5
>> >> >>>>>> >>>>> "f"
>> >> >>>>>> >>>>> event pfields
>> >> >>>>>> >>>>> are automatically handled:
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> def gen_envelope(*args):
>> >> >>>>>> >>>>>     global table_cycler
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>     table = table_cycler.next()
>> >> >>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] +
>> >> >>>>>> >>>>> list(args)
>> >> >>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>> >> >>>>>> >>>>>     return table
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> That function returns the number of the table generated.
>> >> >>>>>> >>>>> So a
>> >> >>>>>> >>>>> value
>> >> >>>>>> >>>>> between 100 and 120. If you watch the table numbers during
>> >> >>>>>> >>>>> a
>> >> >>>>>> >>>>> performance,
>> >> >>>>>> >>>>> you'll see it cycle through this range.
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> Now, one can pass an arbitrary number of envelope points.
>> >> >>>>>> >>>>> The
>> >> >>>>>> >>>>> first 5
>> >> >>>>>> >>>>> notes in the score demo this explicitly:
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1,
>> >> >>>>>> >>>>> 100,
>> >> >>>>>> >>>>> 0))
>> >> >>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1,
>> >> >>>>>> >>>>> 8191,
>> >> >>>>>> >>>>> 0))
>> >> >>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> >> >>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1,
>> >> >>>>>> >>>>> 100,
>> >> >>>>>> >>>>> 1,
>> >> >>>>>> >>>>> 7991,
>> >> >>>>>> >>>>> 0))
>> >> >>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1,
>> >> >>>>>> >>>>> 100,
>> >> >>>>>> >>>>> 0))
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> For the rest of the piece, it auto-cycles between a
>> >> >>>>>> >>>>> frequency
>> >> >>>>>> >>>>> pattern
>> >> >>>>>> >>>>> and an envelope pattern.
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> Best,
>> >> >>>>>> >>>>> Jake
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>> >> >>>>>> >>>>> 
>> >> >>>>>> >>>>> wrote:
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>> >> >>>>>> >>>>>> arrays in C6
>> >> >>>>>> >>>>>> will support something like the following. To solve the
>> >> >>>>>> >>>>>> problem
>> >> >>>>>> >>>>>> you
>> >> >>>>>> >>>>>> presented, I think it would require two things. First,
>> >> >>>>>> >>>>>> the
>> >> >>>>>> >>>>>> ability to pass
>> >> >>>>>> >>>>>> an as a pfield in the score:
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> And then in the score, pass the array in as a list of
>> >> >>>>>> >>>>>> args
>> >> >>>>>> >>>>>> for
>> >> >>>>>> >>>>>> opcodes:
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> ienvpoints getarray p6
>> >> >>>>>> >>>>>> kenv linseg *ienvpoints
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> There may need to be a third step required for scaling
>> >> >>>>>> >>>>>> the
>> >> >>>>>> >>>>>> even
>> >> >>>>>> >>>>>> fields
>> >> >>>>>> >>>>>> of the array, though is probably already supported by
>> >> >>>>>> >>>>>> orchestra
>> >> >>>>>> >>>>>> loop
>> >> >>>>>> >>>>>> statements.
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>> >> >>>>>> >>>>>>  wrote:
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> Thanks very much Steven,
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> I'm going to have a proper look at the code you posted.
>> >> >>>>>> >>>>>>> My
>> >> >>>>>> >>>>>>> initial
>> >> >>>>>> >>>>>>> impression is that this is possibly too convoluted for
>> >> >>>>>> >>>>>>> quick
>> >> >>>>>> >>>>>>> and dirty
>> >> >>>>>> >>>>>>> experimentation. I think it should be easier than that.
>> >> >>>>>> >>>>>>> Maybe
>> >> >>>>>> >>>>>>> with array in
>> >> >>>>>> >>>>>>> csound6 it will be possible?
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> Cheers,
>> >> >>>>>> >>>>>>> Peiman
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> www.peimankhosravi.co.uk
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> To receive emails about upcoming concerts visit this
>> >> >>>>>> >>>>>>> page &
>> >> >>>>>> >>>>>>> enter
>> >> >>>>>> >>>>>>> your email address in the 'follow' section.
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi 
>> >> >>>>>> >>>>>>> wrote:
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> Hi Peiman,
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> I've done a couple of ways using score generation:
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a
>> >> >>>>>> >>>>>>>> pfield
>> >> >>>>>> >>>>>>>> that
>> >> >>>>>> >>>>>>>> is
>> >> >>>>>> >>>>>>>> used as an index to choose what envelope to generate
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>> >> >>>>>> >>>>>>>> numbers
>> >> >>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment
>> >> >>>>>> >>>>>>>> becomes
>> >> >>>>>> >>>>>>>> a note.
>> >> >>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic
>> >> >>>>>> >>>>>>>> streams.
>> >> >>>>>> >>>>>>>> I've
>> >> >>>>>> >>>>>>>> used this in pieces (you can check
>> >> >>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue,
>> >> >>>>>> >>>>>>>> the
>> >> >>>>>> >>>>>>>> "StrA -
>> >> >>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to
>> >> >>>>>> >>>>>>>> do
>> >> >>>>>> >>>>>>>> group
>> >> >>>>>> >>>>>>>> glissandi sounds.
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit
>> >> >>>>>> >>>>>>>> tricky,
>> >> >>>>>> >>>>>>>> but
>> >> >>>>>> >>>>>>>> I've
>> >> >>>>>> >>>>>>>> got a set of UDO's now that I use together as a
>> >> >>>>>> >>>>>>>> template
>> >> >>>>>> >>>>>>>> when
>> >> >>>>>> >>>>>>>> building
>> >> >>>>>> >>>>>>>> instruments that will work with different p-fields
>> >> >>>>>> >>>>>>>> given
>> >> >>>>>> >>>>>>>> for
>> >> >>>>>> >>>>>>>> a note.
>> >> >>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score
>> >> >>>>>> >>>>>>>> with
>> >> >>>>>> >>>>>>>> 5-fields,
>> >> >>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice
>> >> >>>>>> >>>>>>>> to
>> >> >>>>>> >>>>>>>> work with
>> >> >>>>>> >>>>>>>> live, for quick sketching, or for generation.
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> For example, code from my current piece uses:
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> def scoreFunc():
>> >> >>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>> >> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>> >> >>>>>> >>>>>>>> (10,-50)]),
>> >> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>> >> >>>>>> >>>>>>>> (10,-50)]))
>> >> >>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>> >> >>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>> >> >>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>     return createUnstableGroup3(50,
>> >> >>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>> >> >>>>>> >>>>>>>> functions to
>> >> >>>>>> >>>>>>>> generate a score performance func that groupB64A uses
>> >> >>>>>> >>>>>>>> to
>> >> >>>>>> >>>>>>>> generate
>> >> >>>>>> >>>>>>>> notes like:
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0
>> >> >>>>>> >>>>>>>> -0.25
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786
>> >> >>>>>> >>>>>>>> -19.650074
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394
>> >> >>>>>> >>>>>>>> -19.493192
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814
>> >> >>>>>> >>>>>>>> -19.185775
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616
>> >> >>>>>> >>>>>>>> -19.101318
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475
>> >> >>>>>> >>>>>>>> -18.854064
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136
>> >> >>>>>> >>>>>>>> -18.681332
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112
>> >> >>>>>> >>>>>>>> -18.381339
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678
>> >> >>>>>> >>>>>>>> -18.391186
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639
>> >> >>>>>> >>>>>>>> -18.016504
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337
>> >> >>>>>> >>>>>>>> -17.852918
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320
>> >> >>>>>> >>>>>>>> -17.739093
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210
>> >> >>>>>> >>>>>>>> -17.638612
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275
>> >> >>>>>> >>>>>>>> -17.281441
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516
>> >> >>>>>> >>>>>>>> -17.084029
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609
>> >> >>>>>> >>>>>>>> -16.852563
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858
>> >> >>>>>> >>>>>>>> -16.765706
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430
>> >> >>>>>> >>>>>>>> -16.53684
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195
>> >> >>>>>> >>>>>>>> -16.509181
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067
>> >> >>>>>> >>>>>>>> -16.071466
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041
>> >> >>>>>> >>>>>>>> -16.044135
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830
>> >> >>>>>> >>>>>>>> -15.876995
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649
>> >> >>>>>> >>>>>>>> -15.334785
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464
>> >> >>>>>> >>>>>>>> -15.10768
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039
>> >> >>>>>> >>>>>>>> -15.110869
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694
>> >> >>>>>> >>>>>>>> -14.97975
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164
>> >> >>>>>> >>>>>>>> -15.162844
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682
>> >> >>>>>> >>>>>>>> -15.031393
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819
>> >> >>>>>> >>>>>>>> -15.081042
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530
>> >> >>>>>> >>>>>>>> -14.882624
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436
>> >> >>>>>> >>>>>>>> -14.896086
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630
>> >> >>>>>> >>>>>>>> -15.091414
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598
>> >> >>>>>> >>>>>>>> -15.158592
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631
>> >> >>>>>> >>>>>>>> -14.899716
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497
>> >> >>>>>> >>>>>>>> -14.702429
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571
>> >> >>>>>> >>>>>>>> -15.131773
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599
>> >> >>>>>> >>>>>>>> -14.636183
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542
>> >> >>>>>> >>>>>>>> -15.131769
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326
>> >> >>>>>> >>>>>>>> -14.890712
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534
>> >> >>>>>> >>>>>>>> -15.07093
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513
>> >> >>>>>> >>>>>>>> -15.454695
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626
>> >> >>>>>> >>>>>>>> -18.76601
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327
>> >> >>>>>> >>>>>>>> -0.25
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581
>> >> >>>>>> >>>>>>>> -25.679255
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516
>> >> >>>>>> >>>>>>>> -29.276605
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553
>> >> >>>>>> >>>>>>>> -32.679133
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488
>> >> >>>>>> >>>>>>>> -36.302659
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535
>> >> >>>>>> >>>>>>>> -39.657244
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618
>> >> >>>>>> >>>>>>>> -43.120713
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564
>> >> >>>>>> >>>>>>>> -46.535213
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445
>> >> >>>>>> >>>>>>>> -19.726454
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732
>> >> >>>>>> >>>>>>>> -19.534423
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213
>> >> >>>>>> >>>>>>>> -19.336654
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503
>> >> >>>>>> >>>>>>>> -19.100944
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563
>> >> >>>>>> >>>>>>>> -18.944366
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089
>> >> >>>>>> >>>>>>>> -18.654563
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043
>> >> >>>>>> >>>>>>>> -18.580576
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825
>> >> >>>>>> >>>>>>>> -18.39672
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133
>> >> >>>>>> >>>>>>>> -18.135332
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658
>> >> >>>>>> >>>>>>>> -17.827478
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203
>> >> >>>>>> >>>>>>>> -17.834061
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828
>> >> >>>>>> >>>>>>>> -17.468498
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894
>> >> >>>>>> >>>>>>>> -17.24293
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114
>> >> >>>>>> >>>>>>>> -17.232881
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347
>> >> >>>>>> >>>>>>>> -16.858355
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614
>> >> >>>>>> >>>>>>>> -16.843183
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251
>> >> >>>>>> >>>>>>>> -16.766116
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558
>> >> >>>>>> >>>>>>>> -16.595441
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304
>> >> >>>>>> >>>>>>>> -16.3045
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895
>> >> >>>>>> >>>>>>>> -15.703265
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554
>> >> >>>>>> >>>>>>>> -15.859913
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801
>> >> >>>>>> >>>>>>>> -15.421733
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872
>> >> >>>>>> >>>>>>>> -15.286325
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854
>> >> >>>>>> >>>>>>>> -15.092432
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928
>> >> >>>>>> >>>>>>>> -15.33225
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176
>> >> >>>>>> >>>>>>>> -14.95168
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243
>> >> >>>>>> >>>>>>>> -15.171952
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119
>> >> >>>>>> >>>>>>>> -15.186156
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015
>> >> >>>>>> >>>>>>>> -14.923437
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413
>> >> >>>>>> >>>>>>>> -15.015476
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618
>> >> >>>>>> >>>>>>>> -14.95512
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673
>> >> >>>>>> >>>>>>>> -15.01983
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560
>> >> >>>>>> >>>>>>>> -14.947699
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562
>> >> >>>>>> >>>>>>>> -14.860861
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555
>> >> >>>>>> >>>>>>>> -15.19329
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403
>> >> >>>>>> >>>>>>>> -14.891687
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463
>> >> >>>>>> >>>>>>>> -14.906846
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534
>> >> >>>>>> >>>>>>>> -14.9106
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711
>> >> >>>>>> >>>>>>>> -15.538188
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773
>> >> >>>>>> >>>>>>>> -18.722346
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627
>> >> >>>>>> >>>>>>>> -22.296946
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463
>> >> >>>>>> >>>>>>>> -25.803823
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557
>> >> >>>>>> >>>>>>>> -29.274249
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479
>> >> >>>>>> >>>>>>>> -36.102589
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475
>> >> >>>>>> >>>>>>>> -43.077308
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489
>> >> >>>>>> >>>>>>>> -46.505476
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> If that's of use, I can post some more of the code or
>> >> >>>>>> >>>>>>>> create
>> >> >>>>>> >>>>>>>> a more
>> >> >>>>>> >>>>>>>> isolated example from my piece.
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> Hope that helps!
>> >> >>>>>> >>>>>>>> steven
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>> >> >>>>>> >>>>>>>>  wrote:
>> >> >>>>>> >>>>>>>> > OK, this is very positive. In just one hour last
>> >> >>>>>> >>>>>>>> > night I
>> >> >>>>>> >>>>>>>> > managed
>> >> >>>>>> >>>>>>>> > to make a
>> >> >>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now
>> >> >>>>>> >>>>>>>> > for
>> >> >>>>>> >>>>>>>> > the next
>> >> >>>>>> >>>>>>>> > step.
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> > Say we have a pattern library in python that can be
>> >> >>>>>> >>>>>>>> > used
>> >> >>>>>> >>>>>>>> > alongside
>> >> >>>>>> >>>>>>>> > PythonScore. It's great for generating score event
>> >> >>>>>> >>>>>>>> > but
>> >> >>>>>> >>>>>>>> > what
>> >> >>>>>> >>>>>>>> > if you
>> >> >>>>>> >>>>>>>> > also want
>> >> >>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>> >> >>>>>> >>>>>>>> > segments for
>> >> >>>>>> >>>>>>>> > each
>> >> >>>>>> >>>>>>>> > note? What if you want the envelop function to be
>> >> >>>>>> >>>>>>>> > generated
>> >> >>>>>> >>>>>>>> > by a
>> >> >>>>>> >>>>>>>> > python
>> >> >>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant
>> >> >>>>>> >>>>>>>> > I
>> >> >>>>>> >>>>>>>> > think.
>> >> >>>>>> >>>>>>>> > What are the
>> >> >>>>>> >>>>>>>> > options? I
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> > Thanks
>> >> >>>>>> >>>>>>>> > P
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this
>> >> >>>>>> >>>>>>>> > page &
>> >> >>>>>> >>>>>>>> > enter
>> >> >>>>>> >>>>>>>> > your email
>> >> >>>>>> >>>>>>>> > address in the 'follow' section.
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> >>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with
>> >> >>>>>> >>>>>>>> body
>> >> >>>>>> >>>>>>>> "unsubscribe csound"
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> --
>> >> >>>>>> >>>>>> codehop.com | #code #art #music
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> --
>> >> >>>>>> >>>>> codehop.com | #code #art #music
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> --
>> >> >>>>>> >>>> codehop.com | #code #art #music
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>
>> >> >>>>>> >>
>> >> >>>>>> >>
>> >> >>>>>> >> --
>> >> >>>>>> >> codehop.com | #code #art #music
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Send bugs reports to the Sourceforge bug tracker
>> >> >>>>>>
>> >> >>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> >>>>>> "unsubscribe csound"
>> >> >>>>>>
>> >> >>>>>
>> >> >>>>
>> >> >>>
>> >> >>
>> >> >
>> >>
>> >>
>> >> Send bugs reports to the Sourceforge bug tracker
>> >>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>

Date2013-04-21 22:18
Frompeiman khosravi
SubjectRe: [Csnd] more python
Oh I see. I will check it out. 

Thanks for that!

P






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 21 April 2013 22:15, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

I'm not sure about wordpress.com's pricing, as I've only ever used a
self-installed version.  I'm not sure if you can install wordpress on
the server that you are using for your main site; if so, I've found it
easy to install an manage.

steven

On Sun, Apr 21, 2013 at 7:54 PM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> Hi Steven,
>
> I've got one page here (http://spectralkimia.wordpress.com) for publishing
> concert news. It looks like in order to have access to the html code one
> needs to pay for the 'pro' version or something like that. Maybe I've just
> missed something? I think for now I will link to another wordpress page from
> my website for posting miscellaneous stuff.
>
> Thanks
> Peiman
>
>
>
>
>
>
> www.peimankhosravi.co.uk
>
> To receive emails about upcoming concerts visit this page & enter your email
> address in the 'follow' section.
>
>
>
> On 21 April 2013 14:31, Steven Yi <stevenyi@gmail.com> wrote:
>>
>> Hi Peiman,
>>
>> I use Wordpress for my own website and like it quite a bit. It has a
>> concept of pages and posts, the first being a static page (though can
>> have comments too), and posts that are for news/blog items.  I think
>> most blogging and Content Management System platforms have these
>> abstractions these days.  Making themes for Wordpress isn't so bad,
>> and there's plenty you can choose from to start with and then modify.
>> A bit harder than just doing straight HTML probably, but overall a lot
>> easier to manage a site IMO.
>>
>> Maybe you could try setting up an account on wordpress.org and test
>> out the administration console, make some pages, etc.  to see if you
>> like using it.  Nice thing is its easy to setup and account and test
>> without having to install anything.
>>
>> Cheers!
>> steven
>>
>>
>> On Fri, Apr 19, 2013 at 1:23 PM, peiman khosravi
>> <peimankhosravi@gmail.com> wrote:
>> > Thanks Steven,
>> >
>> > On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
>> >>
>> >> Hi Peiman,
>> >>
>> >> Nice webpage!  Any thought to adding RSS or Atom so people can
>> >> subscribe to the page?
>> >
>> >
>> > I don't know how to do this, other than linking to an external blog. I'm
>> > making everything in a text editor and my html skills are minimal! it
>> > seems
>> > like a good idea to link to a wordpress page though. Unless you have a
>> > better suggestions.
>> >
>> >
>> >>
>> >>
>> >> As for polyphonic management, I use my orchestral composition library
>> >> [1] to do this.  The library is quite small.  There are Performer
>> >> objects that have things like instrument numbers assigned to them.
>> >> Each performer might have an instr num like "1.01" or "1.03". The
>> >> Performer has a space attribute and amplitude adjustment attribute.
>> >> The layers of the library allow for notes to be generated and the
>> >> Performer to "perform" the notes, applying their amp, space, and instr
>> >> num to the notes.  Other things can be applied here too. The
>> >> processing is like this
>> >>
>> >> NoteGenerator => [notes] => Performer => [modified notes] => output
>> >>
>> >
>> > Sounds nice. I must have a look. I have the book so I'll have a read
>> > later.
>> > And thanks for the link to the python library,
>> >
>> > P
>> >
>> >>
>> >> I'm not sure if Jake's CSD library works to return note objects/lists
>> >> that you can further manipulate or not.  If so, then you could create
>> >> your own function to decorate the contents of the list with further
>> >> values.
>> >>
>> >> I realize though re-reading your email that this technique isn't quite
>> >> automatic polyphony management per-se, but might be useful.
>> >>
>> >> Cheers!
>> >> steven
>> >>
>> >> [1] This orchestra library is described in my chapter in "The Audio
>> >> Programming Book".  The python library is browsable online at:
>> >>
>> >>
>> >> http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/
>> >>
>> >>
>> >> On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
>> >> <peimankhosravi@gmail.com> wrote:
>> >> > I've added a little something here:
>> >> > http://www.peimankhosravi.co.uk/miscellaneous.html
>> >> > P
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > www.peimankhosravi.co.uk
>> >> >
>> >> > To receive emails about upcoming concerts visit this page & enter
>> >> > your
>> >> > email
>> >> > address in the 'follow' section.
>> >> >
>> >> >
>> >> >
>> >> > On 19 April 2013 10:45, peiman khosravi <peimankhosravi@gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> Here's an improved version:
>> >> >> https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>> >> >>
>> >> >> Now the question is how to have an automated polyphonic management
>> >> >> so
>> >> >> one
>> >> >> doesn't need to bother writing in the fractional part of the
>> >> >> instrument
>> >> >> manually?
>> >> >>
>> >> >> An another question: how to make other types of interpolation, say,
>> >> >> for
>> >> >> creating a periodic LFO sine function?
>> >> >>
>> >> >> Cheers,
>> >> >> P
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> www.peimankhosravi.co.uk
>> >> >>
>> >> >> To receive emails about upcoming concerts visit this page & enter
>> >> >> your
>> >> >> email address in the 'follow' section.
>> >> >>
>> >> >>
>> >> >>
>> >> >> On 19 April 2013 01:30, peiman khosravi <peimankhosravi@gmail.com>
>> >> >> wrote:
>> >> >>>
>> >> >>> BTW I'm totally a convert to python. What a beauty. I don't know
>> >> >>> what
>> >> >>> those SC3 people are doing! Honestly!
>> >> >>>
>> >> >>> All I need to do now is to make the function into a class and the
>> >> >>> next
>> >> >>> time just write:
>> >> >>>
>> >> >>>
>> >> >>> <CsScore bin="python">
>> >> >>> from csd.pysco import PythonScore
>> >> >>> score = PythonScore()
>> >> >>> cue = score.cue
>> >> >>>
>> >> >>> score.write('f1 0 32768 10 1')
>> >> >>>
>> >> >>> with cue(0):
>> >> >>>     score.i(3.1, 0, 10)
>> >> >>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>> >> >>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10,
>> >> >>> 0.00001])
>> >> >>>
>> >> >>> score.end();
>> >> >>> </CsScore>
>> >> >>>
>> >> >>> What's more, one could have as many 'parameters' as one wishes
>> >> >>> without
>> >> >>> defining any extra functions in python.
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> www.peimankhosravi.co.uk
>> >> >>>
>> >> >>> To receive emails about upcoming concerts visit this page & enter
>> >> >>> your
>> >> >>> email address in the 'follow' section.
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> On 19 April 2013 01:17, peiman khosravi <peimankhosravi@gmail.com>
>> >> >>> wrote:
>> >> >>>>
>> >> >>>> In fact what I had was also stupid on so many other levels! This
>> >> >>>> is
>> >> >>>> the
>> >> >>>> corrected one (attached). Also added amplitude automation.
>> >> >>>>
>> >> >>>> P
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> www.peimankhosravi.co.uk
>> >> >>>>
>> >> >>>> To receive emails about upcoming concerts visit this page & enter
>> >> >>>> your
>> >> >>>> email address in the 'follow' section.
>> >> >>>>
>> >> >>>>
>> >> >>>>
>> >> >>>> On 19 April 2013 00:07, peiman khosravi <peimankhosravi@gmail.com>
>> >> >>>> wrote:
>> >> >>>>>
>> >> >>>>> Thanks Steven,
>> >> >>>>>
>> >> >>>>> I really appreciate that. Super useful!
>> >> >>>>>
>> >> >>>>> All the best,
>> >> >>>>> Peiman
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> www.peimankhosravi.co.uk
>> >> >>>>>
>> >> >>>>> To receive emails about upcoming concerts visit this page & enter
>> >> >>>>> your
>> >> >>>>> email address in the 'follow' section.
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com> wrote:
>> >> >>>>>>
>> >> >>>>>> Hi Peiman,
>> >> >>>>>>
>> >> >>>>>> Thought I'd mention, you may want to consider using formatting
>> >> >>>>>> strings
>> >> >>>>>> [1] to modify:
>> >> >>>>>>
>> >> >>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >> >>>>>>
>> >> >>>>>> to:
>> >> >>>>>>
>> >> >>>>>>     paramName = '"%s.%g"'%(p4, p1)
>> >> >>>>>>
>> >> >>>>>> You may also want to use list slicing  [2] with multiple
>> >> >>>>>> assignment
>> >> >>>>>> [2] to do something like this:
>> >> >>>>>>
>> >> >>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>> >> >>>>>>
>> >> >>>>>> String formatting is good to know as you can get a lot of
>> >> >>>>>> control
>> >> >>>>>> about the string formatting, and the template string can be
>> >> >>>>>> easier
>> >> >>>>>> to
>> >> >>>>>> use and understand, especially when using a lot of replacement
>> >> >>>>>> values.
>> >> >>>>>>  List slicing and multiple assignment are also handy syntax
>> >> >>>>>> sugar
>> >> >>>>>> to
>> >> >>>>>> write more terser code.
>> >> >>>>>>
>> >> >>>>>> Hope that's useful!
>> >> >>>>>> steven
>> >> >>>>>>
>> >> >>>>>> [1]
>> >> >>>>>> http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>> >> >>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>> >> >>>>>>
>> >> >>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>> >> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >> >>>>>> > No thank you and Steven for all your comments and
>> >> >>>>>> > contributions.
>> >> >>>>>> >
>> >> >>>>>> > I've had enough of staring at the computer tonight. Here's the
>> >> >>>>>> > latest
>> >> >>>>>> > function I came up with.
>> >> >>>>>> >
>> >> >>>>>> > Best,
>> >> >>>>>> > P
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > from csd.pysco import PythonScore
>> >> >>>>>> > from random import choice
>> >> >>>>>> >
>> >> >>>>>> > score = PythonScore()
>> >> >>>>>> > cue = score.cue
>> >> >>>>>> >
>> >> >>>>>> > score.write('f1 0 8192 10 1')
>> >> >>>>>> >
>> >> >>>>>> > def parameter(p1, name, type, envelope):
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >     if "l" in type:
>> >> >>>>>> >         p7 = 1
>> >> >>>>>> >     else:
>> >> >>>>>> >         p7 = 0
>> >> >>>>>> >
>> >> >>>>>> >     p4 = name
>> >> >>>>>> >     linseg = envelope
>> >> >>>>>> >
>> >> >>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>> >> >>>>>> >
>> >> >>>>>> >     for i in range(len(linseg)-4):
>> >> >>>>>> >
>> >> >>>>>> >         if i > 0:
>> >> >>>>>> >             i = i+1
>> >> >>>>>> >
>> >> >>>>>> >         t1 = linseg[i]
>> >> >>>>>> >         v1 = linseg[i+1]
>> >> >>>>>> >         t2 = linseg[i+2]
>> >> >>>>>> >         v2 = linseg[i+3]
>> >> >>>>>> >         start = t1
>> >> >>>>>> >         dur = t2-t1
>> >> >>>>>> >         point1 = v1
>> >> >>>>>> >         point2 = v2
>> >> >>>>>> >
>> >> >>>>>> >         score.i(2, start, dur,paramName, point1, point2, p7)
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > score.i(3.1, 0, 10)
>> >> >>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3, 440])
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > score.end();
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > www.peimankhosravi.co.uk
>> >> >>>>>> >
>> >> >>>>>> > To receive emails about upcoming concerts visit this page &
>> >> >>>>>> > enter
>> >> >>>>>> > your email
>> >> >>>>>> > address in the 'follow' section.
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>> > On 18 April 2013 23:09, Jacob Joaquin <jacobjoaquin@gmail.com>
>> >> >>>>>> > wrote:
>> >> >>>>>> >>
>> >> >>>>>> >> Thanks for posting these. I'm definitely reading and running
>> >> >>>>>> >> them.
>> >> >>>>>> >> Here's
>> >> >>>>>> >> an supported featured debugging feature that might help,
>> >> >>>>>> >> which
>> >> >>>>>> >> will
>> >> >>>>>> >> eventually be transformed into an official feature. To see
>> >> >>>>>> >> what
>> >> >>>>>> >> data is
>> >> >>>>>> >> currently in the score object, do this:
>> >> >>>>>> >>
>> >> >>>>>> >> for L in score.score_data:
>> >> >>>>>> >>     print L
>> >> >>>>>> >>
>> >> >>>>>> >>
>> >> >>>>>> >>
>> >> >>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>> >> >>>>>> >> <peimankhosravi@gmail.com> wrote:
>> >> >>>>>> >>>
>> >> >>>>>> >>> Thanks, I haven't tried your example yet. That next! Here's
>> >> >>>>>> >>> my
>> >> >>>>>> >>> latest.
>> >> >>>>>> >>> Much more readable. I'm not so suave with python [yet!] so
>> >> >>>>>> >>> it's
>> >> >>>>>> >>> probably not
>> >> >>>>>> >>> the most efficient of doing it.
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> from csd.pysco import PythonScore
>> >> >>>>>> >>> from random import choice
>> >> >>>>>> >>>
>> >> >>>>>> >>> score = PythonScore()
>> >> >>>>>> >>> cue = score.cue
>> >> >>>>>> >>>
>> >> >>>>>> >>> score.write('f1 0 8192 10 1')
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> def note(p1, p2, p3, list):
>> >> >>>>>> >>>
>> >> >>>>>> >>>     type = list.pop(1)
>> >> >>>>>> >>>
>> >> >>>>>> >>>     if "l" in type:
>> >> >>>>>> >>>         p7 = 1
>> >> >>>>>> >>>     else:
>> >> >>>>>> >>>         p7 = 0
>> >> >>>>>> >>>
>> >> >>>>>> >>>     p4 = list.pop(0)
>> >> >>>>>> >>>     linseg = list[0:]
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>     score.i(p1, p2, p3)
>> >> >>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>     for i in range(len(linseg)-4):
>> >> >>>>>> >>>
>> >> >>>>>> >>>         if i > 0:
>> >> >>>>>> >>>             i = i+1
>> >> >>>>>> >>>
>> >> >>>>>> >>>         t1 = linseg[i]
>> >> >>>>>> >>>         v1 = linseg[i+1]
>> >> >>>>>> >>>         t2 = linseg[i+2]
>> >> >>>>>> >>>         v2 = linseg[i+3]
>> >> >>>>>> >>>
>> >> >>>>>> >>>         start = t1
>> >> >>>>>> >>>         dur = t2-t1
>> >> >>>>>> >>>         point1 = v1
>> >> >>>>>> >>>         point2 = v2
>> >> >>>>>> >>>
>> >> >>>>>> >>>         score.i(2, start, dur,paramName, point1, point2, p7)
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20, 1.3, 440])
>> >> >>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200, 5, 1840])
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> score.end();
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> www.peimankhosravi.co.uk
>> >> >>>>>> >>>
>> >> >>>>>> >>> To receive emails about upcoming concerts visit this page &
>> >> >>>>>> >>> enter
>> >> >>>>>> >>> your
>> >> >>>>>> >>> email address in the 'follow' section.
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin
>> >> >>>>>> >>> <jacobjoaquin@gmail.com>
>> >> >>>>>> >>> wrote:
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> I cleaned up the example and placed it with the PythonScore
>> >> >>>>>> >>>> examples in
>> >> >>>>>> >>>> the master branch of the CSD module:
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> The plan is to create/collect lots of examples as a way to
>> >> >>>>>> >>>> start
>> >> >>>>>> >>>> identifying some of the design patterns that Python brings
>> >> >>>>>> >>>> to
>> >> >>>>>> >>>> the
>> >> >>>>>> >>>> score
>> >> >>>>>> >>>> environment. Once enough are collected and we have a sense
>> >> >>>>>> >>>> of
>> >> >>>>>> >>>> good ways of
>> >> >>>>>> >>>> approaching common problems, functions and classes that
>> >> >>>>>> >>>> reside
>> >> >>>>>> >>>> in
>> >> >>>>>> >>>> these
>> >> >>>>>> >>>> examples we'll be pulled out, rewritten if necessary, and
>> >> >>>>>> >>>> placed
>> >> >>>>>> >>>> into
>> >> >>>>>> >>>> modules that come with CSD. The examples will be updated in
>> >> >>>>>> >>>> the
>> >> >>>>>> >>>> process.
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>> >> >>>>>> >>>> <jacobjoaquin@gmail.com>
>> >> >>>>>> >>>> wrote:
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> Here is another approach:
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> I feel I can reduce this example further, and when I do,
>> >> >>>>>> >>>>> I'll
>> >> >>>>>> >>>>> include
>> >> >>>>>> >>>>> it as an example case with PythonScore. In the meantime,
>> >> >>>>>> >>>>> here's
>> >> >>>>>> >>>>> the
>> >> >>>>>> >>>>> explanation of how it works.
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> Envelope shapes are generated as tables. They are created
>> >> >>>>>> >>>>> dynamically
>> >> >>>>>> >>>>> in score. Since we don't want tables overwriting tables as
>> >> >>>>>> >>>>> they're being
>> >> >>>>>> >>>>> played, I created the table_cycler that cycles through a
>> >> >>>>>> >>>>> range
>> >> >>>>>> >>>>> of table
>> >> >>>>>> >>>>> indexes every time a new table is created. In this case,
>> >> >>>>>> >>>>> the
>> >> >>>>>> >>>>> range is
>> >> >>>>>> >>>>> between 100 and 120.
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> The function that handles this is gen_envelope(). It takes
>> >> >>>>>> >>>>> a
>> >> >>>>>> >>>>> list of
>> >> >>>>>> >>>>> envelope points, and reformats it into a GEN07 "f" event.
>> >> >>>>>> >>>>> The
>> >> >>>>>> >>>>> args are the
>> >> >>>>>> >>>>> same as GEN07, but only the envelope data, as the first 5
>> >> >>>>>> >>>>> "f"
>> >> >>>>>> >>>>> event pfields
>> >> >>>>>> >>>>> are automatically handled:
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> def gen_envelope(*args):
>> >> >>>>>> >>>>>     global table_cycler
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>     table = table_cycler.next()
>> >> >>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] +
>> >> >>>>>> >>>>> list(args)
>> >> >>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>> >> >>>>>> >>>>>     return table
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> That function returns the number of the table generated.
>> >> >>>>>> >>>>> So a
>> >> >>>>>> >>>>> value
>> >> >>>>>> >>>>> between 100 and 120. If you watch the table numbers during
>> >> >>>>>> >>>>> a
>> >> >>>>>> >>>>> performance,
>> >> >>>>>> >>>>> you'll see it cycle through this range.
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> Now, one can pass an arbitrary number of envelope points.
>> >> >>>>>> >>>>> The
>> >> >>>>>> >>>>> first 5
>> >> >>>>>> >>>>> notes in the score demo this explicitly:
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> with cue(0): note(4, 0.707, 1000, gen_envelope(0, 8092, 1,
>> >> >>>>>> >>>>> 100,
>> >> >>>>>> >>>>> 0))
>> >> >>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0, 100, 1,
>> >> >>>>>> >>>>> 8191,
>> >> >>>>>> >>>>> 0))
>> >> >>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1, 8192, 0))
>> >> >>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0, 100, 1,
>> >> >>>>>> >>>>> 100,
>> >> >>>>>> >>>>> 1,
>> >> >>>>>> >>>>> 7991,
>> >> >>>>>> >>>>> 0))
>> >> >>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0, 8092, 1,
>> >> >>>>>> >>>>> 100,
>> >> >>>>>> >>>>> 0))
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> For the rest of the piece, it auto-cycles between a
>> >> >>>>>> >>>>> frequency
>> >> >>>>>> >>>>> pattern
>> >> >>>>>> >>>>> and an envelope pattern.
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> Best,
>> >> >>>>>> >>>>> Jake
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>> >> >>>>>> >>>>> <jacobjoaquin@gmail.com>
>> >> >>>>>> >>>>> wrote:
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> I'll take a stab at this problem in a bit, but I'm hoping
>> >> >>>>>> >>>>>> arrays in C6
>> >> >>>>>> >>>>>> will support something like the following. To solve the
>> >> >>>>>> >>>>>> problem
>> >> >>>>>> >>>>>> you
>> >> >>>>>> >>>>>> presented, I think it would require two things. First,
>> >> >>>>>> >>>>>> the
>> >> >>>>>> >>>>>> ability to pass
>> >> >>>>>> >>>>>> an as a pfield in the score:
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> And then in the score, pass the array in as a list of
>> >> >>>>>> >>>>>> args
>> >> >>>>>> >>>>>> for
>> >> >>>>>> >>>>>> opcodes:
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> ienvpoints getarray p6
>> >> >>>>>> >>>>>> kenv linseg *ienvpoints
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> There may need to be a third step required for scaling
>> >> >>>>>> >>>>>> the
>> >> >>>>>> >>>>>> even
>> >> >>>>>> >>>>>> fields
>> >> >>>>>> >>>>>> of the array, though is probably already supported by
>> >> >>>>>> >>>>>> orchestra
>> >> >>>>>> >>>>>> loop
>> >> >>>>>> >>>>>> statements.
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>> >> >>>>>> >>>>>> <peimankhosravi@gmail.com> wrote:
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> Thanks very much Steven,
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> I'm going to have a proper look at the code you posted.
>> >> >>>>>> >>>>>>> My
>> >> >>>>>> >>>>>>> initial
>> >> >>>>>> >>>>>>> impression is that this is possibly too convoluted for
>> >> >>>>>> >>>>>>> quick
>> >> >>>>>> >>>>>>> and dirty
>> >> >>>>>> >>>>>>> experimentation. I think it should be easier than that.
>> >> >>>>>> >>>>>>> Maybe
>> >> >>>>>> >>>>>>> with array in
>> >> >>>>>> >>>>>>> csound6 it will be possible?
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> Cheers,
>> >> >>>>>> >>>>>>> Peiman
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> www.peimankhosravi.co.uk
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> To receive emails about upcoming concerts visit this
>> >> >>>>>> >>>>>>> page &
>> >> >>>>>> >>>>>>> enter
>> >> >>>>>> >>>>>>> your email address in the 'follow' section.
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi <stevenyi@gmail.com>
>> >> >>>>>> >>>>>>> wrote:
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> Hi Peiman,
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> I've done a couple of ways using score generation:
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> 1) For a limited number of articulations, I've added a
>> >> >>>>>> >>>>>>>> pfield
>> >> >>>>>> >>>>>>>> that
>> >> >>>>>> >>>>>>>> is
>> >> >>>>>> >>>>>>>> used as an index to choose what envelope to generate
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional instrument
>> >> >>>>>> >>>>>>>> numbers
>> >> >>>>>> >>>>>>>> together with tied-notes.  Essentially, each segment
>> >> >>>>>> >>>>>>>> becomes
>> >> >>>>>> >>>>>>>> a note.
>> >> >>>>>> >>>>>>>> Using fractional instr numbers allows for polyphonic
>> >> >>>>>> >>>>>>>> streams.
>> >> >>>>>> >>>>>>>> I've
>> >> >>>>>> >>>>>>>> used this in pieces (you can check
>> >> >>>>>> >>>>>>>> blue/examples/pieces/stevenYi/etude/etude_part3.blue,
>> >> >>>>>> >>>>>>>> the
>> >> >>>>>> >>>>>>>> "StrA -
>> >> >>>>>> >>>>>>>> 8.00" object) and am using this in my current piece to
>> >> >>>>>> >>>>>>>> do
>> >> >>>>>> >>>>>>>> group
>> >> >>>>>> >>>>>>>> glissandi sounds.
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> The setup for instruments for tied-notes can be a bit
>> >> >>>>>> >>>>>>>> tricky,
>> >> >>>>>> >>>>>>>> but
>> >> >>>>>> >>>>>>>> I've
>> >> >>>>>> >>>>>>>> got a set of UDO's now that I use together as a
>> >> >>>>>> >>>>>>>> template
>> >> >>>>>> >>>>>>>> when
>> >> >>>>>> >>>>>>>> building
>> >> >>>>>> >>>>>>>> instruments that will work with different p-fields
>> >> >>>>>> >>>>>>>> given
>> >> >>>>>> >>>>>>>> for
>> >> >>>>>> >>>>>>>> a note.
>> >> >>>>>> >>>>>>>> That's allowed using an instrument with MIDI, by score
>> >> >>>>>> >>>>>>>> with
>> >> >>>>>> >>>>>>>> 5-fields,
>> >> >>>>>> >>>>>>>> or scores with 8-fields.  That in turn has made it nice
>> >> >>>>>> >>>>>>>> to
>> >> >>>>>> >>>>>>>> work with
>> >> >>>>>> >>>>>>>> live, for quick sketching, or for generation.
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> For example, code from my current piece uses:
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> def scoreFunc():
>> >> >>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>> >> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14), (8.0, -14),
>> >> >>>>>> >>>>>>>> (10,-50)]),
>> >> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5, -16),(8.0, -16),
>> >> >>>>>> >>>>>>>> (10,-50)]))
>> >> >>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>> >> >>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>> >> >>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end -.09)]))
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>     return createUnstableGroup3(50,
>> >> >>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> The code uses a mix of PMask and some score generating
>> >> >>>>>> >>>>>>>> functions to
>> >> >>>>>> >>>>>>>> generate a score performance func that groupB64A uses
>> >> >>>>>> >>>>>>>> to
>> >> >>>>>> >>>>>>>> generate
>> >> >>>>>> >>>>>>>> notes like:
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038 8.000038 -20.0
>> >> >>>>>> >>>>>>>> -0.25
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786
>> >> >>>>>> >>>>>>>> -19.650074
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394
>> >> >>>>>> >>>>>>>> -19.493192
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814
>> >> >>>>>> >>>>>>>> -19.185775
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616
>> >> >>>>>> >>>>>>>> -19.101318
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475
>> >> >>>>>> >>>>>>>> -18.854064
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136
>> >> >>>>>> >>>>>>>> -18.681332
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112
>> >> >>>>>> >>>>>>>> -18.381339
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678
>> >> >>>>>> >>>>>>>> -18.391186
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639
>> >> >>>>>> >>>>>>>> -18.016504
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337
>> >> >>>>>> >>>>>>>> -17.852918
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320
>> >> >>>>>> >>>>>>>> -17.739093
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210
>> >> >>>>>> >>>>>>>> -17.638612
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275
>> >> >>>>>> >>>>>>>> -17.281441
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516
>> >> >>>>>> >>>>>>>> -17.084029
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609
>> >> >>>>>> >>>>>>>> -16.852563
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858
>> >> >>>>>> >>>>>>>> -16.765706
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430
>> >> >>>>>> >>>>>>>> -16.53684
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195
>> >> >>>>>> >>>>>>>> -16.509181
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067
>> >> >>>>>> >>>>>>>> -16.071466
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041
>> >> >>>>>> >>>>>>>> -16.044135
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830
>> >> >>>>>> >>>>>>>> -15.876995
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649
>> >> >>>>>> >>>>>>>> -15.334785
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464
>> >> >>>>>> >>>>>>>> -15.10768
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039
>> >> >>>>>> >>>>>>>> -15.110869
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694
>> >> >>>>>> >>>>>>>> -14.97975
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164
>> >> >>>>>> >>>>>>>> -15.162844
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682
>> >> >>>>>> >>>>>>>> -15.031393
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819
>> >> >>>>>> >>>>>>>> -15.081042
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530
>> >> >>>>>> >>>>>>>> -14.882624
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436
>> >> >>>>>> >>>>>>>> -14.896086
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630
>> >> >>>>>> >>>>>>>> -15.091414
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598
>> >> >>>>>> >>>>>>>> -15.158592
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631
>> >> >>>>>> >>>>>>>> -14.899716
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497
>> >> >>>>>> >>>>>>>> -14.702429
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571
>> >> >>>>>> >>>>>>>> -15.131773
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599
>> >> >>>>>> >>>>>>>> -14.636183
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542
>> >> >>>>>> >>>>>>>> -15.131769
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326
>> >> >>>>>> >>>>>>>> -14.890712
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534
>> >> >>>>>> >>>>>>>> -15.07093
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513
>> >> >>>>>> >>>>>>>> -15.454695
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626
>> >> >>>>>> >>>>>>>> -18.76601
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611 -22.462327
>> >> >>>>>> >>>>>>>> -0.25
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581
>> >> >>>>>> >>>>>>>> -25.679255
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516
>> >> >>>>>> >>>>>>>> -29.276605
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553
>> >> >>>>>> >>>>>>>> -32.679133
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488
>> >> >>>>>> >>>>>>>> -36.302659
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535
>> >> >>>>>> >>>>>>>> -39.657244
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618
>> >> >>>>>> >>>>>>>> -43.120713
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564
>> >> >>>>>> >>>>>>>> -46.535213
>> >> >>>>>> >>>>>>>> -0.25 3
>> >> >>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044 8.000044 -20.0
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445
>> >> >>>>>> >>>>>>>> -19.726454
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732
>> >> >>>>>> >>>>>>>> -19.534423
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213
>> >> >>>>>> >>>>>>>> -19.336654
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503
>> >> >>>>>> >>>>>>>> -19.100944
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563
>> >> >>>>>> >>>>>>>> -18.944366
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089
>> >> >>>>>> >>>>>>>> -18.654563
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043
>> >> >>>>>> >>>>>>>> -18.580576
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825
>> >> >>>>>> >>>>>>>> -18.39672
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133
>> >> >>>>>> >>>>>>>> -18.135332
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658
>> >> >>>>>> >>>>>>>> -17.827478
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203
>> >> >>>>>> >>>>>>>> -17.834061
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828
>> >> >>>>>> >>>>>>>> -17.468498
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894
>> >> >>>>>> >>>>>>>> -17.24293
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114
>> >> >>>>>> >>>>>>>> -17.232881
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347
>> >> >>>>>> >>>>>>>> -16.858355
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614
>> >> >>>>>> >>>>>>>> -16.843183
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251
>> >> >>>>>> >>>>>>>> -16.766116
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558
>> >> >>>>>> >>>>>>>> -16.595441
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304
>> >> >>>>>> >>>>>>>> -16.3045
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895
>> >> >>>>>> >>>>>>>> -15.703265
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554
>> >> >>>>>> >>>>>>>> -15.859913
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801
>> >> >>>>>> >>>>>>>> -15.421733
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872
>> >> >>>>>> >>>>>>>> -15.286325
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854
>> >> >>>>>> >>>>>>>> -15.092432
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928
>> >> >>>>>> >>>>>>>> -15.33225
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176
>> >> >>>>>> >>>>>>>> -14.95168
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243
>> >> >>>>>> >>>>>>>> -15.171952
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119
>> >> >>>>>> >>>>>>>> -15.186156
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015
>> >> >>>>>> >>>>>>>> -14.923437
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695 -15.06699
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413
>> >> >>>>>> >>>>>>>> -15.015476
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618
>> >> >>>>>> >>>>>>>> -14.95512
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673
>> >> >>>>>> >>>>>>>> -15.01983
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560
>> >> >>>>>> >>>>>>>> -14.947699
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562
>> >> >>>>>> >>>>>>>> -14.860861
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555
>> >> >>>>>> >>>>>>>> -15.19329
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403
>> >> >>>>>> >>>>>>>> -14.891687
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463
>> >> >>>>>> >>>>>>>> -14.906846
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534
>> >> >>>>>> >>>>>>>> -14.9106
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711
>> >> >>>>>> >>>>>>>> -15.538188
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773
>> >> >>>>>> >>>>>>>> -18.722346
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627
>> >> >>>>>> >>>>>>>> -22.296946
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463
>> >> >>>>>> >>>>>>>> -25.803823
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557
>> >> >>>>>> >>>>>>>> -29.274249
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469 -32.566588
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479
>> >> >>>>>> >>>>>>>> -36.102589
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541 -39.55518
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475
>> >> >>>>>> >>>>>>>> -43.077308
>> >> >>>>>> >>>>>>>> -0.2 3
>> >> >>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489
>> >> >>>>>> >>>>>>>> -46.505476
>> >> >>>>>> >>>>>>>> -0.2
>> >> >>>>>> >>>>>>>> 3
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> If that's of use, I can post some more of the code or
>> >> >>>>>> >>>>>>>> create
>> >> >>>>>> >>>>>>>> a more
>> >> >>>>>> >>>>>>>> isolated example from my piece.
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> Hope that helps!
>> >> >>>>>> >>>>>>>> steven
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>> >> >>>>>> >>>>>>>> <peimankhosravi@gmail.com> wrote:
>> >> >>>>>> >>>>>>>> > OK, this is very positive. In just one hour last
>> >> >>>>>> >>>>>>>> > night I
>> >> >>>>>> >>>>>>>> > managed
>> >> >>>>>> >>>>>>>> > to make a
>> >> >>>>>> >>>>>>>> > bunch of alien blips and blops using PythonScore. Now
>> >> >>>>>> >>>>>>>> > for
>> >> >>>>>> >>>>>>>> > the next
>> >> >>>>>> >>>>>>>> > step.
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> > Say we have a pattern library in python that can be
>> >> >>>>>> >>>>>>>> > used
>> >> >>>>>> >>>>>>>> > alongside
>> >> >>>>>> >>>>>>>> > PythonScore. It's great for generating score event
>> >> >>>>>> >>>>>>>> > but
>> >> >>>>>> >>>>>>>> > what
>> >> >>>>>> >>>>>>>> > if you
>> >> >>>>>> >>>>>>>> > also want
>> >> >>>>>> >>>>>>>> > to be able to define a different envelop of arbitrary
>> >> >>>>>> >>>>>>>> > segments for
>> >> >>>>>> >>>>>>>> > each
>> >> >>>>>> >>>>>>>> > note? What if you want the envelop function to be
>> >> >>>>>> >>>>>>>> > generated
>> >> >>>>>> >>>>>>>> > by a
>> >> >>>>>> >>>>>>>> > python
>> >> >>>>>> >>>>>>>> > module? Would one use tables for this? Not so elegant
>> >> >>>>>> >>>>>>>> > I
>> >> >>>>>> >>>>>>>> > think.
>> >> >>>>>> >>>>>>>> > What are the
>> >> >>>>>> >>>>>>>> > options? I
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> > Thanks
>> >> >>>>>> >>>>>>>> > P
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>> >> >>>>>> >>>>>>>> >
>> >> >>>>>> >>>>>>>> > To receive emails about upcoming concerts visit this
>> >> >>>>>> >>>>>>>> > page &
>> >> >>>>>> >>>>>>>> > enter
>> >> >>>>>> >>>>>>>> > your email
>> >> >>>>>> >>>>>>>> > address in the 'follow' section.
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> >>>>>> >>>>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>> >>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with
>> >> >>>>>> >>>>>>>> body
>> >> >>>>>> >>>>>>>> "unsubscribe csound"
>> >> >>>>>> >>>>>>>>
>> >> >>>>>> >>>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>>
>> >> >>>>>> >>>>>> --
>> >> >>>>>> >>>>>> codehop.com | #code #art #music
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>>
>> >> >>>>>> >>>>> --
>> >> >>>>>> >>>>> codehop.com | #code #art #music
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>>
>> >> >>>>>> >>>> --
>> >> >>>>>> >>>> codehop.com | #code #art #music
>> >> >>>>>> >>>
>> >> >>>>>> >>>
>> >> >>>>>> >>
>> >> >>>>>> >>
>> >> >>>>>> >>
>> >> >>>>>> >> --
>> >> >>>>>> >> codehop.com | #code #art #music
>> >> >>>>>> >
>> >> >>>>>> >
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> Send bugs reports to the Sourceforge bug tracker
>> >> >>>>>>
>> >> >>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> >>>>>> Discussions of bugs and features can be posted here
>> >> >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> >>>>>> "unsubscribe csound"
>> >> >>>>>>
>> >> >>>>>
>> >> >>>>
>> >> >>>
>> >> >>
>> >> >
>> >>
>> >>
>> >> Send bugs reports to the Sourceforge bug tracker
>> >>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-04-22 01:37
FromPhil Thomson
SubjectRe: [Csnd] more python
Just be sure that if you go that route, you keep everything up to date, 
or you may well get hacked. I found this out the hard way. Wordpress is 
an often targeted platform for malware.

On 04/21/13 14:18, peiman khosravi wrote:
> Oh I see. I will check it out.
>
> Thanks for that!
>
> P
>
>
>
>
>
>
> *www.peimankhosravi.co.uk *
>
> *To receive emails about upcoming concerts visit this page
>  & enter your email address in the
> 'follow' section.*
>
>
>
> On 21 April 2013 22:15, Steven Yi  > wrote:
>
>     Hi Peiman,
>
>     I'm not sure about wordpress.com 's pricing,
>     as I've only ever used a
>     self-installed version.  I'm not sure if you can install wordpress on
>     the server that you are using for your main site; if so, I've found it
>     easy to install an manage.
>
>     steven
>
>     On Sun, Apr 21, 2013 at 7:54 PM, peiman khosravi
>     > wrote:
>      > Hi Steven,
>      >
>      > I've got one page here (http://spectralkimia.wordpress.com) for
>     publishing
>      > concert news. It looks like in order to have access to the html
>     code one
>      > needs to pay for the 'pro' version or something like that. Maybe
>     I've just
>      > missed something? I think for now I will link to another
>     wordpress page from
>      > my website for posting miscellaneous stuff.
>      >
>      > Thanks
>      > Peiman
>      >
>      >
>      >
>      >
>      >
>      >
>      > www.peimankhosravi.co.uk 
>      >
>      > To receive emails about upcoming concerts visit this page & enter
>     your email
>      > address in the 'follow' section.
>      >
>      >
>      >
>      > On 21 April 2013 14:31, Steven Yi      > wrote:
>      >>
>      >> Hi Peiman,
>      >>
>      >> I use Wordpress for my own website and like it quite a bit. It has a
>      >> concept of pages and posts, the first being a static page
>     (though can
>      >> have comments too), and posts that are for news/blog items.  I think
>      >> most blogging and Content Management System platforms have these
>      >> abstractions these days.  Making themes for Wordpress isn't so bad,
>      >> and there's plenty you can choose from to start with and then
>     modify.
>      >> A bit harder than just doing straight HTML probably, but overall
>     a lot
>      >> easier to manage a site IMO.
>      >>
>      >> Maybe you could try setting up an account on wordpress.org
>      and test
>      >> out the administration console, make some pages, etc.  to see if you
>      >> like using it.  Nice thing is its easy to setup and account and test
>      >> without having to install anything.
>      >>
>      >> Cheers!
>      >> steven
>      >>
>      >>
>      >> On Fri, Apr 19, 2013 at 1:23 PM, peiman khosravi
>      >> > wrote:
>      >> > Thanks Steven,
>      >> >
>      >> > On 19 April 2013 12:58, Steven Yi      > wrote:
>      >> >>
>      >> >> Hi Peiman,
>      >> >>
>      >> >> Nice webpage!  Any thought to adding RSS or Atom so people can
>      >> >> subscribe to the page?
>      >> >
>      >> >
>      >> > I don't know how to do this, other than linking to an external
>     blog. I'm
>      >> > making everything in a text editor and my html skills are
>     minimal! it
>      >> > seems
>      >> > like a good idea to link to a wordpress page though. Unless
>     you have a
>      >> > better suggestions.
>      >> >
>      >> >
>      >> >>
>      >> >>
>      >> >> As for polyphonic management, I use my orchestral composition
>     library
>      >> >> [1] to do this.  The library is quite small.  There are Performer
>      >> >> objects that have things like instrument numbers assigned to
>     them.
>      >> >> Each performer might have an instr num like "1.01" or "1.03". The
>      >> >> Performer has a space attribute and amplitude adjustment
>     attribute.
>      >> >> The layers of the library allow for notes to be generated and the
>      >> >> Performer to "perform" the notes, applying their amp, space,
>     and instr
>      >> >> num to the notes.  Other things can be applied here too. The
>      >> >> processing is like this
>      >> >>
>      >> >> NoteGenerator => [notes] => Performer => [modified notes] =>
>     output
>      >> >>
>      >> >
>      >> > Sounds nice. I must have a look. I have the book so I'll have
>     a read
>      >> > later.
>      >> > And thanks for the link to the python library,
>      >> >
>      >> > P
>      >> >
>      >> >>
>      >> >> I'm not sure if Jake's CSD library works to return note
>     objects/lists
>      >> >> that you can further manipulate or not.  If so, then you
>     could create
>      >> >> your own function to decorate the contents of the list with
>     further
>      >> >> values.
>      >> >>
>      >> >> I realize though re-reading your email that this technique
>     isn't quite
>      >> >> automatic polyphony management per-se, but might be useful.
>      >> >>
>      >> >> Cheers!
>      >> >> steven
>      >> >>
>      >> >> [1] This orchestra library is described in my chapter in "The
>     Audio
>      >> >> Programming Book".  The python library is browsable online at:
>      >> >>
>      >> >>
>      >> >>
>     http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/
>      >> >>
>      >> >>
>      >> >> On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
>      >> >> >
>     wrote:
>      >> >> > I've added a little something here:
>      >> >> > http://www.peimankhosravi.co.uk/miscellaneous.html
>      >> >> > P
>      >> >> >
>      >> >> >
>      >> >> >
>      >> >> >
>      >> >> >
>      >> >> >
>      >> >> > www.peimankhosravi.co.uk 
>      >> >> >
>      >> >> > To receive emails about upcoming concerts visit this page &
>     enter
>      >> >> > your
>      >> >> > email
>      >> >> > address in the 'follow' section.
>      >> >> >
>      >> >> >
>      >> >> >
>      >> >> > On 19 April 2013 10:45, peiman khosravi
>     >
>      >> >> > wrote:
>      >> >> >>
>      >> >> >> Here's an improved version:
>      >> >> >>
>     https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
>      >> >> >>
>      >> >> >> Now the question is how to have an automated polyphonic
>     management
>      >> >> >> so
>      >> >> >> one
>      >> >> >> doesn't need to bother writing in the fractional part of the
>      >> >> >> instrument
>      >> >> >> manually?
>      >> >> >>
>      >> >> >> An another question: how to make other types of
>     interpolation, say,
>      >> >> >> for
>      >> >> >> creating a periodic LFO sine function?
>      >> >> >>
>      >> >> >> Cheers,
>      >> >> >> P
>      >> >> >>
>      >> >> >>
>      >> >> >>
>      >> >> >>
>      >> >> >>
>      >> >> >>
>      >> >> >>
>      >> >> >> www.peimankhosravi.co.uk 
>      >> >> >>
>      >> >> >> To receive emails about upcoming concerts visit this page
>     & enter
>      >> >> >> your
>      >> >> >> email address in the 'follow' section.
>      >> >> >>
>      >> >> >>
>      >> >> >>
>      >> >> >> On 19 April 2013 01:30, peiman khosravi
>     >
>      >> >> >> wrote:
>      >> >> >>>
>      >> >> >>> BTW I'm totally a convert to python. What a beauty. I
>     don't know
>      >> >> >>> what
>      >> >> >>> those SC3 people are doing! Honestly!
>      >> >> >>>
>      >> >> >>> All I need to do now is to make the function into a class
>     and the
>      >> >> >>> next
>      >> >> >>> time just write:
>      >> >> >>>
>      >> >> >>>
>      >> >> >>> 
>      >> >> >>> from csd.pysco import PythonScore
>      >> >> >>> score = PythonScore()
>      >> >> >>> cue = score.cue
>      >> >> >>>
>      >> >> >>> score.write('f1 0 32768 10 1')
>      >> >> >>>
>      >> >> >>> with cue(0):
>      >> >> >>>     score.i(3.1, 0, 10)
>      >> >> >>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
>      >> >> >>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10,
>      >> >> >>> 0.00001])
>      >> >> >>>
>      >> >> >>> score.end();
>      >> >> >>> 
>      >> >> >>>
>      >> >> >>> What's more, one could have as many 'parameters' as one
>     wishes
>      >> >> >>> without
>      >> >> >>> defining any extra functions in python.
>      >> >> >>>
>      >> >> >>>
>      >> >> >>>
>      >> >> >>>
>      >> >> >>>
>      >> >> >>>
>      >> >> >>>
>      >> >> >>> www.peimankhosravi.co.uk 
>      >> >> >>>
>      >> >> >>> To receive emails about upcoming concerts visit this page
>     & enter
>      >> >> >>> your
>      >> >> >>> email address in the 'follow' section.
>      >> >> >>>
>      >> >> >>>
>      >> >> >>>
>      >> >> >>> On 19 April 2013 01:17, peiman khosravi
>     >
>      >> >> >>> wrote:
>      >> >> >>>>
>      >> >> >>>> In fact what I had was also stupid on so many other
>     levels! This
>      >> >> >>>> is
>      >> >> >>>> the
>      >> >> >>>> corrected one (attached). Also added amplitude automation.
>      >> >> >>>>
>      >> >> >>>> P
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>> www.peimankhosravi.co.uk 
>      >> >> >>>>
>      >> >> >>>> To receive emails about upcoming concerts visit this
>     page & enter
>      >> >> >>>> your
>      >> >> >>>> email address in the 'follow' section.
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>>
>      >> >> >>>> On 19 April 2013 00:07, peiman khosravi
>     >
>      >> >> >>>> wrote:
>      >> >> >>>>>
>      >> >> >>>>> Thanks Steven,
>      >> >> >>>>>
>      >> >> >>>>> I really appreciate that. Super useful!
>      >> >> >>>>>
>      >> >> >>>>> All the best,
>      >> >> >>>>> Peiman
>      >> >> >>>>>
>      >> >> >>>>>
>      >> >> >>>>>
>      >> >> >>>>>
>      >> >> >>>>>
>      >> >> >>>>>
>      >> >> >>>>>
>      >> >> >>>>> www.peimankhosravi.co.uk 
>      >> >> >>>>>
>      >> >> >>>>> To receive emails about upcoming concerts visit this
>     page & enter
>      >> >> >>>>> your
>      >> >> >>>>> email address in the 'follow' section.
>      >> >> >>>>>
>      >> >> >>>>>
>      >> >> >>>>>
>      >> >> >>>>> On 18 April 2013 23:45, Steven Yi      > wrote:
>      >> >> >>>>>>
>      >> >> >>>>>> Hi Peiman,
>      >> >> >>>>>>
>      >> >> >>>>>> Thought I'd mention, you may want to consider using
>     formatting
>      >> >> >>>>>> strings
>      >> >> >>>>>> [1] to modify:
>      >> >> >>>>>>
>      >> >> >>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
>      >> >> >>>>>>
>      >> >> >>>>>> to:
>      >> >> >>>>>>
>      >> >> >>>>>>     paramName = '"%s.%g"'%(p4, p1)
>      >> >> >>>>>>
>      >> >> >>>>>> You may also want to use list slicing  [2] with multiple
>      >> >> >>>>>> assignment
>      >> >> >>>>>> [2] to do something like this:
>      >> >> >>>>>>
>      >> >> >>>>>> t1, v1, t2, v2 = linseg[i:i+4]
>      >> >> >>>>>>
>      >> >> >>>>>> String formatting is good to know as you can get a lot of
>      >> >> >>>>>> control
>      >> >> >>>>>> about the string formatting, and the template string
>     can be
>      >> >> >>>>>> easier
>      >> >> >>>>>> to
>      >> >> >>>>>> use and understand, especially when using a lot of
>     replacement
>      >> >> >>>>>> values.
>      >> >> >>>>>>  List slicing and multiple assignment are also handy
>     syntax
>      >> >> >>>>>> sugar
>      >> >> >>>>>> to
>      >> >> >>>>>> write more terser code.
>      >> >> >>>>>>
>      >> >> >>>>>> Hope that's useful!
>      >> >> >>>>>> steven
>      >> >> >>>>>>
>      >> >> >>>>>> [1]
>      >> >> >>>>>>
>     http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
>      >> >> >>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
>      >> >> >>>>>>
>      >> >> >>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
>      >> >> >>>>>>      > wrote:
>      >> >> >>>>>> > No thank you and Steven for all your comments and
>      >> >> >>>>>> > contributions.
>      >> >> >>>>>> >
>      >> >> >>>>>> > I've had enough of staring at the computer tonight.
>     Here's the
>      >> >> >>>>>> > latest
>      >> >> >>>>>> > function I came up with.
>      >> >> >>>>>> >
>      >> >> >>>>>> > Best,
>      >> >> >>>>>> > P
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> > from csd.pysco import PythonScore
>      >> >> >>>>>> > from random import choice
>      >> >> >>>>>> >
>      >> >> >>>>>> > score = PythonScore()
>      >> >> >>>>>> > cue = score.cue
>      >> >> >>>>>> >
>      >> >> >>>>>> > score.write('f1 0 8192 10 1')
>      >> >> >>>>>> >
>      >> >> >>>>>> > def parameter(p1, name, type, envelope):
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >     if "l" in type:
>      >> >> >>>>>> >         p7 = 1
>      >> >> >>>>>> >     else:
>      >> >> >>>>>> >         p7 = 0
>      >> >> >>>>>> >
>      >> >> >>>>>> >     p4 = name
>      >> >> >>>>>> >     linseg = envelope
>      >> >> >>>>>> >
>      >> >> >>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
>      >> >> >>>>>> >
>      >> >> >>>>>> >     for i in range(len(linseg)-4):
>      >> >> >>>>>> >
>      >> >> >>>>>> >         if i > 0:
>      >> >> >>>>>> >             i = i+1
>      >> >> >>>>>> >
>      >> >> >>>>>> >         t1 = linseg[i]
>      >> >> >>>>>> >         v1 = linseg[i+1]
>      >> >> >>>>>> >         t2 = linseg[i+2]
>      >> >> >>>>>> >         v2 = linseg[i+3]
>      >> >> >>>>>> >         start = t1
>      >> >> >>>>>> >         dur = t2-t1
>      >> >> >>>>>> >         point1 = v1
>      >> >> >>>>>> >         point2 = v2
>      >> >> >>>>>> >
>      >> >> >>>>>> >         score.i(2, start, dur,paramName, point1,
>     point2, p7)
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> > score.i(3.1, 0, 10)
>      >> >> >>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3,
>     440])
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> > score.end();
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> > www.peimankhosravi.co.uk
>     
>      >> >> >>>>>> >
>      >> >> >>>>>> > To receive emails about upcoming concerts visit this
>     page &
>      >> >> >>>>>> > enter
>      >> >> >>>>>> > your email
>      >> >> >>>>>> > address in the 'follow' section.
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>> > On 18 April 2013 23:09, Jacob Joaquin
>     >
>      >> >> >>>>>> > wrote:
>      >> >> >>>>>> >>
>      >> >> >>>>>> >> Thanks for posting these. I'm definitely reading
>     and running
>      >> >> >>>>>> >> them.
>      >> >> >>>>>> >> Here's
>      >> >> >>>>>> >> an supported featured debugging feature that might
>     help,
>      >> >> >>>>>> >> which
>      >> >> >>>>>> >> will
>      >> >> >>>>>> >> eventually be transformed into an official feature.
>     To see
>      >> >> >>>>>> >> what
>      >> >> >>>>>> >> data is
>      >> >> >>>>>> >> currently in the score object, do this:
>      >> >> >>>>>> >>
>      >> >> >>>>>> >> for L in score.score_data:
>      >> >> >>>>>> >>     print L
>      >> >> >>>>>> >>
>      >> >> >>>>>> >>
>      >> >> >>>>>> >>
>      >> >> >>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
>      >> >> >>>>>> >>      > wrote:
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> Thanks, I haven't tried your example yet. That
>     next! Here's
>      >> >> >>>>>> >>> my
>      >> >> >>>>>> >>> latest.
>      >> >> >>>>>> >>> Much more readable. I'm not so suave with python
>     [yet!] so
>      >> >> >>>>>> >>> it's
>      >> >> >>>>>> >>> probably not
>      >> >> >>>>>> >>> the most efficient of doing it.
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> from csd.pysco import PythonScore
>      >> >> >>>>>> >>> from random import choice
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> score = PythonScore()
>      >> >> >>>>>> >>> cue = score.cue
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> score.write('f1 0 8192 10 1')
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> def note(p1, p2, p3, list):
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>     type = list.pop(1)
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>     if "l" in type:
>      >> >> >>>>>> >>>         p7 = 1
>      >> >> >>>>>> >>>     else:
>      >> >> >>>>>> >>>         p7 = 0
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>     p4 = list.pop(0)
>      >> >> >>>>>> >>>     linseg = list[0:]
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>     score.i(p1, p2, p3)
>      >> >> >>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>     for i in range(len(linseg)-4):
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>         if i > 0:
>      >> >> >>>>>> >>>             i = i+1
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>         t1 = linseg[i]
>      >> >> >>>>>> >>>         v1 = linseg[i+1]
>      >> >> >>>>>> >>>         t2 = linseg[i+2]
>      >> >> >>>>>> >>>         v2 = linseg[i+3]
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>         start = t1
>      >> >> >>>>>> >>>         dur = t2-t1
>      >> >> >>>>>> >>>         point1 = v1
>      >> >> >>>>>> >>>         point2 = v2
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>         score.i(2, start, dur,paramName, point1,
>     point2, p7)
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20,
>     1.3, 440])
>      >> >> >>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200,
>     5, 1840])
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> score.end();
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> www.peimankhosravi.co.uk
>     
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> To receive emails about upcoming concerts visit
>     this page &
>      >> >> >>>>>> >>> enter
>      >> >> >>>>>> >>> your
>      >> >> >>>>>> >>> email address in the 'follow' section.
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin
>      >> >> >>>>>> >>>      >
>      >> >> >>>>>> >>> wrote:
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>> I cleaned up the example and placed it with the
>     PythonScore
>      >> >> >>>>>> >>>> examples in
>      >> >> >>>>>> >>>> the master branch of the CSD module:
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>     https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>> The plan is to create/collect lots of examples as
>     a way to
>      >> >> >>>>>> >>>> start
>      >> >> >>>>>> >>>> identifying some of the design patterns that
>     Python brings
>      >> >> >>>>>> >>>> to
>      >> >> >>>>>> >>>> the
>      >> >> >>>>>> >>>> score
>      >> >> >>>>>> >>>> environment. Once enough are collected and we
>     have a sense
>      >> >> >>>>>> >>>> of
>      >> >> >>>>>> >>>> good ways of
>      >> >> >>>>>> >>>> approaching common problems, functions and
>     classes that
>      >> >> >>>>>> >>>> reside
>      >> >> >>>>>> >>>> in
>      >> >> >>>>>> >>>> these
>      >> >> >>>>>> >>>> examples we'll be pulled out, rewritten if
>     necessary, and
>      >> >> >>>>>> >>>> placed
>      >> >> >>>>>> >>>> into
>      >> >> >>>>>> >>>> modules that come with CSD. The examples will be
>     updated in
>      >> >> >>>>>> >>>> the
>      >> >> >>>>>> >>>> process.
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
>      >> >> >>>>>> >>>>      >
>      >> >> >>>>>> >>>> wrote:
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> Here is another approach:
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> I feel I can reduce this example further, and
>     when I do,
>      >> >> >>>>>> >>>>> I'll
>      >> >> >>>>>> >>>>> include
>      >> >> >>>>>> >>>>> it as an example case with PythonScore. In the
>     meantime,
>      >> >> >>>>>> >>>>> here's
>      >> >> >>>>>> >>>>> the
>      >> >> >>>>>> >>>>> explanation of how it works.
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> Envelope shapes are generated as tables. They
>     are created
>      >> >> >>>>>> >>>>> dynamically
>      >> >> >>>>>> >>>>> in score. Since we don't want tables overwriting
>     tables as
>      >> >> >>>>>> >>>>> they're being
>      >> >> >>>>>> >>>>> played, I created the table_cycler that cycles
>     through a
>      >> >> >>>>>> >>>>> range
>      >> >> >>>>>> >>>>> of table
>      >> >> >>>>>> >>>>> indexes every time a new table is created. In
>     this case,
>      >> >> >>>>>> >>>>> the
>      >> >> >>>>>> >>>>> range is
>      >> >> >>>>>> >>>>> between 100 and 120.
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> The function that handles this is
>     gen_envelope(). It takes
>      >> >> >>>>>> >>>>> a
>      >> >> >>>>>> >>>>> list of
>      >> >> >>>>>> >>>>> envelope points, and reformats it into a GEN07
>     "f" event.
>      >> >> >>>>>> >>>>> The
>      >> >> >>>>>> >>>>> args are the
>      >> >> >>>>>> >>>>> same as GEN07, but only the envelope data, as
>     the first 5
>      >> >> >>>>>> >>>>> "f"
>      >> >> >>>>>> >>>>> event pfields
>      >> >> >>>>>> >>>>> are automatically handled:
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> def gen_envelope(*args):
>      >> >> >>>>>> >>>>>     global table_cycler
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>>     table = table_cycler.next()
>      >> >> >>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] +
>      >> >> >>>>>> >>>>> list(args)
>      >> >> >>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
>      >> >> >>>>>> >>>>>     return table
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> That function returns the number of the table
>     generated.
>      >> >> >>>>>> >>>>> So a
>      >> >> >>>>>> >>>>> value
>      >> >> >>>>>> >>>>> between 100 and 120. If you watch the table
>     numbers during
>      >> >> >>>>>> >>>>> a
>      >> >> >>>>>> >>>>> performance,
>      >> >> >>>>>> >>>>> you'll see it cycle through this range.
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> Now, one can pass an arbitrary number of
>     envelope points.
>      >> >> >>>>>> >>>>> The
>      >> >> >>>>>> >>>>> first 5
>      >> >> >>>>>> >>>>> notes in the score demo this explicitly:
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> with cue(0): note(4, 0.707, 1000,
>     gen_envelope(0, 8092, 1,
>      >> >> >>>>>> >>>>> 100,
>      >> >> >>>>>> >>>>> 0))
>      >> >> >>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0,
>     100, 1,
>      >> >> >>>>>> >>>>> 8191,
>      >> >> >>>>>> >>>>> 0))
>      >> >> >>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1,
>     8192, 0))
>      >> >> >>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0,
>     100, 1,
>      >> >> >>>>>> >>>>> 100,
>      >> >> >>>>>> >>>>> 1,
>      >> >> >>>>>> >>>>> 7991,
>      >> >> >>>>>> >>>>> 0))
>      >> >> >>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0,
>     8092, 1,
>      >> >> >>>>>> >>>>> 100,
>      >> >> >>>>>> >>>>> 0))
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> For the rest of the piece, it auto-cycles between a
>      >> >> >>>>>> >>>>> frequency
>      >> >> >>>>>> >>>>> pattern
>      >> >> >>>>>> >>>>> and an envelope pattern.
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> Best,
>      >> >> >>>>>> >>>>> Jake
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
>      >> >> >>>>>> >>>>>      >
>      >> >> >>>>>> >>>>> wrote:
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>> I'll take a stab at this problem in a bit, but
>     I'm hoping
>      >> >> >>>>>> >>>>>> arrays in C6
>      >> >> >>>>>> >>>>>> will support something like the following. To
>     solve the
>      >> >> >>>>>> >>>>>> problem
>      >> >> >>>>>> >>>>>> you
>      >> >> >>>>>> >>>>>> presented, I think it would require two things.
>     First,
>      >> >> >>>>>> >>>>>> the
>      >> >> >>>>>> >>>>>> ability to pass
>      >> >> >>>>>> >>>>>> an as a pfield in the score:
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>> And then in the score, pass the array in as a
>     list of
>      >> >> >>>>>> >>>>>> args
>      >> >> >>>>>> >>>>>> for
>      >> >> >>>>>> >>>>>> opcodes:
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>> ienvpoints getarray p6
>      >> >> >>>>>> >>>>>> kenv linseg *ienvpoints
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>> There may need to be a third step required for
>     scaling
>      >> >> >>>>>> >>>>>> the
>      >> >> >>>>>> >>>>>> even
>      >> >> >>>>>> >>>>>> fields
>      >> >> >>>>>> >>>>>> of the array, though is probably already
>     supported by
>      >> >> >>>>>> >>>>>> orchestra
>      >> >> >>>>>> >>>>>> loop
>      >> >> >>>>>> >>>>>> statements.
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
>      >> >> >>>>>> >>>>>>      > wrote:
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>> Thanks very much Steven,
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>> I'm going to have a proper look at the code
>     you posted.
>      >> >> >>>>>> >>>>>>> My
>      >> >> >>>>>> >>>>>>> initial
>      >> >> >>>>>> >>>>>>> impression is that this is possibly too
>     convoluted for
>      >> >> >>>>>> >>>>>>> quick
>      >> >> >>>>>> >>>>>>> and dirty
>      >> >> >>>>>> >>>>>>> experimentation. I think it should be easier
>     than that.
>      >> >> >>>>>> >>>>>>> Maybe
>      >> >> >>>>>> >>>>>>> with array in
>      >> >> >>>>>> >>>>>>> csound6 it will be possible?
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>> Cheers,
>      >> >> >>>>>> >>>>>>> Peiman
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>> www.peimankhosravi.co.uk
>     
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>> To receive emails about upcoming concerts
>     visit this
>      >> >> >>>>>> >>>>>>> page &
>      >> >> >>>>>> >>>>>>> enter
>      >> >> >>>>>> >>>>>>> your email address in the 'follow' section.
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi
>     >
>      >> >> >>>>>> >>>>>>> wrote:
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> Hi Peiman,
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> I've done a couple of ways using score
>     generation:
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> 1) For a limited number of articulations,
>     I've added a
>      >> >> >>>>>> >>>>>>>> pfield
>      >> >> >>>>>> >>>>>>>> that
>      >> >> >>>>>> >>>>>>>> is
>      >> >> >>>>>> >>>>>>>> used as an index to choose what envelope to
>     generate
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional
>     instrument
>      >> >> >>>>>> >>>>>>>> numbers
>      >> >> >>>>>> >>>>>>>> together with tied-notes.  Essentially, each
>     segment
>      >> >> >>>>>> >>>>>>>> becomes
>      >> >> >>>>>> >>>>>>>> a note.
>      >> >> >>>>>> >>>>>>>> Using fractional instr numbers allows for
>     polyphonic
>      >> >> >>>>>> >>>>>>>> streams.
>      >> >> >>>>>> >>>>>>>> I've
>      >> >> >>>>>> >>>>>>>> used this in pieces (you can check
>      >> >> >>>>>> >>>>>>>>
>     blue/examples/pieces/stevenYi/etude/etude_part3.blue,
>      >> >> >>>>>> >>>>>>>> the
>      >> >> >>>>>> >>>>>>>> "StrA -
>      >> >> >>>>>> >>>>>>>> 8.00" object) and am using this in my current
>     piece to
>      >> >> >>>>>> >>>>>>>> do
>      >> >> >>>>>> >>>>>>>> group
>      >> >> >>>>>> >>>>>>>> glissandi sounds.
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> The setup for instruments for tied-notes can
>     be a bit
>      >> >> >>>>>> >>>>>>>> tricky,
>      >> >> >>>>>> >>>>>>>> but
>      >> >> >>>>>> >>>>>>>> I've
>      >> >> >>>>>> >>>>>>>> got a set of UDO's now that I use together as a
>      >> >> >>>>>> >>>>>>>> template
>      >> >> >>>>>> >>>>>>>> when
>      >> >> >>>>>> >>>>>>>> building
>      >> >> >>>>>> >>>>>>>> instruments that will work with different
>     p-fields
>      >> >> >>>>>> >>>>>>>> given
>      >> >> >>>>>> >>>>>>>> for
>      >> >> >>>>>> >>>>>>>> a note.
>      >> >> >>>>>> >>>>>>>> That's allowed using an instrument with MIDI,
>     by score
>      >> >> >>>>>> >>>>>>>> with
>      >> >> >>>>>> >>>>>>>> 5-fields,
>      >> >> >>>>>> >>>>>>>> or scores with 8-fields.  That in turn has
>     made it nice
>      >> >> >>>>>> >>>>>>>> to
>      >> >> >>>>>> >>>>>>>> work with
>      >> >> >>>>>> >>>>>>>> live, for quick sketching, or for generation.
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> For example, code from my current piece uses:
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> def scoreFunc():
>      >> >> >>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
>      >> >> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14),
>     (8.0, -14),
>      >> >> >>>>>> >>>>>>>> (10,-50)]),
>      >> >> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,
>     -16),(8.0, -16),
>      >> >> >>>>>> >>>>>>>> (10,-50)]))
>      >> >> >>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
>      >> >> >>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
>      >> >> >>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end
>     -.09)]))
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>>     return createUnstableGroup3(50,
>      >> >> >>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> The code uses a mix of PMask and some score
>     generating
>      >> >> >>>>>> >>>>>>>> functions to
>      >> >> >>>>>> >>>>>>>> generate a score performance func that
>     groupB64A uses
>      >> >> >>>>>> >>>>>>>> to
>      >> >> >>>>>> >>>>>>>> generate
>      >> >> >>>>>> >>>>>>>> notes like:
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038
>     8.000038 -20.0
>      >> >> >>>>>> >>>>>>>> -0.25
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786
>      >> >> >>>>>> >>>>>>>> -19.650074
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394
>      >> >> >>>>>> >>>>>>>> -19.493192
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814
>      >> >> >>>>>> >>>>>>>> -19.185775
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616
>      >> >> >>>>>> >>>>>>>> -19.101318
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475
>      >> >> >>>>>> >>>>>>>> -18.854064
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136
>      >> >> >>>>>> >>>>>>>> -18.681332
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112
>      >> >> >>>>>> >>>>>>>> -18.381339
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678
>      >> >> >>>>>> >>>>>>>> -18.391186
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639
>      >> >> >>>>>> >>>>>>>> -18.016504
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337
>      >> >> >>>>>> >>>>>>>> -17.852918
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320
>      >> >> >>>>>> >>>>>>>> -17.739093
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210
>      >> >> >>>>>> >>>>>>>> -17.638612
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275
>      >> >> >>>>>> >>>>>>>> -17.281441
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516
>      >> >> >>>>>> >>>>>>>> -17.084029
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609
>      >> >> >>>>>> >>>>>>>> -16.852563
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858
>      >> >> >>>>>> >>>>>>>> -16.765706
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430
>      >> >> >>>>>> >>>>>>>> -16.53684
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195
>      >> >> >>>>>> >>>>>>>> -16.509181
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067
>      >> >> >>>>>> >>>>>>>> -16.071466
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041
>      >> >> >>>>>> >>>>>>>> -16.044135
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830
>      >> >> >>>>>> >>>>>>>> -15.876995
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649
>      >> >> >>>>>> >>>>>>>> -15.334785
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464
>      >> >> >>>>>> >>>>>>>> -15.10768
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039
>      >> >> >>>>>> >>>>>>>> -15.110869
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694
>      >> >> >>>>>> >>>>>>>> -14.97975
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164
>      >> >> >>>>>> >>>>>>>> -15.162844
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682
>      >> >> >>>>>> >>>>>>>> -15.031393
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819
>      >> >> >>>>>> >>>>>>>> -15.081042
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530
>      >> >> >>>>>> >>>>>>>> -14.882624
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436
>      >> >> >>>>>> >>>>>>>> -14.896086
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630
>      >> >> >>>>>> >>>>>>>> -15.091414
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598
>      >> >> >>>>>> >>>>>>>> -15.158592
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631
>      >> >> >>>>>> >>>>>>>> -14.899716
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497
>      >> >> >>>>>> >>>>>>>> -14.702429
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571
>      >> >> >>>>>> >>>>>>>> -15.131773
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599
>      >> >> >>>>>> >>>>>>>> -14.636183
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542
>      >> >> >>>>>> >>>>>>>> -15.131769
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326
>      >> >> >>>>>> >>>>>>>> -14.890712
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534
>      >> >> >>>>>> >>>>>>>> -15.07093
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513
>      >> >> >>>>>> >>>>>>>> -15.454695
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626
>      >> >> >>>>>> >>>>>>>> -18.76601
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611
>     -22.462327
>      >> >> >>>>>> >>>>>>>> -0.25
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581
>      >> >> >>>>>> >>>>>>>> -25.679255
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516
>      >> >> >>>>>> >>>>>>>> -29.276605
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553
>      >> >> >>>>>> >>>>>>>> -32.679133
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488
>      >> >> >>>>>> >>>>>>>> -36.302659
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535
>      >> >> >>>>>> >>>>>>>> -39.657244
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618
>      >> >> >>>>>> >>>>>>>> -43.120713
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564
>      >> >> >>>>>> >>>>>>>> -46.535213
>      >> >> >>>>>> >>>>>>>> -0.25 3
>      >> >> >>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044
>     8.000044 -20.0
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445
>      >> >> >>>>>> >>>>>>>> -19.726454
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732
>      >> >> >>>>>> >>>>>>>> -19.534423
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213
>      >> >> >>>>>> >>>>>>>> -19.336654
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503
>      >> >> >>>>>> >>>>>>>> -19.100944
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563
>      >> >> >>>>>> >>>>>>>> -18.944366
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089
>      >> >> >>>>>> >>>>>>>> -18.654563
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043
>      >> >> >>>>>> >>>>>>>> -18.580576
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825
>      >> >> >>>>>> >>>>>>>> -18.39672
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133
>      >> >> >>>>>> >>>>>>>> -18.135332
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658
>      >> >> >>>>>> >>>>>>>> -17.827478
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203
>      >> >> >>>>>> >>>>>>>> -17.834061
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828
>      >> >> >>>>>> >>>>>>>> -17.468498
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894
>      >> >> >>>>>> >>>>>>>> -17.24293
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114
>      >> >> >>>>>> >>>>>>>> -17.232881
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347
>      >> >> >>>>>> >>>>>>>> -16.858355
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614
>      >> >> >>>>>> >>>>>>>> -16.843183
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 25.181318 -1.4441699982 8.036614 8.044251
>      >> >> >>>>>> >>>>>>>> -16.766116
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 26.63077 -1.4222027063 8.044251 8.046558
>      >> >> >>>>>> >>>>>>>> -16.595441
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 28.080221 -1.3825737238 8.046558 8.053304
>      >> >> >>>>>> >>>>>>>> -16.3045
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 29.529673 -1.4152231216 8.053304 8.049895
>      >> >> >>>>>> >>>>>>>> -15.703265
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 30.979128 -1.4074517488 8.049895 8.048554
>      >> >> >>>>>> >>>>>>>> -15.859913
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 32.428577 -1.4301626682 8.048554 8.048801
>      >> >> >>>>>> >>>>>>>> -15.421733
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 33.878033 -1.4148651361 8.048801 8.049872
>      >> >> >>>>>> >>>>>>>> -15.286325
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 35.327488 -1.4476755857 8.049872 8.050854
>      >> >> >>>>>> >>>>>>>> -15.092432
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 36.776943 -1.3776605129 8.050854 8.050928
>      >> >> >>>>>> >>>>>>>> -15.33225
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 38.22639 -1.4172358513 8.050928 8.051176
>      >> >> >>>>>> >>>>>>>> -14.95168
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 39.675846 -1.4283468723 8.051176 8.050243
>      >> >> >>>>>> >>>>>>>> -15.171952
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 41.125298 -1.3886971474 8.050243 8.050119
>      >> >> >>>>>> >>>>>>>> -15.186156
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 42.57475 -1.4143933058 8.050119 8.049015
>      >> >> >>>>>> >>>>>>>> -14.923437
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 44.0242 -1.4443267584 8.049015 8.049695
>     -15.06699
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 45.47365 -1.4385073185 8.049695 8.049413
>      >> >> >>>>>> >>>>>>>> -15.015476
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 46.92311 -1.4360843897 8.049413 8.049618
>      >> >> >>>>>> >>>>>>>> -14.95512
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 48.372562 -1.4481816292 8.049618 8.049673
>      >> >> >>>>>> >>>>>>>> -15.01983
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 49.822018 -1.3814899921 8.049673 8.049560
>      >> >> >>>>>> >>>>>>>> -14.947699
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 51.27147 -1.3979146481 8.049560 8.049562
>      >> >> >>>>>> >>>>>>>> -14.860861
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 52.72092 -1.4315620661 8.049562 8.049555
>      >> >> >>>>>> >>>>>>>> -15.19329
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 54.170372 -1.4206075668 8.049555 8.049403
>      >> >> >>>>>> >>>>>>>> -14.891687
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 55.619827 -1.388495326 8.049403 8.049463
>      >> >> >>>>>> >>>>>>>> -14.906846
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 57.069283 -1.3810690641 8.049463 8.049534
>      >> >> >>>>>> >>>>>>>> -14.9106
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 58.518734 -1.4054898024 8.049534 8.049711
>      >> >> >>>>>> >>>>>>>> -15.538188
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 59.96819 -1.4112035036 8.049711 8.049773
>      >> >> >>>>>> >>>>>>>> -18.722346
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 61.41764 -1.416462779 8.049773 8.049627
>      >> >> >>>>>> >>>>>>>> -22.296946
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 62.867092 -1.3942875862 8.049627 8.049463
>      >> >> >>>>>> >>>>>>>> -25.803823
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 64.31654 -1.4330433607 8.049463 8.049557
>      >> >> >>>>>> >>>>>>>> -29.274249
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 65.766 -1.4460133314 8.049557 8.049469
>     -32.566588
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 67.21545 -1.4101213217 8.049469 8.049479
>      >> >> >>>>>> >>>>>>>> -36.102589
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 68.6649 -1.3967366219 8.049479 8.049541
>     -39.55518
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>> i8.36 70.11436 -1.4181296825 8.049541 8.049475
>      >> >> >>>>>> >>>>>>>> -43.077308
>      >> >> >>>>>> >>>>>>>> -0.2 3
>      >> >> >>>>>> >>>>>>>> i8.36 71.56381 1.4013484716 8.049475 8.049489
>      >> >> >>>>>> >>>>>>>> -46.505476
>      >> >> >>>>>> >>>>>>>> -0.2
>      >> >> >>>>>> >>>>>>>> 3
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> If that's of use, I can post some more of the
>     code or
>      >> >> >>>>>> >>>>>>>> create
>      >> >> >>>>>> >>>>>>>> a more
>      >> >> >>>>>> >>>>>>>> isolated example from my piece.
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> Hope that helps!
>      >> >> >>>>>> >>>>>>>> steven
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> On Thu, Apr 18, 2013 at 11:54 AM, peiman khosravi
>      >> >> >>>>>> >>>>>>>>      > wrote:
>      >> >> >>>>>> >>>>>>>> > OK, this is very positive. In just one hour
>     last
>      >> >> >>>>>> >>>>>>>> > night I
>      >> >> >>>>>> >>>>>>>> > managed
>      >> >> >>>>>> >>>>>>>> > to make a
>      >> >> >>>>>> >>>>>>>> > bunch of alien blips and blops using
>     PythonScore. Now
>      >> >> >>>>>> >>>>>>>> > for
>      >> >> >>>>>> >>>>>>>> > the next
>      >> >> >>>>>> >>>>>>>> > step.
>      >> >> >>>>>> >>>>>>>> >
>      >> >> >>>>>> >>>>>>>> > Say we have a pattern library in python
>     that can be
>      >> >> >>>>>> >>>>>>>> > used
>      >> >> >>>>>> >>>>>>>> > alongside
>      >> >> >>>>>> >>>>>>>> > PythonScore. It's great for generating
>     score event
>      >> >> >>>>>> >>>>>>>> > but
>      >> >> >>>>>> >>>>>>>> > what
>      >> >> >>>>>> >>>>>>>> > if you
>      >> >> >>>>>> >>>>>>>> > also want
>      >> >> >>>>>> >>>>>>>> > to be able to define a different envelop of
>     arbitrary
>      >> >> >>>>>> >>>>>>>> > segments for
>      >> >> >>>>>> >>>>>>>> > each
>      >> >> >>>>>> >>>>>>>> > note? What if you want the envelop function
>     to be
>      >> >> >>>>>> >>>>>>>> > generated
>      >> >> >>>>>> >>>>>>>> > by a
>      >> >> >>>>>> >>>>>>>> > python
>      >> >> >>>>>> >>>>>>>> > module? Would one use tables for this? Not
>     so elegant
>      >> >> >>>>>> >>>>>>>> > I
>      >> >> >>>>>> >>>>>>>> > think.
>      >> >> >>>>>> >>>>>>>> > What are the
>      >> >> >>>>>> >>>>>>>> > options? I
>      >> >> >>>>>> >>>>>>>> >
>      >> >> >>>>>> >>>>>>>> > Thanks
>      >> >> >>>>>> >>>>>>>> > P
>      >> >> >>>>>> >>>>>>>> >
>      >> >> >>>>>> >>>>>>>> >
>      >> >> >>>>>> >>>>>>>> >
>      >> >> >>>>>> >>>>>>>> > www.peimankhosravi.co.uk
>     
>      >> >> >>>>>> >>>>>>>> >
>      >> >> >>>>>> >>>>>>>> > To receive emails about upcoming concerts
>     visit this
>      >> >> >>>>>> >>>>>>>> > page &
>      >> >> >>>>>> >>>>>>>> > enter
>      >> >> >>>>>> >>>>>>>> > your email
>      >> >> >>>>>> >>>>>>>> > address in the 'follow' section.
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>> Send bugs reports to the Sourceforge bug tracker
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>>
>     https://sourceforge.net/tracker/?group_id=81968&atid=564599
>      >> >> >>>>>> >>>>>>>> Discussions of bugs and features can be
>     posted here
>      >> >> >>>>>> >>>>>>>> To unsubscribe, send email
>     sympa@lists.bath.ac.uk  with
>      >> >> >>>>>> >>>>>>>> body
>      >> >> >>>>>> >>>>>>>> "unsubscribe csound"
>      >> >> >>>>>> >>>>>>>>
>      >> >> >>>>>> >>>>>>>
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>>
>      >> >> >>>>>> >>>>>> --
>      >> >> >>>>>> >>>>>> codehop.com  | #code #art
>     #music
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>>
>      >> >> >>>>>> >>>>> --
>      >> >> >>>>>> >>>>> codehop.com  | #code #art #music
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>>
>      >> >> >>>>>> >>>> --
>      >> >> >>>>>> >>>> codehop.com  | #code #art #music
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>>
>      >> >> >>>>>> >>
>      >> >> >>>>>> >>
>      >> >> >>>>>> >>
>      >> >> >>>>>> >> --
>      >> >> >>>>>> >> codehop.com  | #code #art #music
>      >> >> >>>>>> >
>      >> >> >>>>>> >
>      >> >> >>>>>>
>      >> >> >>>>>>
>      >> >> >>>>>> Send bugs reports to the Sourceforge bug tracker
>      >> >> >>>>>>
>      >> >> >>>>>>
>     https://sourceforge.net/tracker/?group_id=81968&atid=564599
>      >> >> >>>>>> Discussions of bugs and features can be posted here
>      >> >> >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk
>      with body
>      >> >> >>>>>> "unsubscribe csound"
>      >> >> >>>>>>
>      >> >> >>>>>
>      >> >> >>>>
>      >> >> >>>
>      >> >> >>
>      >> >> >
>      >> >>
>      >> >>
>      >> >> Send bugs reports to the Sourceforge bug tracker
>      >> >> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>      >> >> Discussions of bugs and features can be posted here
>      >> >> To unsubscribe, send email sympa@lists.bath.ac.uk
>      with body
>      >> >> "unsubscribe
>      >> >> csound"
>      >> >>
>      >> >
>      >>
>      >>
>      >> Send bugs reports to the Sourceforge bug tracker
>      >> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>      >> Discussions of bugs and features can be posted here
>      >> To unsubscribe, send email sympa@lists.bath.ac.uk
>      with body "unsubscribe
>      >> csound"
>      >>
>      >
>
>
>     Send bugs reports to the Sourceforge bug tracker
>     https://sourceforge.net/tracker/?group_id=81968&atid=564599
>     Discussions of bugs and features can be posted here
>     To unsubscribe, send email sympa@lists.bath.ac.uk
>      with body "unsubscribe csound"
>
>

Date2013-04-22 01:46
Frompeiman khosravi
SubjectRe: [Csnd] more python
Thanks Phil,

That's good to know. I actually tried wp tonight. It makes many things more accessible but I find that in order to really personalise the style I need to learn too much stuff that I don't have the time for. So I'd rather keep things simple and make a manual rss file.

Cheers,
Peiman
 






www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 22 April 2013 01:37, Phil Thomson <phil@philthomson.ca> wrote:
Just be sure that if you go that route, you keep everything up to date, or you may well get hacked. I found this out the hard way. Wordpress is an often targeted platform for malware.

On 04/21/13 14:18, peiman khosravi wrote:
Oh I see. I will check it out.

Thanks for that!

P






*www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk>*

*To receive emails about upcoming concerts visit this page
<http://spectralkimia.wordpress.com/> & enter your email address in the
'follow' section.*



On 21 April 2013 22:15, Steven Yi <stevenyi@gmail.com
<mailto:stevenyi@gmail.com>> wrote:

    Hi Peiman,

    I'm not sure about wordpress.com <http://wordpress.com>'s pricing,
    as I've only ever used a
    self-installed version.  I'm not sure if you can install wordpress on
    the server that you are using for your main site; if so, I've found it
    easy to install an manage.

    steven

    On Sun, Apr 21, 2013 at 7:54 PM, peiman khosravi
    <peimankhosravi@gmail.com <mailto:peimankhosravi@gmail.com>> wrote:
     > Hi Steven,
     >
     > I've got one page here (http://spectralkimia.wordpress.com) for
    publishing
     > concert news. It looks like in order to have access to the html
    code one
     > needs to pay for the 'pro' version or something like that. Maybe
    I've just
     > missed something? I think for now I will link to another
    wordpress page from
     > my website for posting miscellaneous stuff.
     >
     > Thanks
     > Peiman
     >
     >
     >
     >
     >
     >
     > www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk>
     >
     > To receive emails about upcoming concerts visit this page & enter
    your email
     > address in the 'follow' section.
     >
     >
     >
     > On 21 April 2013 14:31, Steven Yi <stevenyi@gmail.com
    <mailto:stevenyi@gmail.com>> wrote:
     >>
     >> Hi Peiman,
     >>
     >> I use Wordpress for my own website and like it quite a bit. It has a
     >> concept of pages and posts, the first being a static page
    (though can
     >> have comments too), and posts that are for news/blog items.  I think
     >> most blogging and Content Management System platforms have these
     >> abstractions these days.  Making themes for Wordpress isn't so bad,
     >> and there's plenty you can choose from to start with and then
    modify.
     >> A bit harder than just doing straight HTML probably, but overall
    a lot
     >> easier to manage a site IMO.
     >>
     >> Maybe you could try setting up an account on wordpress.org
    <http://wordpress.org> and test
     >> out the administration console, make some pages, etc.  to see if you
     >> like using it.  Nice thing is its easy to setup and account and test
     >> without having to install anything.
     >>
     >> Cheers!
     >> steven
     >>
     >>
     >> On Fri, Apr 19, 2013 at 1:23 PM, peiman khosravi
     >> <peimankhosravi@gmail.com <mailto:peimankhosravi@gmail.com>> wrote:
     >> > Thanks Steven,
     >> >
     >> > On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com
    <mailto:stevenyi@gmail.com>> wrote:
     >> >>
     >> >> Hi Peiman,
     >> >>
     >> >> Nice webpage!  Any thought to adding RSS or Atom so people can
     >> >> subscribe to the page?
     >> >
     >> >
     >> > I don't know how to do this, other than linking to an external
    blog. I'm
     >> > making everything in a text editor and my html skills are
    minimal! it
     >> > seems
     >> > like a good idea to link to a wordpress page though. Unless
    you have a
     >> > better suggestions.
     >> >
     >> >
     >> >>
     >> >>
     >> >> As for polyphonic management, I use my orchestral composition
    library
     >> >> [1] to do this.  The library is quite small.  There are Performer
     >> >> objects that have things like instrument numbers assigned to
    them.
     >> >> Each performer might have an instr num like "1.01" or "1.03". The
     >> >> Performer has a space attribute and amplitude adjustment
    attribute.
     >> >> The layers of the library allow for notes to be generated and the
     >> >> Performer to "perform" the notes, applying their amp, space,
    and instr
     >> >> num to the notes.  Other things can be applied here too. The
     >> >> processing is like this
     >> >>
     >> >> NoteGenerator => [notes] => Performer => [modified notes] =>
    output
     >> >>
     >> >
     >> > Sounds nice. I must have a look. I have the book so I'll have
    a read
     >> > later.
     >> > And thanks for the link to the python library,
     >> >
     >> > P
     >> >
     >> >>
     >> >> I'm not sure if Jake's CSD library works to return note
    objects/lists
     >> >> that you can further manipulate or not.  If so, then you
    could create
     >> >> your own function to decorate the contents of the list with
    further
     >> >> values.
     >> >>
     >> >> I realize though re-reading your email that this technique
    isn't quite
     >> >> automatic polyphony management per-se, but might be useful.
     >> >>
     >> >> Cheers!
     >> >> steven
     >> >>
     >> >> [1] This orchestra library is described in my chapter in "The
    Audio
     >> >> Programming Book".  The python library is browsable online at:
     >> >>
     >> >>
     >> >>
    http://sourceforge.net/p/bluemusic/blue/ci/2.4.3/tree/jython/release/pythonLib/blue/orchestra/
     >> >>
     >> >>
     >> >> On Fri, Apr 19, 2013 at 12:00 PM, peiman khosravi
     >> >> <peimankhosravi@gmail.com <mailto:peimankhosravi@gmail.com>>
    wrote:
     >> >> > I've added a little something here:
     >> >> > http://www.peimankhosravi.co.uk/miscellaneous.html
     >> >> > P
     >> >> >
     >> >> >
     >> >> >
     >> >> >
     >> >> >
     >> >> >
     >> >> > www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk>
     >> >> >
     >> >> > To receive emails about upcoming concerts visit this page &
    enter
     >> >> > your
     >> >> > email
     >> >> > address in the 'follow' section.
     >> >> >
     >> >> >
     >> >> >
     >> >> > On 19 April 2013 10:45, peiman khosravi
    <peimankhosravi@gmail.com <mailto:peimankhosravi@gmail.com>>
     >> >> > wrote:
     >> >> >>
     >> >> >> Here's an improved version:
     >> >> >>
    https://dl.dropboxusercontent.com/u/47945259/python_Automation.csd
     >> >> >>
     >> >> >> Now the question is how to have an automated polyphonic
    management
     >> >> >> so
     >> >> >> one
     >> >> >> doesn't need to bother writing in the fractional part of the
     >> >> >> instrument
     >> >> >> manually?
     >> >> >>
     >> >> >> An another question: how to make other types of
    interpolation, say,
     >> >> >> for
     >> >> >> creating a periodic LFO sine function?
     >> >> >>
     >> >> >> Cheers,
     >> >> >> P
     >> >> >>
     >> >> >>
     >> >> >>
     >> >> >>
     >> >> >>
     >> >> >>
     >> >> >>
     >> >> >> www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk>
     >> >> >>
     >> >> >> To receive emails about upcoming concerts visit this page
    & enter
     >> >> >> your
     >> >> >> email address in the 'follow' section.
     >> >> >>
     >> >> >>
     >> >> >>
     >> >> >> On 19 April 2013 01:30, peiman khosravi
    <peimankhosravi@gmail.com <mailto:peimankhosravi@gmail.com>>
     >> >> >> wrote:
     >> >> >>>
     >> >> >>> BTW I'm totally a convert to python. What a beauty. I
    don't know
     >> >> >>> what
     >> >> >>> those SC3 people are doing! Honestly!
     >> >> >>>
     >> >> >>> All I need to do now is to make the function into a class
    and the
     >> >> >>> next
     >> >> >>> time just write:
     >> >> >>>
     >> >> >>>
     >> >> >>> <CsScore bin="python">
     >> >> >>> from csd.pysco import PythonScore
     >> >> >>> score = PythonScore()
     >> >> >>> cue = score.cue
     >> >> >>>
     >> >> >>> score.write('f1 0 32768 10 1')
     >> >> >>>
     >> >> >>> with cue(0):
     >> >> >>>     score.i(3.1, 0, 10)
     >> >> >>>     parameter(3.1, "freq", "exp", [0, 1440, 1, 200, 2, 1000])
     >> >> >>>     parameter(3.1, "amp",  "exp", [0, 1, 1, 0.001, 2, 1, 10,
     >> >> >>> 0.00001])
     >> >> >>>
     >> >> >>> score.end();
     >> >> >>> </CsScore>
     >> >> >>>
     >> >> >>> What's more, one could have as many 'parameters' as one
    wishes
     >> >> >>> without
     >> >> >>> defining any extra functions in python.
     >> >> >>>
     >> >> >>>
     >> >> >>>
     >> >> >>>
     >> >> >>>
     >> >> >>>
     >> >> >>>
     >> >> >>> www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk>
     >> >> >>>
     >> >> >>> To receive emails about upcoming concerts visit this page
    & enter
     >> >> >>> your
     >> >> >>> email address in the 'follow' section.
     >> >> >>>
     >> >> >>>
     >> >> >>>
     >> >> >>> On 19 April 2013 01:17, peiman khosravi
    <peimankhosravi@gmail.com <mailto:peimankhosravi@gmail.com>>
     >> >> >>> wrote:
     >> >> >>>>
     >> >> >>>> In fact what I had was also stupid on so many other
    levels! This
     >> >> >>>> is
     >> >> >>>> the
     >> >> >>>> corrected one (attached). Also added amplitude automation.
     >> >> >>>>
     >> >> >>>> P
     >> >> >>>>
     >> >> >>>>
     >> >> >>>>
     >> >> >>>>
     >> >> >>>>
     >> >> >>>>
     >> >> >>>>
     >> >> >>>>
     >> >> >>>>
     >> >> >>>>
     >> >> >>>> www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk>
     >> >> >>>>
     >> >> >>>> To receive emails about upcoming concerts visit this
    page & enter
     >> >> >>>> your
     >> >> >>>> email address in the 'follow' section.
     >> >> >>>>
     >> >> >>>>
     >> >> >>>>
     >> >> >>>> On 19 April 2013 00:07, peiman khosravi
    <peimankhosravi@gmail.com <mailto:peimankhosravi@gmail.com>>
     >> >> >>>> wrote:
     >> >> >>>>>
     >> >> >>>>> Thanks Steven,
     >> >> >>>>>
     >> >> >>>>> I really appreciate that. Super useful!
     >> >> >>>>>
     >> >> >>>>> All the best,
     >> >> >>>>> Peiman
     >> >> >>>>>
     >> >> >>>>>
     >> >> >>>>>
     >> >> >>>>>
     >> >> >>>>>
     >> >> >>>>>
     >> >> >>>>>
     >> >> >>>>> www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk>
     >> >> >>>>>
     >> >> >>>>> To receive emails about upcoming concerts visit this
    page & enter
     >> >> >>>>> your
     >> >> >>>>> email address in the 'follow' section.
     >> >> >>>>>
     >> >> >>>>>
     >> >> >>>>>
     >> >> >>>>> On 18 April 2013 23:45, Steven Yi <stevenyi@gmail.com
    <mailto:stevenyi@gmail.com>> wrote:
     >> >> >>>>>>
     >> >> >>>>>> Hi Peiman,
     >> >> >>>>>>
     >> >> >>>>>> Thought I'd mention, you may want to consider using
    formatting
     >> >> >>>>>> strings
     >> >> >>>>>> [1] to modify:
     >> >> >>>>>>
     >> >> >>>>>>     paramName = '"' + p4+"."+str(p1) + '"'
     >> >> >>>>>>
     >> >> >>>>>> to:
     >> >> >>>>>>
     >> >> >>>>>>     paramName = '"%s.%g"'%(p4, p1)
     >> >> >>>>>>
     >> >> >>>>>> You may also want to use list slicing  [2] with multiple
     >> >> >>>>>> assignment
     >> >> >>>>>> [2] to do something like this:
     >> >> >>>>>>
     >> >> >>>>>> t1, v1, t2, v2 = linseg[i:i+4]
     >> >> >>>>>>
     >> >> >>>>>> String formatting is good to know as you can get a lot of
     >> >> >>>>>> control
     >> >> >>>>>> about the string formatting, and the template string
    can be
     >> >> >>>>>> easier
     >> >> >>>>>> to
     >> >> >>>>>> use and understand, especially when using a lot of
    replacement
     >> >> >>>>>> values.
     >> >> >>>>>>  List slicing and multiple assignment are also handy
    syntax
     >> >> >>>>>> sugar
     >> >> >>>>>> to
     >> >> >>>>>> write more terser code.
     >> >> >>>>>>
     >> >> >>>>>> Hope that's useful!
     >> >> >>>>>> steven
     >> >> >>>>>>
     >> >> >>>>>> [1]
     >> >> >>>>>>
    http://docs.python.org/release/2.5.2/lib/typesseq-strings.html
     >> >> >>>>>> [2] http://docs.python.org/2/tutorial/introduction.html
     >> >> >>>>>>
     >> >> >>>>>> On Thu, Apr 18, 2013 at 11:25 PM, peiman khosravi
     >> >> >>>>>> <peimankhosravi@gmail.com
    <mailto:peimankhosravi@gmail.com>> wrote:
     >> >> >>>>>> > No thank you and Steven for all your comments and
     >> >> >>>>>> > contributions.
     >> >> >>>>>> >
     >> >> >>>>>> > I've had enough of staring at the computer tonight.
    Here's the
     >> >> >>>>>> > latest
     >> >> >>>>>> > function I came up with.
     >> >> >>>>>> >
     >> >> >>>>>> > Best,
     >> >> >>>>>> > P
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> > from csd.pysco import PythonScore
     >> >> >>>>>> > from random import choice
     >> >> >>>>>> >
     >> >> >>>>>> > score = PythonScore()
     >> >> >>>>>> > cue = score.cue
     >> >> >>>>>> >
     >> >> >>>>>> > score.write('f1 0 8192 10 1')
     >> >> >>>>>> >
     >> >> >>>>>> > def parameter(p1, name, type, envelope):
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >     if "l" in type:
     >> >> >>>>>> >         p7 = 1
     >> >> >>>>>> >     else:
     >> >> >>>>>> >         p7 = 0
     >> >> >>>>>> >
     >> >> >>>>>> >     p4 = name
     >> >> >>>>>> >     linseg = envelope
     >> >> >>>>>> >
     >> >> >>>>>> >     paramName = '"' + p4+"."+str(p1) + '"'
     >> >> >>>>>> >
     >> >> >>>>>> >     for i in range(len(linseg)-4):
     >> >> >>>>>> >
     >> >> >>>>>> >         if i > 0:
     >> >> >>>>>> >             i = i+1
     >> >> >>>>>> >
     >> >> >>>>>> >         t1 = linseg[i]
     >> >> >>>>>> >         v1 = linseg[i+1]
     >> >> >>>>>> >         t2 = linseg[i+2]
     >> >> >>>>>> >         v2 = linseg[i+3]
     >> >> >>>>>> >         start = t1
     >> >> >>>>>> >         dur = t2-t1
     >> >> >>>>>> >         point1 = v1
     >> >> >>>>>> >         point2 = v2
     >> >> >>>>>> >
     >> >> >>>>>> >         score.i(2, start, dur,paramName, point1,
    point2, p7)
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> > score.i(3.1, 0, 10)
     >> >> >>>>>> > parameter(3.1, "freq", "exp", [0, 1440, 1, 20, 1.3,
    440])
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> > score.end();
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> > www.peimankhosravi.co.uk
    <http://www.peimankhosravi.co.uk>
     >> >> >>>>>> >
     >> >> >>>>>> > To receive emails about upcoming concerts visit this
    page &
     >> >> >>>>>> > enter
     >> >> >>>>>> > your email
     >> >> >>>>>> > address in the 'follow' section.
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> >
     >> >> >>>>>> > On 18 April 2013 23:09, Jacob Joaquin
    <jacobjoaquin@gmail.com <mailto:jacobjoaquin@gmail.com>>
     >> >> >>>>>> > wrote:
     >> >> >>>>>> >>
     >> >> >>>>>> >> Thanks for posting these. I'm definitely reading
    and running
     >> >> >>>>>> >> them.
     >> >> >>>>>> >> Here's
     >> >> >>>>>> >> an supported featured debugging feature that might
    help,
     >> >> >>>>>> >> which
     >> >> >>>>>> >> will
     >> >> >>>>>> >> eventually be transformed into an official feature.
    To see
     >> >> >>>>>> >> what
     >> >> >>>>>> >> data is
     >> >> >>>>>> >> currently in the score object, do this:
     >> >> >>>>>> >>
     >> >> >>>>>> >> for L in score.score_data:
     >> >> >>>>>> >>     print L
     >> >> >>>>>> >>
     >> >> >>>>>> >>
     >> >> >>>>>> >>
     >> >> >>>>>> >> On Thu, Apr 18, 2013 at 2:58 PM, peiman khosravi
     >> >> >>>>>> >> <peimankhosravi@gmail.com
    <mailto:peimankhosravi@gmail.com>> wrote:
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> Thanks, I haven't tried your example yet. That
    next! Here's
     >> >> >>>>>> >>> my
     >> >> >>>>>> >>> latest.
     >> >> >>>>>> >>> Much more readable. I'm not so suave with python
    [yet!] so
     >> >> >>>>>> >>> it's
     >> >> >>>>>> >>> probably not
     >> >> >>>>>> >>> the most efficient of doing it.
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> from csd.pysco import PythonScore
     >> >> >>>>>> >>> from random import choice
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> score = PythonScore()
     >> >> >>>>>> >>> cue = score.cue
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> score.write('f1 0 8192 10 1')
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> def note(p1, p2, p3, list):
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>     type = list.pop(1)
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>     if "l" in type:
     >> >> >>>>>> >>>         p7 = 1
     >> >> >>>>>> >>>     else:
     >> >> >>>>>> >>>         p7 = 0
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>     p4 = list.pop(0)
     >> >> >>>>>> >>>     linseg = list[0:]
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>     score.i(p1, p2, p3)
     >> >> >>>>>> >>>     paramName = '"' + p4+"."+str(p1) + '"'
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>     for i in range(len(linseg)-4):
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>         if i > 0:
     >> >> >>>>>> >>>             i = i+1
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>         t1 = linseg[i]
     >> >> >>>>>> >>>         v1 = linseg[i+1]
     >> >> >>>>>> >>>         t2 = linseg[i+2]
     >> >> >>>>>> >>>         v2 = linseg[i+3]
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>         start = t1
     >> >> >>>>>> >>>         dur = t2-t1
     >> >> >>>>>> >>>         point1 = v1
     >> >> >>>>>> >>>         point2 = v2
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>         score.i(2, start, dur,paramName, point1,
    point2, p7)
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> note(3.1, 0, 10, ["freq", "exp", 0, 1440, 1, 20,
    1.3, 440])
     >> >> >>>>>> >>> note(3.2, 0, 10, ["freq", "lin", 0, 1440, 1, 200,
    5, 1840])
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> score.end();
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> www.peimankhosravi.co.uk
    <http://www.peimankhosravi.co.uk>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> To receive emails about upcoming concerts visit
    this page &
     >> >> >>>>>> >>> enter
     >> >> >>>>>> >>> your
     >> >> >>>>>> >>> email address in the 'follow' section.
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>>
     >> >> >>>>>> >>> On 18 April 2013 22:52, Jacob Joaquin
     >> >> >>>>>> >>> <jacobjoaquin@gmail.com
    <mailto:jacobjoaquin@gmail.com>>
     >> >> >>>>>> >>> wrote:
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>> I cleaned up the example and placed it with the
    PythonScore
     >> >> >>>>>> >>>> examples in
     >> >> >>>>>> >>>> the master branch of the CSD module:
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
    https://github.com/jacobjoaquin/csd/blob/master/examples/PythonScore/multi_segment_env.csd
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>> The plan is to create/collect lots of examples as
    a way to
     >> >> >>>>>> >>>> start
     >> >> >>>>>> >>>> identifying some of the design patterns that
    Python brings
     >> >> >>>>>> >>>> to
     >> >> >>>>>> >>>> the
     >> >> >>>>>> >>>> score
     >> >> >>>>>> >>>> environment. Once enough are collected and we
    have a sense
     >> >> >>>>>> >>>> of
     >> >> >>>>>> >>>> good ways of
     >> >> >>>>>> >>>> approaching common problems, functions and
    classes that
     >> >> >>>>>> >>>> reside
     >> >> >>>>>> >>>> in
     >> >> >>>>>> >>>> these
     >> >> >>>>>> >>>> examples we'll be pulled out, rewritten if
    necessary, and
     >> >> >>>>>> >>>> placed
     >> >> >>>>>> >>>> into
     >> >> >>>>>> >>>> modules that come with CSD. The examples will be
    updated in
     >> >> >>>>>> >>>> the
     >> >> >>>>>> >>>> process.
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>>
     >> >> >>>>>> >>>> On Thu, Apr 18, 2013 at 8:30 AM, Jacob Joaquin
     >> >> >>>>>> >>>> <jacobjoaquin@gmail.com
    <mailto:jacobjoaquin@gmail.com>>
     >> >> >>>>>> >>>> wrote:
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> Here is another approach:
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> https://gist.github.com/jacobjoaquin/5413575
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> I feel I can reduce this example further, and
    when I do,
     >> >> >>>>>> >>>>> I'll
     >> >> >>>>>> >>>>> include
     >> >> >>>>>> >>>>> it as an example case with PythonScore. In the
    meantime,
     >> >> >>>>>> >>>>> here's
     >> >> >>>>>> >>>>> the
     >> >> >>>>>> >>>>> explanation of how it works.
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> Envelope shapes are generated as tables. They
    are created
     >> >> >>>>>> >>>>> dynamically
     >> >> >>>>>> >>>>> in score. Since we don't want tables overwriting
    tables as
     >> >> >>>>>> >>>>> they're being
     >> >> >>>>>> >>>>> played, I created the table_cycler that cycles
    through a
     >> >> >>>>>> >>>>> range
     >> >> >>>>>> >>>>> of table
     >> >> >>>>>> >>>>> indexes every time a new table is created. In
    this case,
     >> >> >>>>>> >>>>> the
     >> >> >>>>>> >>>>> range is
     >> >> >>>>>> >>>>> between 100 and 120.
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> table_cycler = cycle(xrange(100, 120))
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> The function that handles this is
    gen_envelope(). It takes
     >> >> >>>>>> >>>>> a
     >> >> >>>>>> >>>>> list of
     >> >> >>>>>> >>>>> envelope points, and reformats it into a GEN07
    "f" event.
     >> >> >>>>>> >>>>> The
     >> >> >>>>>> >>>>> args are the
     >> >> >>>>>> >>>>> same as GEN07, but only the envelope data, as
    the first 5
     >> >> >>>>>> >>>>> "f"
     >> >> >>>>>> >>>>> event pfields
     >> >> >>>>>> >>>>> are automatically handled:
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> def gen_envelope(*args):
     >> >> >>>>>> >>>>>     global table_cycler
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>>     table = table_cycler.next()
     >> >> >>>>>> >>>>>     L = ["f", table, score.cue.now(), 8192, -7] +
     >> >> >>>>>> >>>>> list(args)
     >> >> >>>>>> >>>>>     score.write(" ".join(str(i) for i in L))
     >> >> >>>>>> >>>>>     return table
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> That function returns the number of the table
    generated.
     >> >> >>>>>> >>>>> So a
     >> >> >>>>>> >>>>> value
     >> >> >>>>>> >>>>> between 100 and 120. If you watch the table
    numbers during
     >> >> >>>>>> >>>>> a
     >> >> >>>>>> >>>>> performance,
     >> >> >>>>>> >>>>> you'll see it cycle through this range.
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> Now, one can pass an arbitrary number of
    envelope points.
     >> >> >>>>>> >>>>> The
     >> >> >>>>>> >>>>> first 5
     >> >> >>>>>> >>>>> notes in the score demo this explicitly:
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> with cue(0): note(4, 0.707, 1000,
    gen_envelope(0, 8092, 1,
     >> >> >>>>>> >>>>> 100,
     >> >> >>>>>> >>>>> 0))
     >> >> >>>>>> >>>>> with cue(4): note(1, 0.707, 700, gen_envelope(0,
    100, 1,
     >> >> >>>>>> >>>>> 8191,
     >> >> >>>>>> >>>>> 0))
     >> >> >>>>>> >>>>> with cue(5): note(1, 0.707, 400, gen_envelope(1,
    8192, 0))
     >> >> >>>>>> >>>>> with cue(6): note(1, 0.707, 100, gen_envelope(0,
    100, 1,
     >> >> >>>>>> >>>>> 100,
     >> >> >>>>>> >>>>> 1,
     >> >> >>>>>> >>>>> 7991,
     >> >> >>>>>> >>>>> 0))
     >> >> >>>>>> >>>>> with cue(7): note(1, 0.707, 200, gen_envelope(0,
    8092, 1,
     >> >> >>>>>> >>>>> 100,
     >> >> >>>>>> >>>>> 0))
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> For the rest of the piece, it auto-cycles between a
     >> >> >>>>>> >>>>> frequency
     >> >> >>>>>> >>>>> pattern
     >> >> >>>>>> >>>>> and an envelope pattern.
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> Best,
     >> >> >>>>>> >>>>> Jake
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>>
     >> >> >>>>>> >>>>> On Thu, Apr 18, 2013 at 6:52 AM, Jacob Joaquin
     >> >> >>>>>> >>>>> <jacobjoaquin@gmail.com
    <mailto:jacobjoaquin@gmail.com>>
     >> >> >>>>>> >>>>> wrote:
     >> >> >>>>>> >>>>>>
     >> >> >>>>>> >>>>>> I'll take a stab at this problem in a bit, but
    I'm hoping
     >> >> >>>>>> >>>>>> arrays in C6
     >> >> >>>>>> >>>>>> will support something like the following. To
    solve the
     >> >> >>>>>> >>>>>> problem
     >> >> >>>>>> >>>>>> you
     >> >> >>>>>> >>>>>> presented, I think it would require two things.
    First,
     >> >> >>>>>> >>>>>> the
     >> >> >>>>>> >>>>>> ability to pass
     >> >> >>>>>> >>>>>> an as a pfield in the score:
     >> >> >>>>>> >>>>>>
     >> >> >>>>>> >>>>>> i 1 0 4 440 0.5 array(0, 0.2, 1, 0.7, 1, 0.1, 0)
     >> >> >>>>>> >>>>>>
     >> >> >>>>>> >>>>>> And then in the score, pass the array in as a
    list of
     >> >> >>>>>> >>>>>> args
     >> >> >>>>>> >>>>>> for
     >> >> >>>>>> >>>>>> opcodes:
     >> >> >>>>>> >>>>>>
     >> >> >>>>>> >>>>>> ienvpoints getarray p6
     >> >> >>>>>> >>>>>> kenv linseg *ienvpoints
     >> >> >>>>>> >>>>>>
     >> >> >>>>>> >>>>>> There may need to be a third step required for
    scaling
     >> >> >>>>>> >>>>>> the
     >> >> >>>>>> >>>>>> even
     >> >> >>>>>> >>>>>> fields
     >> >> >>>>>> >>>>>> of the array, though is probably already
    supported by
     >> >> >>>>>> >>>>>> orchestra
     >> >> >>>>>> >>>>>> loop
     >> >> >>>>>> >>>>>> statements.
     >> >> >>>>>> >>>>>>
     >> >> >>>>>> >>>>>>
     >> >> >>>>>> >>>>>>
     >> >> >>>>>> >>>>>>
     >> >> >>>>>> >>>>>> On Thu, Apr 18, 2013 at 6:13 AM, peiman khosravi
     >> >> >>>>>> >>>>>> <peimankhosravi@gmail.com
    <mailto:peimankhosravi@gmail.com>> wrote:
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>> Thanks very much Steven,
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>> I'm going to have a proper look at the code
    you posted.
     >> >> >>>>>> >>>>>>> My
     >> >> >>>>>> >>>>>>> initial
     >> >> >>>>>> >>>>>>> impression is that this is possibly too
    convoluted for
     >> >> >>>>>> >>>>>>> quick
     >> >> >>>>>> >>>>>>> and dirty
     >> >> >>>>>> >>>>>>> experimentation. I think it should be easier
    than that.
     >> >> >>>>>> >>>>>>> Maybe
     >> >> >>>>>> >>>>>>> with array in
     >> >> >>>>>> >>>>>>> csound6 it will be possible?
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>> Cheers,
     >> >> >>>>>> >>>>>>> Peiman
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>> www.peimankhosravi.co.uk
    <http://www.peimankhosravi.co.uk>
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>> To receive emails about upcoming concerts
    visit this
     >> >> >>>>>> >>>>>>> page &
     >> >> >>>>>> >>>>>>> enter
     >> >> >>>>>> >>>>>>> your email address in the 'follow' section.
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>>
     >> >> >>>>>> >>>>>>> On 18 April 2013 12:21, Steven Yi
    <stevenyi@gmail.com <mailto:stevenyi@gmail.com>>
     >> >> >>>>>> >>>>>>> wrote:
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> Hi Peiman,
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> I've done a couple of ways using score
    generation:
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> 1) For a limited number of articulations,
    I've added a
     >> >> >>>>>> >>>>>>>> pfield
     >> >> >>>>>> >>>>>>>> that
     >> >> >>>>>> >>>>>>>> is
     >> >> >>>>>> >>>>>>>> used as an index to choose what envelope to
    generate
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> 2) For arbitrary segments, I use fractional
    instrument
     >> >> >>>>>> >>>>>>>> numbers
     >> >> >>>>>> >>>>>>>> together with tied-notes.  Essentially, each
    segment
     >> >> >>>>>> >>>>>>>> becomes
     >> >> >>>>>> >>>>>>>> a note.
     >> >> >>>>>> >>>>>>>> Using fractional instr numbers allows for
    polyphonic
     >> >> >>>>>> >>>>>>>> streams.
     >> >> >>>>>> >>>>>>>> I've
     >> >> >>>>>> >>>>>>>> used this in pieces (you can check
     >> >> >>>>>> >>>>>>>>
    blue/examples/pieces/stevenYi/etude/etude_part3.blue,
     >> >> >>>>>> >>>>>>>> the
     >> >> >>>>>> >>>>>>>> "StrA -
     >> >> >>>>>> >>>>>>>> 8.00" object) and am using this in my current
    piece to
     >> >> >>>>>> >>>>>>>> do
     >> >> >>>>>> >>>>>>>> group
     >> >> >>>>>> >>>>>>>> glissandi sounds.
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> The setup for instruments for tied-notes can
    be a bit
     >> >> >>>>>> >>>>>>>> tricky,
     >> >> >>>>>> >>>>>>>> but
     >> >> >>>>>> >>>>>>>> I've
     >> >> >>>>>> >>>>>>>> got a set of UDO's now that I use together as a
     >> >> >>>>>> >>>>>>>> template
     >> >> >>>>>> >>>>>>>> when
     >> >> >>>>>> >>>>>>>> building
     >> >> >>>>>> >>>>>>>> instruments that will work with different
    p-fields
     >> >> >>>>>> >>>>>>>> given
     >> >> >>>>>> >>>>>>>> for
     >> >> >>>>>> >>>>>>>> a note.
     >> >> >>>>>> >>>>>>>> That's allowed using an instrument with MIDI,
    by score
     >> >> >>>>>> >>>>>>>> with
     >> >> >>>>>> >>>>>>>> 5-fields,
     >> >> >>>>>> >>>>>>>> or scores with 8-fields.  That in turn has
    made it nice
     >> >> >>>>>> >>>>>>>> to
     >> >> >>>>>> >>>>>>>> work with
     >> >> >>>>>> >>>>>>>> live, for quick sketching, or for generation.
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> For example, code from my current piece uses:
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> def scoreFunc():
     >> >> >>>>>> >>>>>>>>     end = [3,5,7][int(random.random() * 3)]
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>>     ampGen = Mask(GaussRandom(),
     >> >> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,-14),
    (8.0, -14),
     >> >> >>>>>> >>>>>>>> (10,-50)]),
     >> >> >>>>>> >>>>>>>>          LinearSegment([(0,-20), (5,
    -16),(8.0, -16),
     >> >> >>>>>> >>>>>>>> (10,-50)]))
     >> >> >>>>>> >>>>>>>>     pchVarianceGen = Mask(GaussRandom(),
     >> >> >>>>>> >>>>>>>>         LinearSegment([(0,.01), (4,7), (6,end)]),
     >> >> >>>>>> >>>>>>>>         LinearSegment([(0,0), (4,3), (6,end
    -.09)]))
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>>     return createUnstableGroup3(50,
     >> >> >>>>>> >>>>>>>> PchDeviation(8.00,pchVarianceGen), ampGen)
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> score = groupB64A.perform(scoreFunc)
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> The code uses a mix of PMask and some score
    generating
     >> >> >>>>>> >>>>>>>> functions to
     >> >> >>>>>> >>>>>>>> generate a score performance func that
    groupB64A uses
     >> >> >>>>>> >>>>>>>> to
     >> >> >>>>>> >>>>>>>> generate
     >> >> >>>>>> >>>>>>>> notes like:
     >> >> >>>>>> >>>>>>>>
     >> >> >>>>>> >>>>>>>> i8.35 1.084415 -1.4377031326 8.000038
    8.000038 -20.0
     >> >> >>>>>> >>>>>>>> -0.25
     >> >> >>>>>> >>>>>>>> 3
     >> >> >>>>>> >>>>>>>> i8.35 2.5229952 -1.4367991686 8.000038 8.004786
     >> >> >>>>>> >>>>>>>> -19.650074
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 3.961568 -1.3871263266 8.004786 8.007394
     >> >> >>>>>> >>>>>>>> -19.493192
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 5.4001484 -1.4312039614 8.007394 8.007814
     >> >> >>>>>> >>>>>>>> -19.185775
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 6.8387213 -1.4212728739 8.007814 8.010616
     >> >> >>>>>> >>>>>>>> -19.101318
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 8.277302 -1.3794412613 8.010616 8.013475
     >> >> >>>>>> >>>>>>>> -18.854064
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 9.715882 -1.3909647465 8.013475 8.019136
     >> >> >>>>>> >>>>>>>> -18.681332
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 11.154455 -1.3922381401 8.019136 8.022112
     >> >> >>>>>> >>>>>>>> -18.381339
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 12.593036 -1.3760640621 8.022112 8.022678
     >> >> >>>>>> >>>>>>>> -18.391186
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 14.031609 -1.4118962288 8.022678 8.024639
     >> >> >>>>>> >>>>>>>> -18.016504
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 15.470189 -1.3986382484 8.024639 8.023337
     >> >> >>>>>> >>>>>>>> -17.852918
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 16.908762 -1.4070171118 8.023337 8.028320
     >> >> >>>>>> >>>>>>>> -17.739093
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 18.347342 -1.368899703 8.028320 8.032210
     >> >> >>>>>> >>>>>>>> -17.638612
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 19.785915 -1.4182219505 8.032210 8.032275
     >> >> >>>>>> >>>>>>>> -17.281441
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 21.224495 -1.4046440125 8.032275 8.031516
     >> >> >>>>>> >>>>>>>> -17.084029
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 22.663069 -1.3827091455 8.031516 8.038609
     >> >> >>>>>> >>>>>>>> -16.852563
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 24.10165 -1.4189138412 8.038609 8.040858
     >> >> >>>>>> >>>>>>>> -16.765706
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 25.540222 -1.3738020658 8.040858 8.046430
     >> >> >>>>>> >>>>>>>> -16.53684
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 26.978802 -1.3740570545 8.046430 8.042195
     >> >> >>>>>> >>>>>>>> -16.509181
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 28.417374 -1.3843715191 8.042195 8.053067
     >> >> >>>>>> >>>>>>>> -16.071466
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 29.855957 -1.3682380915 8.053067 8.055041
     >> >> >>>>>> >>>>>>>> -16.044135
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 31.294535 -1.4083257914 8.055041 8.056830
     >> >> >>>>>> >>>>>>>> -15.876995
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 32.73311 -1.3934253454 8.056830 8.050649
     >> >> >>>>>> >>>>>>>> -15.334785
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 34.171688 -1.3804633617 8.050649 8.061464
     >> >> >>>>>> >>>>>>>> -15.10768
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 35.610264 -1.4261986017 8.061464 8.061039
     >> >> >>>>>> >>>>>>>> -15.110869
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 37.048843 -1.3748892546 8.061039 8.057694
     >> >> >>>>>> >>>>>>>> -14.97975
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 38.487415 -1.4119622707 8.057694 8.059164
     >> >> >>>>>> >>>>>>>> -15.162844
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 39.925995 -1.4079648256 8.059164 8.063682
     >> >> >>>>>> >>>>>>>> -15.031393
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 41.364567 -1.3830046654 8.063682 8.066819
     >> >> >>>>>> >>>>>>>> -15.081042
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 42.80315 -1.3822585344 8.066819 8.068530
     >> >> >>>>>> >>>>>>>> -14.882624
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 44.241722 -1.3874080181 8.068530 8.069436
     >> >> >>>>>> >>>>>>>> -14.896086
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 45.680305 -1.413726449 8.069436 8.069630
     >> >> >>>>>> >>>>>>>> -15.091414
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 47.118874 -1.3767383099 8.069630 8.069598
     >> >> >>>>>> >>>>>>>> -15.158592
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 48.557457 -1.4365614653 8.069598 8.069631
     >> >> >>>>>> >>>>>>>> -14.899716
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 49.99603 -1.4318871498 8.069631 8.069497
     >> >> >>>>>> >>>>>>>> -14.702429
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 51.43461 -1.3713545799 8.069497 8.069571
     >> >> >>>>>> >>>>>>>> -15.131773
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 52.87319 -1.4325782061 8.069571 8.069599
     >> >> >>>>>> >>>>>>>> -14.636183
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 54.31176 -1.3960390091 8.069599 8.069542
     >> >> >>>>>> >>>>>>>> -15.131769
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 55.750343 -1.4269478321 8.069542 8.069326
     >> >> >>>>>> >>>>>>>> -14.890712
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 57.188915 -1.4047013521 8.069326 8.069534
     >> >> >>>>>> >>>>>>>> -15.07093
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 58.627495 -1.4383727312 8.069534 8.069513
     >> >> >>>>>> >>>>>>>> -15.454695
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 60.06607 -1.4270732403 8.069513 8.069626
     >> >> >>>>>> >>>>>>>> -18.76601
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 61.50465 -1.41991961 8.069626 8.069611
    -22.462327
     >> >> >>>>>> >>>>>>>> -0.25
     >> >> >>>>>> >>>>>>>> 3
     >> >> >>>>>> >>>>>>>> i8.35 62.943226 -1.4173574448 8.069611 8.069581
     >> >> >>>>>> >>>>>>>> -25.679255
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 64.381805 -1.4209455252 8.069581 8.069516
     >> >> >>>>>> >>>>>>>> -29.276605
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 65.82037 -1.4201356173 8.069516 8.069553
     >> >> >>>>>> >>>>>>>> -32.679133
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 67.25896 -1.4275581837 8.069553 8.069488
     >> >> >>>>>> >>>>>>>> -36.302659
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 68.697525 -1.3737080097 8.069488 8.069535
     >> >> >>>>>> >>>>>>>> -39.657244
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 70.13611 -1.3902155161 8.069535 8.069618
     >> >> >>>>>> >>>>>>>> -43.120713
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.35 71.574684 1.3676546812 8.069618 8.069564
     >> >> >>>>>> >>>>>>>> -46.535213
     >> >> >>>>>> >>>>>>>> -0.25 3
     >> >> >>>>>> >>>>>>>> i8.36 0.5406121 -1.3978190422 8.000044
    8.000044 -20.0
     >> >> >>>>>> >>>>>>>> -0.2
     >> >> >>>>>> >>>>>>>> 3
     >> >> >>>>>> >>>>>>>> i8.36 1.990064 -1.4079940319 8.000044 8.003445
     >> >> >>>>>> >>>>>>>> -19.726454
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 3.4395235 -1.4026026726 8.003445 8.005732
     >> >> >>>>>> >>>>>>>> -19.534423
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 4.8889756 -1.4466329813 8.005732 8.008213
     >> >> >>>>>> >>>>>>>> -19.336654
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 6.3384275 -1.3816027641 8.008213 8.010503
     >> >> >>>>>> >>>>>>>> -19.100944
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 7.787879 -1.3980585337 8.010503 8.014563
     >> >> >>>>>> >>>>>>>> -18.944366
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 9.237331 -1.4204907417 8.014563 8.017089
     >> >> >>>>>> >>>>>>>> -18.654563
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 10.686784 -1.423738122 8.017089 8.017043
     >> >> >>>>>> >>>>>>>> -18.580576
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 12.136235 -1.4217048883 8.017043 8.022825
     >> >> >>>>>> >>>>>>>> -18.39672
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 13.585688 -1.3883031607 8.022825 8.021133
     >> >> >>>>>> >>>>>>>> -18.135332
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 15.035148 -1.3769127131 8.021133 8.026658
     >> >> >>>>>> >>>>>>>> -17.827478
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 16.4846 -1.4433034658 8.026658 8.030203
     >> >> >>>>>> >>>>>>>> -17.834061
     >> >> >>>>>> >>>>>>>> -0.2
     >> >> >>>>>> >>>>>>>> 3
     >> >> >>>>>> >>>>>>>> i8.36 17.934052 -1.4192566872 8.030203 8.030828
     >> >> >>>>>> >>>>>>>> -17.468498
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 19.383503 -1.4234896898 8.030828 8.037894
     >> >> >>>>>> >>>>>>>> -17.24293
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 20.832954 -1.4358183146 8.037894 8.037114
     >> >> >>>>>> >>>>>>>> -17.232881
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 22.282408 -1.411026001 8.037114 8.039347
     >> >> >>>>>> >>>>>>>> -16.858355
     >> >> >>>>>> >>>>>>>> -0.2 3
     >> >> >>>>>> >>>>>>>> i8.36 23.73186 -1.4165604115 8.039347 8.036614
     >> >> >>>>>> >>>>>>>> -16.843183


Date2013-04-22 11:34
Frompeiman khosravi
SubjectRe: [Csnd] more python
On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Nice webpage!  Any thought to adding RSS or Atom so people can
subscribe to the page?


I've done it. Hopefully it's working! : http://www.peimankhosravi.co.uk/miscellaneous.html
Thanks for the suggestion.


P
 

Date2013-04-22 11:50
FromSteven Yi
SubjectRe: [Csnd] more python
Hi Peiman,

Seems to be working here. :)  One other thing you can do is add the
RSS feed as a link within the head tags of the HTML file, like:




I know with Chrome and the extensions I have, it will see that in an
html's head and then show a button for subscribing to the RSS feed.

Thanks!
steven

On Mon, Apr 22, 2013 at 11:34 AM, peiman khosravi
 wrote:
> On 19 April 2013 12:58, Steven Yi  wrote:
>>
>> Hi Peiman,
>>
>> Nice webpage!  Any thought to adding RSS or Atom so people can
>> subscribe to the page?
>>
>
> I've done it. Hopefully it's working! :
> http://www.peimankhosravi.co.uk/miscellaneous.html
> Thanks for the suggestion.
>
>
> P
>

Date2013-04-22 11:54
Frompeiman khosravi
SubjectRe: [Csnd] more python
Glad it's working! 

Oh nice. Thanks for the tip Steven! I will do. 

Best,
Peiman








www.peimankhosravi.co.uk

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 22 April 2013 11:50, Steven Yi <stevenyi@gmail.com> wrote:
Hi Peiman,

Seems to be working here. :)  One other thing you can do is add the
RSS feed as a link within the head tags of the HTML file, like:

<link rel="alternate" type="application/rss+xml" title="steven yi ::
music &raquo; Feed" href="http://kunstmusik.com/feed/" />
<link rel="alternate" type="application/rss+xml" title="steven yi ::
music &raquo; Comments Feed"
href="http://kunstmusik.com/comments/feed/" />

I know with Chrome and the extensions I have, it will see that in an
html's head and then show a button for subscribing to the RSS feed.

Thanks!
steven

On Mon, Apr 22, 2013 at 11:34 AM, peiman khosravi
<peimankhosravi@gmail.com> wrote:
> On 19 April 2013 12:58, Steven Yi <stevenyi@gmail.com> wrote:
>>
>> Hi Peiman,
>>
>> Nice webpage!  Any thought to adding RSS or Atom so people can
>> subscribe to the page?
>>
>
> I've done it. Hopefully it's working! :
> http://www.peimankhosravi.co.uk/miscellaneous.html
> Thanks for the suggestion.
>
>
> P
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"