Csound Csound-dev Csound-tekno Search About

[Csnd] Seeding options for tilde (~) in the score file

Date2012-03-09 05:55
FromDeepak
Subject[Csnd] Seeding options for tilde (~) in the score file
Hi everyone...

I am Deepak Gopinath, and I am one of Dr. B's students at Berklee right now. When it comes to Csound, I am a newbie and this is in fact my first email to the Csound list.

I have been exploring the various rand opcodes and as I was reading the manual, I saw that, these opcodes have different seeding options (for eg: seed = 0, means seed from current time and it makes it run differently every time) and I understand that.

I also learned that, in the score file,  one could use the ~ (tilde) operator instead of < operator for 'randomized' ramping between a range of values in a p-field. I was wondering, if there is some sort of seeding options (for eg: seeding from the clock) available for this tilde operator, so that the random picking of values in this range is actually different every time.

Now when I use the ~ operator and run the .csd file,  everytime, the random numbers generated are the same, which is not helping 'randomization' at all..:)

Would be great if someone can help me out!

Thank you very much.

Yours sincerely
Deepak.

--
www.myspace.com/dcompanymusic
www.myspace.com/thewoodshedmusicians

Date2012-03-09 06:28
FromDavid Akbari
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
Hi Deepak,

Thanks for your email. I seem to recall an example addressing an issue
similar to this from either The Csound Book or the Csound Catalog.

As I recall, the technique was using event generating instruments and
some kind of if/ kgoto to check and change the random upper and lower
bounds on each instrument pass; supplying the random values in a
p-field other than p2 or p3 (would you really want random durations?
Maybe.)

If you really wanted to go nuts on getting a random seed from outer
space I think it would be cool to use the 'system' opcode (runs a
shell inside Csound) to then use your system's native `urand` etc.

I'll have a look in the next few days to see if I can't find the
instrument I'm thinking of or at least an example of an event
generating instrument supplying new random seeds to p-fields.

You could even just make a global variable that increments and never
resets but is used in conjunction with the modulous operator with its
own operand to constrain your values dynamically for a similar effect.
It's really a hoot to do this kind of thing in Max/MSP or Pd for MIDI
values.

gkval = ksomething % kboundary
ksomething = ksomething + krandomincrement
p8 = ksomething


etc

This has some possible drawbacks to a programmer but to a musician
this is the type of thinking that can make novel results happen.

Best of luck in your search!


-David



On Thu, Mar 8, 2012 at 11:55 PM, Deepak  wrote:
> Hi everyone...
>
> I am Deepak Gopinath, and I am one of Dr. B's students at Berklee right now.
> When it comes to Csound, I am a newbie and this is in fact my first email to
> the Csound list.
>
> I have been exploring the various rand opcodes and as I was reading the
> manual, I saw that, these opcodes have different seeding options (for eg:
> seed = 0, means seed from current time and it makes it run differently every
> time) and I understand that.
>
> I also learned that, in the score file,  one could use the ~ (tilde)
> operator instead of < operator for 'randomized' ramping between a range of
> values in a p-field. I was wondering, if there is some sort of seeding
> options (for eg: seeding from the clock) available for this tilde operator,
> so that the random picking of values in this range is actually different
> every time.
>
> Now when I use the ~ operator and run the .csd file,  everytime, the random
> numbers generated are the same, which is not helping 'randomization' at
> all..:)
>
> Would be great if someone can help me out!
>
> Thank you very much.
>
> Yours sincerely
> Deepak.
>
> --
> www.myspace.com/dcompanymusic
> www.myspace.com/thewoodshedmusicians


Date2012-03-09 06:34
FromDeepak
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
Hi...

The thought of having random p2 and p3 have occurred to me too...So as to incorporate aleatoric elements in the 'performance' of the piece....and that would be really cool and produce some interesting musical textures and possibilities...As I mentioned, I am an absolute beginner, who started doing Csound, 2 months ago...I come from more of a traditional composition background....So I am still in the beginning stages of learning and exploring...I will look into what you suggested and am excited to see what others have to say too...:)

thanks
Deepak.




On Fri, Mar 9, 2012 at 1:28 AM, David Akbari <dakbari@gmail.com> wrote:
Hi Deepak,

Thanks for your email. I seem to recall an example addressing an issue
similar to this from either The Csound Book or the Csound Catalog.

As I recall, the technique was using event generating instruments and
some kind of if/ kgoto to check and change the random upper and lower
bounds on each instrument pass; supplying the random values in a
p-field other than p2 or p3 (would you really want random durations?
Maybe.)

If you really wanted to go nuts on getting a random seed from outer
space I think it would be cool to use the 'system' opcode (runs a
shell inside Csound) to then use your system's native `urand` etc.

I'll have a look in the next few days to see if I can't find the
instrument I'm thinking of or at least an example of an event
generating instrument supplying new random seeds to p-fields.

You could even just make a global variable that increments and never
resets but is used in conjunction with the modulous operator with its
own operand to constrain your values dynamically for a similar effect.
It's really a hoot to do this kind of thing in Max/MSP or Pd for MIDI
values.

gkval = ksomething % kboundary
ksomething = ksomething + krandomincrement
p8 = ksomething


etc

This has some possible drawbacks to a programmer but to a musician
this is the type of thinking that can make novel results happen.

Best of luck in your search!


-David



On Thu, Mar 8, 2012 at 11:55 PM, Deepak <musicmagic@gmail.com> wrote:
> Hi everyone...
>
> I am Deepak Gopinath, and I am one of Dr. B's students at Berklee right now.
> When it comes to Csound, I am a newbie and this is in fact my first email to
> the Csound list.
>
> I have been exploring the various rand opcodes and as I was reading the
> manual, I saw that, these opcodes have different seeding options (for eg:
> seed = 0, means seed from current time and it makes it run differently every
> time) and I understand that.
>
> I also learned that, in the score file,  one could use the ~ (tilde)
> operator instead of < operator for 'randomized' ramping between a range of
> values in a p-field. I was wondering, if there is some sort of seeding
> options (for eg: seeding from the clock) available for this tilde operator,
> so that the random picking of values in this range is actually different
> every time.
>
> Now when I use the ~ operator and run the .csd file,  everytime, the random
> numbers generated are the same, which is not helping 'randomization' at
> all..:)
>
> Would be great if someone can help me out!
>
> Thank you very much.
>
> Yours sincerely
> Deepak.
>
> --
> www.myspace.com/dcompanymusic
> www.myspace.com/thewoodshedmusicians


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"




--
www.myspace.com/dcompanymusic
www.myspace.com/thewoodshedmusicians

Date2012-03-09 07:51
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
Welcome Deepak,

As you probably know there can be many different ways to approach
this. For me, I'd think it simpler to generate the instrument events
from within another instrument, instead of using the score. So the
score would just start the "even generating" instrument once, and keep
it running for as long as the sequence lasts.

Here's a simple csd for this kind of thing. It uses the event opcode
to generate instr events on instr 31, and as an example generates
random note numbers in a specified range.
You could easily extend the random generation to other parameters, and
replace the random generator with other methods of number generation.
If you want "random within a movable range" replace the iLow and iHigh
varaibles with k-rate equivalents (kLow, kHigh) and use e.g. line
opcodes to automate the desired changes in range.

best
Oeyvind







	sr = 44100
	ksmps = 256
	nchnls = 2
	0dbfs = 1

	giSine		ftgen	0, 0, 65537, 10, 1
	
;*********************************************************************
; generate a melody with random note numbers
;*********************************************************************
	instr 	2
	iLow		= p4							; lowest note for random selection
	iHigh		= p5							; highest note for random selection
	kbpm		= p6							; tempo in beats per minute
	ktempo		= kbpm/60						; tempo in ticks per second
	kTrig		metro ktempo						; generate metronome pulse
	if kTrig == 0 kgoto done
	kNote		rnd31 1, 1						; random note
	kNote		= int(kNote*(iHigh-iLow)  )+iLow			; scale and transpose to
the desired range, skip the int() if you want microtonal intervals
	kDur		= (1/ktempo) * 0.9					; here, note duration is 90% of the time
until the next note
	kAmp		= -15							; amp in decibel
	instrNum	= 31							; instrument to be triggered
	event		"i", instrNum, 0, kDur, kAmp, kNote
	done:
	endin
;*********************************************************************
;***************************************************
; sine wave instrument
;***************************************************
	instr	31

; input parameters
	iamp		= ampdbfs(p4)						; amp in dB, relative to 0dbfs
	iNote		= p5							; p5 used as "midi note number"
	print iNote
	icps		= cpsmidinn(iNote)					; get cps from midi note number

; envelope
	iAttack		= 0.005
	iDecay		= 0.3
	iSustain 	= 0.3
	iRelease 	= 0.1
	amp		madsr	iAttack, iDecay, iSustain, iRelease

; audio generator
	a1		oscil3	amp*iamp, icps, giSine
	
			outch	1, a1, 2, a1

	endin
;*********************************************************************



; 	start	dur	low	high	bpm
i2 	0 	8 	60 	72	160

e






2012/3/9 Deepak :
> Hi...
>
> The thought of having random p2 and p3 have occurred to me too...So as to
> incorporate aleatoric elements in the 'performance' of the piece....and that
> would be really cool and produce some interesting musical textures and
> possibilities...As I mentioned, I am an absolute beginner, who started doing
> Csound, 2 months ago...I come from more of a traditional composition
> background....So I am still in the beginning stages of learning and
> exploring...I will look into what you suggested and am excited to see what
> others have to say too...:)
>
> thanks
> Deepak.
>
>
>
>
>
> On Fri, Mar 9, 2012 at 1:28 AM, David Akbari  wrote:
>>
>> Hi Deepak,
>>
>> Thanks for your email. I seem to recall an example addressing an issue
>> similar to this from either The Csound Book or the Csound Catalog.
>>
>> As I recall, the technique was using event generating instruments and
>> some kind of if/ kgoto to check and change the random upper and lower
>> bounds on each instrument pass; supplying the random values in a
>> p-field other than p2 or p3 (would you really want random durations?
>> Maybe.)
>>
>> If you really wanted to go nuts on getting a random seed from outer
>> space I think it would be cool to use the 'system' opcode (runs a
>> shell inside Csound) to then use your system's native `urand` etc.
>>
>> I'll have a look in the next few days to see if I can't find the
>> instrument I'm thinking of or at least an example of an event
>> generating instrument supplying new random seeds to p-fields.
>>
>> You could even just make a global variable that increments and never
>> resets but is used in conjunction with the modulous operator with its
>> own operand to constrain your values dynamically for a similar effect.
>> It's really a hoot to do this kind of thing in Max/MSP or Pd for MIDI
>> values.
>>
>> gkval = ksomething % kboundary
>> ksomething = ksomething + krandomincrement
>> p8 = ksomething
>>
>>
>> etc
>>
>> This has some possible drawbacks to a programmer but to a musician
>> this is the type of thinking that can make novel results happen.
>>
>> Best of luck in your search!
>>
>>
>> -David
>>
>>
>>
>> On Thu, Mar 8, 2012 at 11:55 PM, Deepak  wrote:
>> > Hi everyone...
>> >
>> > I am Deepak Gopinath, and I am one of Dr. B's students at Berklee right
>> > now.
>> > When it comes to Csound, I am a newbie and this is in fact my first
>> > email to
>> > the Csound list.
>> >
>> > I have been exploring the various rand opcodes and as I was reading the
>> > manual, I saw that, these opcodes have different seeding options (for
>> > eg:
>> > seed = 0, means seed from current time and it makes it run differently
>> > every
>> > time) and I understand that.
>> >
>> > I also learned that, in the score file,  one could use the ~ (tilde)
>> > operator instead of < operator for 'randomized' ramping between a range
>> > of
>> > values in a p-field. I was wondering, if there is some sort of seeding
>> > options (for eg: seeding from the clock) available for this tilde
>> > operator,
>> > so that the random picking of values in this range is actually different
>> > every time.
>> >
>> > Now when I use the ~ operator and run the .csd file,  everytime, the
>> > random
>> > numbers generated are the same, which is not helping 'randomization' at
>> > all..:)
>> >
>> > Would be great if someone can help me out!
>> >
>> > Thank you very much.
>> >
>> > Yours sincerely
>> > Deepak.
>> >
>> > --
>> > www.myspace.com/dcompanymusic
>> > www.myspace.com/thewoodshedmusicians
>>
>>
>> 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"
>>
>
>
>
> --
> www.myspace.com/dcompanymusic
> www.myspace.com/thewoodshedmusicians



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp


Date2012-03-09 07:59
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
Thanks Oeyvind for sharing this with him / us. 

-dB
___________________________________

Dr. Richard Boulanger, Ph.D.

Professor of Electronic Production and Design
Professional Writing and Music Technology Division
Berklee College of Music
1140 Boylston Street
Boston, MA 02215-3693

617-747-2485 (office)
774-488-9166 (cell)

____________________________________

____________________________________

____________________________________

On Mar 9, 2012, at 2:51 AM, Oeyvind Brandtsegg wrote:

Welcome Deepak,

As you probably know there can be many different ways to approach
this. For me, I'd think it simpler to generate the instrument events
from within another instrument, instead of using the score. So the
score would just start the "even generating" instrument once, and keep
it running for as long as the sequence lasts.

Here's a simple csd for this kind of thing. It uses the event opcode
to generate instr events on instr 31, and as an example generates
random note numbers in a specified range.
You could easily extend the random generation to other parameters, and
replace the random generator with other methods of number generation.
If you want "random within a movable range" replace the iLow and iHigh
varaibles with k-rate equivalents (kLow, kHigh) and use e.g. line
opcodes to automate the desired changes in range.

best
Oeyvind


<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 256
nchnls = 2
0dbfs = 1

giSine ftgen 0, 0, 65537, 10, 1

;*********************************************************************
; generate a melody with random note numbers
;*********************************************************************
instr 2
iLow = p4 ; lowest note for random selection
iHigh = p5 ; highest note for random selection
kbpm = p6 ; tempo in beats per minute
ktempo = kbpm/60 ; tempo in ticks per second
kTrig metro ktempo ; generate metronome pulse
if kTrig == 0 kgoto done
kNote rnd31 1, 1 ; random note
kNote = int(kNote*(iHigh-iLow)  )+iLow ; scale and transpose to
the desired range, skip the int() if you want microtonal intervals
kDur = (1/ktempo) * 0.9 ; here, note duration is 90% of the time
until the next note
kAmp = -15 ; amp in decibel
instrNum = 31 ; instrument to be triggered
event "i", instrNum, 0, kDur, kAmp, kNote
done:
endin
;*********************************************************************
;***************************************************
; sine wave instrument
;***************************************************
instr 31

; input parameters
iamp = ampdbfs(p4) ; amp in dB, relative to 0dbfs
iNote = p5 ; p5 used as "midi note number"
print iNote
icps = cpsmidinn(iNote) ; get cps from midi note number

; envelope
iAttack = 0.005
iDecay = 0.3
iSustain = 0.3
iRelease = 0.1
amp madsr iAttack, iDecay, iSustain, iRelease

; audio generator
a1 oscil3 amp*iamp, icps, giSine

outch 1, a1, 2, a1

endin
;*********************************************************************

</CsInstruments>
<CsScore>
; start dur low high bpm
i2 0 8 60 72 160

e
</CsScore>
</CsoundSynthesizer>




2012/3/9 Deepak <musicmagic@gmail.com>:
Hi...

The thought of having random p2 and p3 have occurred to me too...So as to
incorporate aleatoric elements in the 'performance' of the piece....and that
would be really cool and produce some interesting musical textures and
possibilities...As I mentioned, I am an absolute beginner, who started doing
Csound, 2 months ago...I come from more of a traditional composition
background....So I am still in the beginning stages of learning and
exploring...I will look into what you suggested and am excited to see what
others have to say too...:)

thanks
Deepak.





On Fri, Mar 9, 2012 at 1:28 AM, David Akbari <dakbari@gmail.com> wrote:

Hi Deepak,

Thanks for your email. I seem to recall an example addressing an issue
similar to this from either The Csound Book or the Csound Catalog.

As I recall, the technique was using event generating instruments and
some kind of if/ kgoto to check and change the random upper and lower
bounds on each instrument pass; supplying the random values in a
p-field other than p2 or p3 (would you really want random durations?
Maybe.)

If you really wanted to go nuts on getting a random seed from outer
space I think it would be cool to use the 'system' opcode (runs a
shell inside Csound) to then use your system's native `urand` etc.

I'll have a look in the next few days to see if I can't find the
instrument I'm thinking of or at least an example of an event
generating instrument supplying new random seeds to p-fields.

You could even just make a global variable that increments and never
resets but is used in conjunction with the modulous operator with its
own operand to constrain your values dynamically for a similar effect.
It's really a hoot to do this kind of thing in Max/MSP or Pd for MIDI
values.

gkval = ksomething % kboundary
ksomething = ksomething + krandomincrement
p8 = ksomething


etc

This has some possible drawbacks to a programmer but to a musician
this is the type of thinking that can make novel results happen.

Best of luck in your search!


-David



On Thu, Mar 8, 2012 at 11:55 PM, Deepak <musicmagic@gmail.com> wrote:
Hi everyone...

I am Deepak Gopinath, and I am one of Dr. B's students at Berklee right
now.
When it comes to Csound, I am a newbie and this is in fact my first
email to
the Csound list.

I have been exploring the various rand opcodes and as I was reading the
manual, I saw that, these opcodes have different seeding options (for
eg:
seed = 0, means seed from current time and it makes it run differently
every
time) and I understand that.

I also learned that, in the score file,  one could use the ~ (tilde)
operator instead of < operator for 'randomized' ramping between a range
of
values in a p-field. I was wondering, if there is some sort of seeding
options (for eg: seeding from the clock) available for this tilde
operator,
so that the random picking of values in this range is actually different
every time.

Now when I use the ~ operator and run the .csd file,  everytime, the
random
numbers generated are the same, which is not helping 'randomization' at
all..:)

Would be great if someone can help me out!

Thank you very much.

Yours sincerely
Deepak.

--
www.myspace.com/dcompanymusic
www.myspace.com/thewoodshedmusicians


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"




--
www.myspace.com/dcompanymusic
www.myspace.com/thewoodshedmusicians



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp


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"



Date2012-03-09 13:17
FromDeepak
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
Thank you very much Oeyvind for the help..It makes sense to me. Although I knew about score generation from within another instrument, I have not tried implementing it yet, which is why I did not think of it that way...

So it seems like, if one wants to do 'crazy' things with the note list itself, there is no way one can do it from within the score file, but one will have to use another instrument for it...Or is there still a way, but is it too complicated? I am just curious about what is possible and what is not in a score file.

Thank you very much
Deepak.


On Fri, Mar 9, 2012 at 2:59 AM, Dr. Richard Boulanger <rboulanger@berklee.edu> wrote:
Thanks Oeyvind for sharing this with him / us. 

-dB
___________________________________

Dr. Richard Boulanger, Ph.D.

Professor of Electronic Production and Design
Professional Writing and Music Technology Division
Berklee College of Music
1140 Boylston Street
Boston, MA 02215-3693

617-747-2485 (office)
774-488-9166 (cell)

____________________________________

____________________________________

____________________________________

On Mar 9, 2012, at 2:51 AM, Oeyvind Brandtsegg wrote:

Welcome Deepak,

As you probably know there can be many different ways to approach
this. For me, I'd think it simpler to generate the instrument events
from within another instrument, instead of using the score. So the
score would just start the "even generating" instrument once, and keep
it running for as long as the sequence lasts.

Here's a simple csd for this kind of thing. It uses the event opcode
to generate instr events on instr 31, and as an example generates
random note numbers in a specified range.
You could easily extend the random generation to other parameters, and
replace the random generator with other methods of number generation.
If you want "random within a movable range" replace the iLow and iHigh
varaibles with k-rate equivalents (kLow, kHigh) and use e.g. line
opcodes to automate the desired changes in range.

best
Oeyvind


<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 256
nchnls = 2
0dbfs = 1

giSine ftgen 0, 0, 65537, 10, 1

;*********************************************************************
; generate a melody with random note numbers
;*********************************************************************
instr 2
iLow = p4 ; lowest note for random selection
iHigh = p5 ; highest note for random selection
kbpm = p6 ; tempo in beats per minute
ktempo = kbpm/60 ; tempo in ticks per second
kTrig metro ktempo ; generate metronome pulse
if kTrig == 0 kgoto done
kNote rnd31 1, 1 ; random note
kNote = int(kNote*(iHigh-iLow)  )+iLow ; scale and transpose to
the desired range, skip the int() if you want microtonal intervals
kDur = (1/ktempo) * 0.9 ; here, note duration is 90% of the time
until the next note
kAmp = -15 ; amp in decibel
instrNum = 31 ; instrument to be triggered
event "i", instrNum, 0, kDur, kAmp, kNote
done:
endin
;*********************************************************************
;***************************************************
; sine wave instrument
;***************************************************
instr 31

; input parameters
iamp = ampdbfs(p4) ; amp in dB, relative to 0dbfs
iNote = p5 ; p5 used as "midi note number"
print iNote
icps = cpsmidinn(iNote) ; get cps from midi note number

; envelope
iAttack = 0.005
iDecay = 0.3
iSustain = 0.3
iRelease = 0.1
amp madsr iAttack, iDecay, iSustain, iRelease

; audio generator
a1 oscil3 amp*iamp, icps, giSine

outch 1, a1, 2, a1

endin
;*********************************************************************

</CsInstruments>
<CsScore>
; start dur low high bpm
i2 0 8 60 72 160

e
</CsScore>
</CsoundSynthesizer>




2012/3/9 Deepak <musicmagic@gmail.com>:
Hi...

The thought of having random p2 and p3 have occurred to me too...So as to
incorporate aleatoric elements in the 'performance' of the piece....and that
would be really cool and produce some interesting musical textures and
possibilities...As I mentioned, I am an absolute beginner, who started doing
Csound, 2 months ago...I come from more of a traditional composition
background....So I am still in the beginning stages of learning and
exploring...I will look into what you suggested and am excited to see what
others have to say too...:)

thanks
Deepak.





On Fri, Mar 9, 2012 at 1:28 AM, David Akbari <dakbari@gmail.com> wrote:

Hi Deepak,

Thanks for your email. I seem to recall an example addressing an issue
similar to this from either The Csound Book or the Csound Catalog.

As I recall, the technique was using event generating instruments and
some kind of if/ kgoto to check and change the random upper and lower
bounds on each instrument pass; supplying the random values in a
p-field other than p2 or p3 (would you really want random durations?
Maybe.)

If you really wanted to go nuts on getting a random seed from outer
space I think it would be cool to use the 'system' opcode (runs a
shell inside Csound) to then use your system's native `urand` etc.

I'll have a look in the next few days to see if I can't find the
instrument I'm thinking of or at least an example of an event
generating instrument supplying new random seeds to p-fields.

You could even just make a global variable that increments and never
resets but is used in conjunction with the modulous operator with its
own operand to constrain your values dynamically for a similar effect.
It's really a hoot to do this kind of thing in Max/MSP or Pd for MIDI
values.

gkval = ksomething % kboundary
ksomething = ksomething + krandomincrement
p8 = ksomething


etc

This has some possible drawbacks to a programmer but to a musician
this is the type of thinking that can make novel results happen.

Best of luck in your search!


-David



On Thu, Mar 8, 2012 at 11:55 PM, Deepak <musicmagic@gmail.com> wrote:
Hi everyone...

I am Deepak Gopinath, and I am one of Dr. B's students at Berklee right
now.
When it comes to Csound, I am a newbie and this is in fact my first
email to
the Csound list.

I have been exploring the various rand opcodes and as I was reading the
manual, I saw that, these opcodes have different seeding options (for
eg:
seed = 0, means seed from current time and it makes it run differently
every
time) and I understand that.

I also learned that, in the score file,  one could use the ~ (tilde)
operator instead of < operator for 'randomized' ramping between a range
of
values in a p-field. I was wondering, if there is some sort of seeding
options (for eg: seeding from the clock) available for this tilde
operator,
so that the random picking of values in this range is actually different
every time.

Now when I use the ~ operator and run the .csd file,  everytime, the
random
numbers generated are the same, which is not helping 'randomization' at
all..:)

Would be great if someone can help me out!

Thank you very much.

Yours sincerely
Deepak.

--
www.myspace.com/dcompanymusic
www.myspace.com/thewoodshedmusicians


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"




--
www.myspace.com/dcompanymusic
www.myspace.com/thewoodshedmusicians



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp


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"





--
www.myspace.com/dcompanymusic
www.myspace.com/thewoodshedmusicians

Date2012-03-09 13:54
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
I think the score is best suited for a more stable collection of events,
you can do some processing as you know, but what if "crazy things" for
example means adding or deleting events? Then you'd have to find
another way to do it anyway :-)

and btw. I recall that some of my students needed help to modify my
previous example so that you can randomize/control the timing of event
generation, so here's an excerpt to do that:

        ktempo          init 1
         ; initialize tempo to 1 (will be continuously overwritten)
	kTrig           metro ktempo
  ; generate metronome pulse
        if kTrig == 0 kgoto done
	kNote		rnd31 1, 1						; random note
	ktempo           rnd31 1, 1
  ; random tempo
        ktempo       = ((ktempo+1)*2) + 2 					; tempo is random
between 1 and 5 beats per second

best
Oeyvind

2012/3/9 Deepak :
> Thank you very much Oeyvind for the help..It makes sense to me. Although I
> knew about score generation from within another instrument, I have not tried
> implementing it yet, which is why I did not think of it that way...
>
> So it seems like, if one wants to do 'crazy' things with the note list
> itself, there is no way one can do it from within the score file, but one
> will have to use another instrument for it...Or is there still a way, but is
> it too complicated? I am just curious about what is possible and what is not
> in a score file.
>
> Thank you very much
> Deepak.
>
>
>
> On Fri, Mar 9, 2012 at 2:59 AM, Dr. Richard Boulanger
>  wrote:
>>
>> Thanks Oeyvind for sharing this with him / us.
>>
>> -dB
>> ___________________________________
>>
>> Dr. Richard Boulanger, Ph.D.
>>
>> Professor of Electronic Production and Design
>> Professional Writing and Music Technology Division
>> Berklee College of Music
>> 1140 Boylston Street
>> Boston, MA 02215-3693
>>
>> 617-747-2485 (office)
>> 774-488-9166 (cell)
>>
>> rboulanger@berklee.edu
>> http://csounds.com/boulanger
>> ____________________________________
>>
>> http://csounds.com
>> http://csoundforlive.com
>> ____________________________________
>>
>> http://csounds.com/mathews
>> ____________________________________
>>
>> On Mar 9, 2012, at 2:51 AM, Oeyvind Brandtsegg wrote:
>>
>> Welcome Deepak,
>>
>> As you probably know there can be many different ways to approach
>> this. For me, I'd think it simpler to generate the instrument events
>> from within another instrument, instead of using the score. So the
>> score would just start the "even generating" instrument once, and keep
>> it running for as long as the sequence lasts.
>>
>> Here's a simple csd for this kind of thing. It uses the event opcode
>> to generate instr events on instr 31, and as an example generates
>> random note numbers in a specified range.
>> You could easily extend the random generation to other parameters, and
>> replace the random generator with other methods of number generation.
>> If you want "random within a movable range" replace the iLow and iHigh
>> varaibles with k-rate equivalents (kLow, kHigh) and use e.g. line
>> opcodes to automate the desired changes in range.
>>
>> best
>> Oeyvind
>>
>>
>> 
>> 
>> 
>> 
>>
>> sr = 44100
>> ksmps = 256
>> nchnls = 2
>> 0dbfs = 1
>>
>> giSine ftgen 0, 0, 65537, 10, 1
>>
>> ;*********************************************************************
>> ; generate a melody with random note numbers
>> ;*********************************************************************
>> instr 2
>> iLow = p4 ; lowest note for random selection
>> iHigh = p5 ; highest note for random selection
>> kbpm = p6 ; tempo in beats per minute
>> ktempo = kbpm/60 ; tempo in ticks per second
>> kTrig metro ktempo ; generate metronome pulse
>> if kTrig == 0 kgoto done
>> kNote rnd31 1, 1 ; random note
>> kNote = int(kNote*(iHigh-iLow)  )+iLow ; scale and transpose to
>> the desired range, skip the int() if you want microtonal intervals
>> kDur = (1/ktempo) * 0.9 ; here, note duration is 90% of the time
>> until the next note
>> kAmp = -15 ; amp in decibel
>> instrNum = 31 ; instrument to be triggered
>> event "i", instrNum, 0, kDur, kAmp, kNote
>> done:
>> endin
>> ;*********************************************************************
>> ;***************************************************
>> ; sine wave instrument
>> ;***************************************************
>> instr 31
>>
>> ; input parameters
>> iamp = ampdbfs(p4) ; amp in dB, relative to 0dbfs
>> iNote = p5 ; p5 used as "midi note number"
>> print iNote
>> icps = cpsmidinn(iNote) ; get cps from midi note number
>>
>> ; envelope
>> iAttack = 0.005
>> iDecay = 0.3
>> iSustain = 0.3
>> iRelease = 0.1
>> amp madsr iAttack, iDecay, iSustain, iRelease
>>
>> ; audio generator
>> a1 oscil3 amp*iamp, icps, giSine
>>
>> outch 1, a1, 2, a1
>>
>> endin
>> ;*********************************************************************
>>
>> 
>> 
>> ; start dur low high bpm
>> i2 0 8 60 72 160
>>
>> e
>> 
>> 
>>
>>
>>
>>
>> 2012/3/9 Deepak :
>>
>> Hi...
>>
>>
>> The thought of having random p2 and p3 have occurred to me too...So as to
>>
>> incorporate aleatoric elements in the 'performance' of the piece....and
>> that
>>
>> would be really cool and produce some interesting musical textures and
>>
>> possibilities...As I mentioned, I am an absolute beginner, who started
>> doing
>>
>> Csound, 2 months ago...I come from more of a traditional composition
>>
>> background....So I am still in the beginning stages of learning and
>>
>> exploring...I will look into what you suggested and am excited to see what
>>
>> others have to say too...:)
>>
>>
>> thanks
>>
>> Deepak.
>>
>>
>>
>>
>>
>>
>> On Fri, Mar 9, 2012 at 1:28 AM, David Akbari  wrote:
>>
>>
>> Hi Deepak,
>>
>>
>> Thanks for your email. I seem to recall an example addressing an issue
>>
>> similar to this from either The Csound Book or the Csound Catalog.
>>
>>
>> As I recall, the technique was using event generating instruments and
>>
>> some kind of if/ kgoto to check and change the random upper and lower
>>
>> bounds on each instrument pass; supplying the random values in a
>>
>> p-field other than p2 or p3 (would you really want random durations?
>>
>> Maybe.)
>>
>>
>> If you really wanted to go nuts on getting a random seed from outer
>>
>> space I think it would be cool to use the 'system' opcode (runs a
>>
>> shell inside Csound) to then use your system's native `urand` etc.
>>
>>
>> I'll have a look in the next few days to see if I can't find the
>>
>> instrument I'm thinking of or at least an example of an event
>>
>> generating instrument supplying new random seeds to p-fields.
>>
>>
>> You could even just make a global variable that increments and never
>>
>> resets but is used in conjunction with the modulous operator with its
>>
>> own operand to constrain your values dynamically for a similar effect.
>>
>> It's really a hoot to do this kind of thing in Max/MSP or Pd for MIDI
>>
>> values.
>>
>>
>> gkval = ksomething % kboundary
>>
>> ksomething = ksomething + krandomincrement
>>
>> p8 = ksomething
>>
>>
>>
>> etc
>>
>>
>> This has some possible drawbacks to a programmer but to a musician
>>
>> this is the type of thinking that can make novel results happen.
>>
>>
>> Best of luck in your search!
>>
>>
>>
>> -David
>>
>>
>>
>>
>> On Thu, Mar 8, 2012 at 11:55 PM, Deepak  wrote:
>>
>> Hi everyone...
>>
>>
>> I am Deepak Gopinath, and I am one of Dr. B's students at Berklee right
>>
>> now.
>>
>> When it comes to Csound, I am a newbie and this is in fact my first
>>
>> email to
>>
>> the Csound list.
>>
>>
>> I have been exploring the various rand opcodes and as I was reading the
>>
>> manual, I saw that, these opcodes have different seeding options (for
>>
>> eg:
>>
>> seed = 0, means seed from current time and it makes it run differently
>>
>> every
>>
>> time) and I understand that.
>>
>>
>> I also learned that, in the score file,  one could use the ~ (tilde)
>>
>> operator instead of < operator for 'randomized' ramping between a range
>>
>> of
>>
>> values in a p-field. I was wondering, if there is some sort of seeding
>>
>> options (for eg: seeding from the clock) available for this tilde
>>
>> operator,
>>
>> so that the random picking of values in this range is actually different
>>
>> every time.
>>
>>
>> Now when I use the ~ operator and run the .csd file,  everytime, the
>>
>> random
>>
>> numbers generated are the same, which is not helping 'randomization' at
>>
>> all..:)
>>
>>
>> Would be great if someone can help me out!
>>
>>
>> Thank you very much.
>>
>>
>> Yours sincerely
>>
>> Deepak.
>>
>>
>> --
>>
>> www.myspace.com/dcompanymusic
>>
>> www.myspace.com/thewoodshedmusicians
>>
>>
>>
>> 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"
>>
>>
>>
>>
>>
>> --
>>
>> www.myspace.com/dcompanymusic
>>
>> www.myspace.com/thewoodshedmusicians
>>
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://flyndresang.no/
>> http://www.partikkelaudio.com/
>> http://soundcloud.com/brandtsegg
>> http://soundcloud.com/t-emp
>>
>>
>> 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"
>>
>>
>
>
>
> --
> www.myspace.com/dcompanymusic
> www.myspace.com/thewoodshedmusicians



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp


Date2012-03-09 14:21
FromDeepak
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file

I think it makes things clearer for me...
Thank you once again!

- Deepak.




On Fri, Mar 9, 2012 at 8:54 AM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
I think the score is best suited for a more stable collection of events,
you can do some processing as you know, but what if "crazy things" for
example means adding or deleting events? Then you'd have to find
another way to do it anyway :-)

and btw. I recall that some of my students needed help to modify my
previous example so that you can randomize/control the timing of event
generation, so here's an excerpt to do that:

       ktempo          init 1
        ; initialize tempo to 1 (will be continuously overwritten)
       kTrig           metro ktempo
 ; generate metronome pulse
       if kTrig == 0 kgoto done
       kNote           rnd31 1, 1                                              ; random note
       ktempo           rnd31 1, 1
 ; random tempo
       ktempo       = ((ktempo+1)*2) + 2                                       ; tempo is random
between 1 and 5 beats per second

best
Oeyvind

2012/3/9 Deepak <musicmagic@gmail.com>:
> Thank you very much Oeyvind for the help..It makes sense to me. Although I
> knew about score generation from within another instrument, I have not tried
> implementing it yet, which is why I did not think of it that way...
>
> So it seems like, if one wants to do 'crazy' things with the note list
> itself, there is no way one can do it from within the score file, but one
> will have to use another instrument for it...Or is there still a way, but is
> it too complicated? I am just curious about what is possible and what is not
> in a score file.
>
> Thank you very much
> Deepak.
>
>
>
> On Fri, Mar 9, 2012 at 2:59 AM, Dr. Richard Boulanger
> <rboulanger@berklee.edu> wrote:
>>
>> Thanks Oeyvind for sharing this with him / us.
>>
>> -dB
>> ___________________________________
>>
>> Dr. Richard Boulanger, Ph.D.
>>
>> Professor of Electronic Production and Design
>> Professional Writing and Music Technology Division
>> Berklee College of Music
>> 1140 Boylston Street
>> Boston, MA 02215-3693
>>
>> 617-747-2485 (office)
>> 774-488-9166 (cell)
>>
>> rboulanger@berklee.edu
>> http://csounds.com/boulanger
>> ____________________________________
>>
>> http://csounds.com
>> http://csoundforlive.com
>> ____________________________________
>>
>> http://csounds.com/mathews
>> ____________________________________
>>
>> On Mar 9, 2012, at 2:51 AM, Oeyvind Brandtsegg wrote:
>>
>> Welcome Deepak,
>>
>> As you probably know there can be many different ways to approach
>> this. For me, I'd think it simpler to generate the instrument events
>> from within another instrument, instead of using the score. So the
>> score would just start the "even generating" instrument once, and keep
>> it running for as long as the sequence lasts.
>>
>> Here's a simple csd for this kind of thing. It uses the event opcode
>> to generate instr events on instr 31, and as an example generates
>> random note numbers in a specified range.
>> You could easily extend the random generation to other parameters, and
>> replace the random generator with other methods of number generation.
>> If you want "random within a movable range" replace the iLow and iHigh
>> varaibles with k-rate equivalents (kLow, kHigh) and use e.g. line
>> opcodes to automate the desired changes in range.
>>
>> best
>> Oeyvind
>>
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 256
>> nchnls = 2
>> 0dbfs = 1
>>
>> giSine ftgen 0, 0, 65537, 10, 1
>>
>> ;*********************************************************************
>> ; generate a melody with random note numbers
>> ;*********************************************************************
>> instr 2
>> iLow = p4 ; lowest note for random selection
>> iHigh = p5 ; highest note for random selection
>> kbpm = p6 ; tempo in beats per minute
>> ktempo = kbpm/60 ; tempo in ticks per second
>> kTrig metro ktempo ; generate metronome pulse
>> if kTrig == 0 kgoto done
>> kNote rnd31 1, 1 ; random note
>> kNote = int(kNote*(iHigh-iLow)  )+iLow ; scale and transpose to
>> the desired range, skip the int() if you want microtonal intervals
>> kDur = (1/ktempo) * 0.9 ; here, note duration is 90% of the time
>> until the next note
>> kAmp = -15 ; amp in decibel
>> instrNum = 31 ; instrument to be triggered
>> event "i", instrNum, 0, kDur, kAmp, kNote
>> done:
>> endin
>> ;*********************************************************************
>> ;***************************************************
>> ; sine wave instrument
>> ;***************************************************
>> instr 31
>>
>> ; input parameters
>> iamp = ampdbfs(p4) ; amp in dB, relative to 0dbfs
>> iNote = p5 ; p5 used as "midi note number"
>> print iNote
>> icps = cpsmidinn(iNote) ; get cps from midi note number
>>
>> ; envelope
>> iAttack = 0.005
>> iDecay = 0.3
>> iSustain = 0.3
>> iRelease = 0.1
>> amp madsr iAttack, iDecay, iSustain, iRelease
>>
>> ; audio generator
>> a1 oscil3 amp*iamp, icps, giSine
>>
>> outch 1, a1, 2, a1
>>
>> endin
>> ;*********************************************************************
>>
>> </CsInstruments>
>> <CsScore>
>> ; start dur low high bpm
>> i2 0 8 60 72 160
>>
>> e
>> </CsScore>
>> </CsoundSynthesizer>
>>
>>
>>
>>
>> 2012/3/9 Deepak <musicmagic@gmail.com>:
>>
>> Hi...
>>
>>
>> The thought of having random p2 and p3 have occurred to me too...So as to
>>
>> incorporate aleatoric elements in the 'performance' of the piece....and
>> that
>>
>> would be really cool and produce some interesting musical textures and
>>
>> possibilities...As I mentioned, I am an absolute beginner, who started
>> doing
>>
>> Csound, 2 months ago...I come from more of a traditional composition
>>
>> background....So I am still in the beginning stages of learning and
>>
>> exploring...I will look into what you suggested and am excited to see what
>>
>> others have to say too...:)
>>
>>
>> thanks
>>
>> Deepak.
>>
>>
>>
>>
>>
>>
>> On Fri, Mar 9, 2012 at 1:28 AM, David Akbari <dakbari@gmail.com> wrote:
>>
>>
>> Hi Deepak,
>>
>>
>> Thanks for your email. I seem to recall an example addressing an issue
>>
>> similar to this from either The Csound Book or the Csound Catalog.
>>
>>
>> As I recall, the technique was using event generating instruments and
>>
>> some kind of if/ kgoto to check and change the random upper and lower
>>
>> bounds on each instrument pass; supplying the random values in a
>>
>> p-field other than p2 or p3 (would you really want random durations?
>>
>> Maybe.)
>>
>>
>> If you really wanted to go nuts on getting a random seed from outer
>>
>> space I think it would be cool to use the 'system' opcode (runs a
>>
>> shell inside Csound) to then use your system's native `urand` etc.
>>
>>
>> I'll have a look in the next few days to see if I can't find the
>>
>> instrument I'm thinking of or at least an example of an event
>>
>> generating instrument supplying new random seeds to p-fields.
>>
>>
>> You could even just make a global variable that increments and never
>>
>> resets but is used in conjunction with the modulous operator with its
>>
>> own operand to constrain your values dynamically for a similar effect.
>>
>> It's really a hoot to do this kind of thing in Max/MSP or Pd for MIDI
>>
>> values.
>>
>>
>> gkval = ksomething % kboundary
>>
>> ksomething = ksomething + krandomincrement
>>
>> p8 = ksomething
>>
>>
>>
>> etc
>>
>>
>> This has some possible drawbacks to a programmer but to a musician
>>
>> this is the type of thinking that can make novel results happen.
>>
>>
>> Best of luck in your search!
>>
>>
>>
>> -David
>>
>>
>>
>>
>> On Thu, Mar 8, 2012 at 11:55 PM, Deepak <musicmagic@gmail.com> wrote:
>>
>> Hi everyone...
>>
>>
>> I am Deepak Gopinath, and I am one of Dr. B's students at Berklee right
>>
>> now.
>>
>> When it comes to Csound, I am a newbie and this is in fact my first
>>
>> email to
>>
>> the Csound list.
>>
>>
>> I have been exploring the various rand opcodes and as I was reading the
>>
>> manual, I saw that, these opcodes have different seeding options (for
>>
>> eg:
>>
>> seed = 0, means seed from current time and it makes it run differently
>>
>> every
>>
>> time) and I understand that.
>>
>>
>> I also learned that, in the score file,  one could use the ~ (tilde)
>>
>> operator instead of < operator for 'randomized' ramping between a range
>>
>> of
>>
>> values in a p-field. I was wondering, if there is some sort of seeding
>>
>> options (for eg: seeding from the clock) available for this tilde
>>
>> operator,
>>
>> so that the random picking of values in this range is actually different
>>
>> every time.
>>
>>
>> Now when I use the ~ operator and run the .csd file,  everytime, the
>>
>> random
>>
>> numbers generated are the same, which is not helping 'randomization' at
>>
>> all..:)
>>
>>
>> Would be great if someone can help me out!
>>
>>
>> Thank you very much.
>>
>>
>> Yours sincerely
>>
>> Deepak.
>>
>>
>> --
>>
>> www.myspace.com/dcompanymusic
>>
>> www.myspace.com/thewoodshedmusicians
>>
>>
>>
>> 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"
>>
>>
>>
>>
>>
>> --
>>
>> www.myspace.com/dcompanymusic
>>
>> www.myspace.com/thewoodshedmusicians
>>
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://flyndresang.no/
>> http://www.partikkelaudio.com/
>> http://soundcloud.com/brandtsegg
>> http://soundcloud.com/t-emp
>>
>>
>> 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"
>>
>>
>
>
>
> --
> www.myspace.com/dcompanymusic
> www.myspace.com/thewoodshedmusicians



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp


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"




--
www.myspace.com/dcompanymusic
www.myspace.com/thewoodshedmusicians

Date2012-03-09 15:56
FromAdam Puckett
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
I suggest Cscore. Or a scripting language with text processing
functions, e.g. perl
(http://csounds.com/journal/issue5/perlCsound.html). The disadvantage
of using these languages is the fact you have to regenerate the score
for different values.

There is no "easy way" to do it, unfortunately for newbies. Csound is
one of those things you have to put deep thought into before you can
get something "crazy" going on. (I'd be willing to contribute more
"hip hop" type examples if anyone's interested, 'cause that's how
commercial products are demoed, and Csound should be more appealing in
that respect).

On 3/9/12, Deepak  wrote:
> I think it makes things clearer for me...
> Thank you once again!
>
> - Deepak.
>
>
>
>
> On Fri, Mar 9, 2012 at 8:54 AM, Oeyvind Brandtsegg <
> oyvind.brandtsegg@ntnu.no> wrote:
>
>> I think the score is best suited for a more stable collection of events,
>> you can do some processing as you know, but what if "crazy things" for
>> example means adding or deleting events? Then you'd have to find
>> another way to do it anyway :-)
>>
>> and btw. I recall that some of my students needed help to modify my
>> previous example so that you can randomize/control the timing of event
>> generation, so here's an excerpt to do that:
>>
>>        ktempo          init 1
>>         ; initialize tempo to 1 (will be continuously overwritten)
>>         kTrig           metro ktempo
>>  ; generate metronome pulse
>>        if kTrig == 0 kgoto done
>>        kNote           rnd31 1, 1
>>      ; random note
>>         ktempo           rnd31 1, 1
>>  ; random tempo
>>        ktempo       = ((ktempo+1)*2) + 2
>>     ; tempo is random
>> between 1 and 5 beats per second
>>
>> best
>> Oeyvind
>>
>> 2012/3/9 Deepak :
>> > Thank you very much Oeyvind for the help..It makes sense to me. Although
>> I
>> > knew about score generation from within another instrument, I have not
>> tried
>> > implementing it yet, which is why I did not think of it that way...
>> >
>> > So it seems like, if one wants to do 'crazy' things with the note list
>> > itself, there is no way one can do it from within the score file, but
>> > one
>> > will have to use another instrument for it...Or is there still a way,
>> but is
>> > it too complicated? I am just curious about what is possible and what is
>> not
>> > in a score file.
>> >
>> > Thank you very much
>> > Deepak.
>> >
>> >
>> >
>> > On Fri, Mar 9, 2012 at 2:59 AM, Dr. Richard Boulanger
>> >  wrote:
>> >>
>> >> Thanks Oeyvind for sharing this with him / us.
>> >>
>> >> -dB
>> >> ___________________________________
>> >>
>> >> Dr. Richard Boulanger, Ph.D.
>> >>
>> >> Professor of Electronic Production and Design
>> >> Professional Writing and Music Technology Division
>> >> Berklee College of Music
>> >> 1140 Boylston Street
>> >> Boston, MA 02215-3693
>> >>
>> >> 617-747-2485 (office)
>> >> 774-488-9166 (cell)
>> >>
>> >> rboulanger@berklee.edu
>> >> http://csounds.com/boulanger
>> >> ____________________________________
>> >>
>> >> http://csounds.com
>> >> http://csoundforlive.com
>> >> ____________________________________
>> >>
>> >> http://csounds.com/mathews
>> >> ____________________________________
>> >>
>> >> On Mar 9, 2012, at 2:51 AM, Oeyvind Brandtsegg wrote:
>> >>
>> >> Welcome Deepak,
>> >>
>> >> As you probably know there can be many different ways to approach
>> >> this. For me, I'd think it simpler to generate the instrument events
>> >> from within another instrument, instead of using the score. So the
>> >> score would just start the "even generating" instrument once, and keep
>> >> it running for as long as the sequence lasts.
>> >>
>> >> Here's a simple csd for this kind of thing. It uses the event opcode
>> >> to generate instr events on instr 31, and as an example generates
>> >> random note numbers in a specified range.
>> >> You could easily extend the random generation to other parameters, and
>> >> replace the random generator with other methods of number generation.
>> >> If you want "random within a movable range" replace the iLow and iHigh
>> >> varaibles with k-rate equivalents (kLow, kHigh) and use e.g. line
>> >> opcodes to automate the desired changes in range.
>> >>
>> >> best
>> >> Oeyvind
>> >>
>> >>
>> >> 
>> >> 
>> >> 
>> >> 
>> >>
>> >> sr = 44100
>> >> ksmps = 256
>> >> nchnls = 2
>> >> 0dbfs = 1
>> >>
>> >> giSine ftgen 0, 0, 65537, 10, 1
>> >>
>> >> ;*********************************************************************
>> >> ; generate a melody with random note numbers
>> >> ;*********************************************************************
>> >> instr 2
>> >> iLow = p4 ; lowest note for random selection
>> >> iHigh = p5 ; highest note for random selection
>> >> kbpm = p6 ; tempo in beats per minute
>> >> ktempo = kbpm/60 ; tempo in ticks per second
>> >> kTrig metro ktempo ; generate metronome pulse
>> >> if kTrig == 0 kgoto done
>> >> kNote rnd31 1, 1 ; random note
>> >> kNote = int(kNote*(iHigh-iLow)  )+iLow ; scale and transpose to
>> >> the desired range, skip the int() if you want microtonal intervals
>> >> kDur = (1/ktempo) * 0.9 ; here, note duration is 90% of the time
>> >> until the next note
>> >> kAmp = -15 ; amp in decibel
>> >> instrNum = 31 ; instrument to be triggered
>> >> event "i", instrNum, 0, kDur, kAmp, kNote
>> >> done:
>> >> endin
>> >> ;*********************************************************************
>> >> ;***************************************************
>> >> ; sine wave instrument
>> >> ;***************************************************
>> >> instr 31
>> >>
>> >> ; input parameters
>> >> iamp = ampdbfs(p4) ; amp in dB, relative to 0dbfs
>> >> iNote = p5 ; p5 used as "midi note number"
>> >> print iNote
>> >> icps = cpsmidinn(iNote) ; get cps from midi note number
>> >>
>> >> ; envelope
>> >> iAttack = 0.005
>> >> iDecay = 0.3
>> >> iSustain = 0.3
>> >> iRelease = 0.1
>> >> amp madsr iAttack, iDecay, iSustain, iRelease
>> >>
>> >> ; audio generator
>> >> a1 oscil3 amp*iamp, icps, giSine
>> >>
>> >> outch 1, a1, 2, a1
>> >>
>> >> endin
>> >> ;*********************************************************************
>> >>
>> >> 
>> >> 
>> >> ; start dur low high bpm
>> >> i2 0 8 60 72 160
>> >>
>> >> e
>> >> 
>> >> 
>> >>
>> >>
>> >>
>> >>
>> >> 2012/3/9 Deepak :
>> >>
>> >> Hi...
>> >>
>> >>
>> >> The thought of having random p2 and p3 have occurred to me too...So as
>> to
>> >>
>> >> incorporate aleatoric elements in the 'performance' of the piece....and
>> >> that
>> >>
>> >> would be really cool and produce some interesting musical textures and
>> >>
>> >> possibilities...As I mentioned, I am an absolute beginner, who started
>> >> doing
>> >>
>> >> Csound, 2 months ago...I come from more of a traditional composition
>> >>
>> >> background....So I am still in the beginning stages of learning and
>> >>
>> >> exploring...I will look into what you suggested and am excited to see
>> what
>> >>
>> >> others have to say too...:)
>> >>
>> >>
>> >> thanks
>> >>
>> >> Deepak.
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Fri, Mar 9, 2012 at 1:28 AM, David Akbari  wrote:
>> >>
>> >>
>> >> Hi Deepak,
>> >>
>> >>
>> >> Thanks for your email. I seem to recall an example addressing an issue
>> >>
>> >> similar to this from either The Csound Book or the Csound Catalog.
>> >>
>> >>
>> >> As I recall, the technique was using event generating instruments and
>> >>
>> >> some kind of if/ kgoto to check and change the random upper and lower
>> >>
>> >> bounds on each instrument pass; supplying the random values in a
>> >>
>> >> p-field other than p2 or p3 (would you really want random durations?
>> >>
>> >> Maybe.)
>> >>
>> >>
>> >> If you really wanted to go nuts on getting a random seed from outer
>> >>
>> >> space I think it would be cool to use the 'system' opcode (runs a
>> >>
>> >> shell inside Csound) to then use your system's native `urand` etc.
>> >>
>> >>
>> >> I'll have a look in the next few days to see if I can't find the
>> >>
>> >> instrument I'm thinking of or at least an example of an event
>> >>
>> >> generating instrument supplying new random seeds to p-fields.
>> >>
>> >>
>> >> You could even just make a global variable that increments and never
>> >>
>> >> resets but is used in conjunction with the modulous operator with its
>> >>
>> >> own operand to constrain your values dynamically for a similar effect.
>> >>
>> >> It's really a hoot to do this kind of thing in Max/MSP or Pd for MIDI
>> >>
>> >> values.
>> >>
>> >>
>> >> gkval = ksomething % kboundary
>> >>
>> >> ksomething = ksomething + krandomincrement
>> >>
>> >> p8 = ksomething
>> >>
>> >>
>> >>
>> >> etc
>> >>
>> >>
>> >> This has some possible drawbacks to a programmer but to a musician
>> >>
>> >> this is the type of thinking that can make novel results happen.
>> >>
>> >>
>> >> Best of luck in your search!
>> >>
>> >>
>> >>
>> >> -David
>> >>
>> >>
>> >>
>> >>
>> >> On Thu, Mar 8, 2012 at 11:55 PM, Deepak  wrote:
>> >>
>> >> Hi everyone...
>> >>
>> >>
>> >> I am Deepak Gopinath, and I am one of Dr. B's students at Berklee right
>> >>
>> >> now.
>> >>
>> >> When it comes to Csound, I am a newbie and this is in fact my first
>> >>
>> >> email to
>> >>
>> >> the Csound list.
>> >>
>> >>
>> >> I have been exploring the various rand opcodes and as I was reading the
>> >>
>> >> manual, I saw that, these opcodes have different seeding options (for
>> >>
>> >> eg:
>> >>
>> >> seed = 0, means seed from current time and it makes it run differently
>> >>
>> >> every
>> >>
>> >> time) and I understand that.
>> >>
>> >>
>> >> I also learned that, in the score file,  one could use the ~ (tilde)
>> >>
>> >> operator instead of < operator for 'randomized' ramping between a range
>> >>
>> >> of
>> >>
>> >> values in a p-field. I was wondering, if there is some sort of seeding
>> >>
>> >> options (for eg: seeding from the clock) available for this tilde
>> >>
>> >> operator,
>> >>
>> >> so that the random picking of values in this range is actually
>> >> different
>> >>
>> >> every time.
>> >>
>> >>
>> >> Now when I use the ~ operator and run the .csd file,  everytime, the
>> >>
>> >> random
>> >>
>> >> numbers generated are the same, which is not helping 'randomization' at
>> >>
>> >> all..:)
>> >>
>> >>
>> >> Would be great if someone can help me out!
>> >>
>> >>
>> >> Thank you very much.
>> >>
>> >>
>> >> Yours sincerely
>> >>
>> >> Deepak.
>> >>
>> >>
>> >> --
>> >>
>> >> www.myspace.com/dcompanymusic
>> >>
>> >> www.myspace.com/thewoodshedmusicians
>> >>
>> >>
>> >>
>> >> 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"
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> www.myspace.com/dcompanymusic
>> >>
>> >> www.myspace.com/thewoodshedmusicians
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Oeyvind Brandtsegg
>> >> Professor of Music Technology
>> >> NTNU
>> >> 7491 Trondheim
>> >> Norway
>> >> Cell: +47 92 203 205
>> >>
>> >> http://flyndresang.no/
>> >> http://www.partikkelaudio.com/
>> >> http://soundcloud.com/brandtsegg
>> >> http://soundcloud.com/t-emp
>> >>
>> >>
>> >> 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"
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > www.myspace.com/dcompanymusic
>> > www.myspace.com/thewoodshedmusicians
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://flyndresang.no/
>> http://www.partikkelaudio.com/
>> http://soundcloud.com/brandtsegg
>> http://soundcloud.com/t-emp
>>
>>
>> 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"
>>
>>
>
>
> --
> www.myspace.com/dcompanymusic
> www.myspace.com/thewoodshedmusicians
>
> 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"
>
>

Date2012-03-10 17:38
FromTito Latini
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-12 11:49
Fromjoachim heintz
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
hi tito -
very cool example. i never knew about the  feature,
though it's really great for extending csound's score language to the
own needs. i just looked at
http://www.csounds.com/manual/html/CommandUnifile.html but can't find
anything about it.
is it in any way documentated? if not, it would be great to add a note,
and perhaps your example, too.
best -
	joachim

Am 10.03.2012 18:38, schrieb Tito Latini:
> I have written a simple `perl' filter usable in 
> You can set the seed in a comment, for example
> 
>   ;; SEED 123
> 
> and the random number with
> 
>   rand()
>   rand(NUM)
> 
> anywhere in the score.
> 
> # cs_sco_rand.pl
> my ($in, $out) = @ARGV;
> open(EXT, "<", $in);
> open(SCO, ">", $out);
> 
> while () {
>   s/SEED\s+(\d+)/srand($1);$&/e;
>   s/rand\(\d*\)/eval $&/ge;
>   print SCO;
> }
> 
> 
> Here is a csd file for the test
> 
> ;; score_random.csd
> 
> 
> 
> instr 1
>   prints "amp = %f, freq = %f\n", p4, p5;
> endin
> 
> 
> 
> 
> i1  0  .01  rand()   [200 + rand(30)]
> i1  +  .    rand()   [400 + rand(80)]
> i1  +  .    rand()   [600 + rand(160)]
> ;; SEED 123
> i1  +  .    rand()   [750 + rand(200)]
> i1  +  .    rand()   [210 + rand(20)]
> e
> 
> 
> 
> 
> 
> csound score_random.csd
> ...
> amp = 0.825471, freq = 217.856199
> ...
> amp = 0.628137, freq = 463.863331
> ...
> amp = 0.790931, freq = 638.330751
> ...
> amp = 0.279512, freq = 832.905816
> ...
> amp = 0.925176, freq = 212.590480
> ...
> 
> 
> PS  Only the git version of csound removes all the temp files on *nix OS
> 
> tito
> 
> 
> 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"
> 
> 

Date2012-03-12 11:58
FromTito Latini
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-12 13:47
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
> hi tito -
> very cool example. i never knew about the  feature,
> though it's really great for extending csound's score language to the
> own needs. i just looked at
> http://www.csounds.com/manual/html/CommandUnifile.html but can't find
> anything about it.
> is it in any way documentated? if not, it would be great to add a note,
> and perhaps your example, too.
> best -
> 	joachim
>
it is in the manual in  command/unifile.xml; note last paragraph


   Score (<CsScore>)
    
      Csound score statements are put in the Score Element. The statements
and syntax in this section are identical to the Csound score file, and have the same requirements. The
Score Element is delimited by the start tag <CsScore>
and the end tag </CsScore>.
    
    
      As an alternative Csound score statements can also be generated by
an external
      program using the CsScore scheme with an attribute bin. The lines
upto the closing
      tag </CsScore> are copied to a file
      and the external program named is called with that file name and
      the destination score file.  The external program should create a
      standard Csound score.
    





Date2012-03-12 15:41
Fromjoachim heintz
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
sorry, john, but i can't find this. can you provide a link at
http://www.csounds.com/manual?
thanks -
	joachim


Am 12.03.2012 14:47, schrieb jpff@cs.bath.ac.uk:
>> hi tito -
>> very cool example. i never knew about the  feature,
>> though it's really great for extending csound's score language to the
>> own needs. i just looked at
>> http://www.csounds.com/manual/html/CommandUnifile.html but can't find
>> anything about it.
>> is it in any way documentated? if not, it would be great to add a note,
>> and perhaps your example, too.
>> best -
>> 	joachim
>>
> it is in the manual in  command/unifile.xml; note last paragraph
> 
> 
>    Score (<CsScore>)
>     
>       Csound score statements are put in the Score Element. The statements
> and syntax in this section are identical to the Csound  linkend="ScoreTop"> title>score file, and have the same requirements. The
> Score Element is delimited by the start tag <CsScore>
> and the end tag </CsScore>.
>     
>     
>       As an alternative Csound score statements can also be generated by
> an external
>       program using the CsScore scheme with an attribute bin. The lines
> upto the closing
>       tag </CsScore> are copied to a file
>       and the external program named is called with that file name and
>       the destination score file.  The external program should create a
>       standard Csound score.
>     
> 
> 
> 
> 
> 
> 
> 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"
> 
> 

Date2012-03-12 16:12
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
> sorry, john, but i can't find this. can you provide a link at
> http://www.csounds.com/manual?
> thanks -
> 	joachim
>

It has been in the manual since March 2009.  Can it be that the
http://www.csounds.com/manual is so out of date

My manual says in CommandUnifile.html



Score ()

Csound score statements are put in the Score Element. The statements and
syntax in this section are identical to the Csound score file, and have
the same requirements. The Score Element is delimited by the start tag
 and the end tag .

As an alternative Csound score statements can also be generated by an
external program using the CsScore scheme with an attribute bin. The lines
upto the closing tag  are copied to a file and the external
program named is called with that file name and the destination score
file. The external program should create a standard Csound score.


Date2012-03-12 16:16
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
> sorry, john, but i can't find this. can you provide a link at
> http://www.csounds.com/manual?
> thanks -
> 	joachim

Just checked and it is in
http://www.csounds.com/manual/html/CommandUnifile.html

Immediately before Optional Elements, just like my version

==John ff


Date2012-03-12 16:58
FromJ Clements
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file

The manual at Csounds.com/manual should be the latest one. 

John

On Mar 12, 2012 12:16 PM, <jpff@cs.bath.ac.uk> wrote:
> sorry, john, but i can't find this. can you provide a link at
> http://www.csounds.com/manual?
> thanks -
>       joachim

Just checked and it is in
http://www.csounds.com/manual/html/CommandUnifile.html

Immediately before Optional Elements, just like my version

==John ff



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"


Date2012-03-12 19:25
Fromjoachim heintz
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
thanks, now i see it.
what about putting tito's example there? i think this is indeed a very
important feature, but i never had an idea reading this.
i will put in on the todo list for the floss manual.
best -
	joachim

Am 12.03.2012 17:16, schrieb jpff@cs.bath.ac.uk:
>> sorry, john, but i can't find this. can you provide a link at
>> http://www.csounds.com/manual?
>> thanks -
>> 	joachim
> 
> Just checked and it is in
> http://www.csounds.com/manual/html/CommandUnifile.html
> 
> Immediately before Optional Elements, just like my version
> 
> ==John ff
> 
> 
> 
> 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"
> 
> 

Date2012-03-12 19:29
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
> thanks, now i see it.
> what about putting tito's example there? i think this is indeed a very
> important feature, but i never had an idea reading this.
> i will put in on the todo list for the floss manual.
> best -
> 	joachim
>

Yes, whatever.  I was very suprised that no one took any notice when it
was introduced.  It was done initially for the beats (later csbeats)
langiuage, but with the intent that it would allow complex or alternative
score  generators

==John ff

PS I even had a trivial processor like cat at one time



Date2012-03-12 21:00
Fromjoachim heintz
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
i'm still trying to understand what's happening exactly. as i can't
speak pearl, it's a bit hard to me. are you perhaps able to "translate"
your example to python or bash?
thanks -
	joachim


Am 12.03.2012 12:58, schrieb Tito Latini:
> Of course but I have a bad English, not proper for a man page.
> In general, we can use every command with the syntax
> 
>   command infile outfile
> 
> where the outfile is a score file for csound.
> Feel free to use the example everywhere
> 
> tito
> 
> On Mon, Mar 12, 2012 at 12:49:10PM +0100, joachim heintz wrote:
>> hi tito -
>> very cool example. i never knew about the  feature,
>> though it's really great for extending csound's score language to the
>> own needs. i just looked at
>> http://www.csounds.com/manual/html/CommandUnifile.html but can't find
>> anything about it.
>> is it in any way documentated? if not, it would be great to add a note,
>> and perhaps your example, too.
>> best -
>> 	joachim
>>
>> Am 10.03.2012 18:38, schrieb Tito Latini:
>>> I have written a simple `perl' filter usable in 
>>> You can set the seed in a comment, for example
>>>
>>>   ;; SEED 123
>>>
>>> and the random number with
>>>
>>>   rand()
>>>   rand(NUM)
>>>
>>> anywhere in the score.
>>>
>>> # cs_sco_rand.pl
>>> my ($in, $out) = @ARGV;
>>> open(EXT, "<", $in);
>>> open(SCO, ">", $out);
>>>
>>> while () {
>>>   s/SEED\s+(\d+)/srand($1);$&/e;
>>>   s/rand\(\d*\)/eval $&/ge;
>>>   print SCO;
>>> }
>>>
>>>
>>> Here is a csd file for the test
>>>
>>> ;; score_random.csd
>>> 
>>> 
>>>
>>> instr 1
>>>   prints "amp = %f, freq = %f\n", p4, p5;
>>> endin
>>>
>>> 
>>> 
>>>
>>> i1  0  .01  rand()   [200 + rand(30)]
>>> i1  +  .    rand()   [400 + rand(80)]
>>> i1  +  .    rand()   [600 + rand(160)]
>>> ;; SEED 123
>>> i1  +  .    rand()   [750 + rand(200)]
>>> i1  +  .    rand()   [210 + rand(20)]
>>> e
>>>
>>> 
>>> 
>>>
>>>
>>> csound score_random.csd
>>> ...
>>> amp = 0.825471, freq = 217.856199
>>> ...
>>> amp = 0.628137, freq = 463.863331
>>> ...
>>> amp = 0.790931, freq = 638.330751
>>> ...
>>> amp = 0.279512, freq = 832.905816
>>> ...
>>> amp = 0.925176, freq = 212.590480
>>> ...
>>>
>>>
>>> PS  Only the git version of csound removes all the temp files on *nix OS
>>>
>>> tito
>>>
>>>
>>> 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"
> 
> 

Date2012-03-13 10:09
FromTito Latini
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-13 21:07
Fromjoachim heintz
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
tito -
thanks for the explanations. now i understand most of the code. what i
am not sure about is the way the infile / outfile is passed to the
script. i tried this in python:

#cs_sco_test.py
import sys
filename = sys.argv[1]
outfile = open(filename, 'w')
outfile.write("i 1 0 1\n")
outfile.close()

with this test2.csd:


instr 1
asig oscils 0dbfs/5, 400, 0
outs asig, asig	
endin






but the message is that the temporary score file can not be opened:
UnifiedCSD:  test2.csd
STARTING FILE
Creating orchestra
Creating score
Creating /tmp/csoundyZVzjV.ext (0x163d6d0)
rtaudio: PortAudio module enabled ... using blocking interface
graph init
rtmidi: PortMIDI module enabled
Parsing successful!
Elapsed time at end of orchestra compile: real: 0.044s, CPU: 0.010s
cannot open scorefile /tmp/csound08hyPL.sco

what am i doing wrong here?
thanks -

	joachim


Am 13.03.2012 11:09, schrieb Tito Latini:
>> i'm still trying to understand what's happening exactly. as i can't
>> speak pearl, it's a bit hard to me. are you perhaps able to "translate"
>> your example to python or bash?
> 
> No, I know bash and python but I prefer the regular expressions
> of the perl lang. I can help you with pseudo code
> 
>   - open infile to read
>   - open outfile to write
>   - loop
>       + read the next line from infile or exit if EOF
> 
>       + if there is the `SEED' word followed by a NUMBER
>         then execute `srand(NUMBER)'    [1]
> 	     and substitute `SEED NUM' with itself
> 
>       + if there is the `rand' word followed by (NUMBER) or ()
>         then execute `rand(NUMBER)' or `rand()'   [2] 
>              and substitute `rand(*)' with the result
> 
>       + write the line to outfile
> 
> 
> [1] from perldoc: "srand   Sets the random number seed for the "rand" operator."
> 
> [2] from perldoc: "Returns a random fractional number greater than or equal to 0
>                    and less than the value of EXPR " (in this case EXPR is NUMBER)
> 
> tito
> 
> 
> 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"
> 
> 

Date2012-03-13 21:11
FromTito Latini
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-13 21:31
FromTito Latini
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-13 22:06
Fromfrancesco
Subject[Csnd] Re: Seeding options for tilde (~) in the score file
Hello All,
with Csound build today i have segmentation fault with the examples,
also with example in Perl by Mr. Tito, and i'm sure it was working yesteday.

Something changed in Csound or am i wrong?

Ubuntu 10.04, 32 bitter.

ciao,
francesco.


--
View this message in context: http://csound.1045644.n5.nabble.com/Seeding-options-for-tilde-in-the-score-file-tp5549713p5562763.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-03-13 22:29
FromTito Latini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-13 22:30
FromTito Latini
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-13 22:40
FromTito Latini
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-13 23:12
Fromfra III
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
Dear Mr. Tito,
although i have no idea or all You said (sorry),
i have try and this is the output.


Reading symbols from /home/fra/csound/csound...done.
(gdb) r
Starting program: /home/fra/csound/csound score_random.csd
[Thread debugging using libthread_db enabled]
PortAudio real-time audio module for Csound
virtual_keyboard real time MIDI plugin for Csound
PortMIDI real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.16 (double samples) Mar 13 2012
libsndfile-1.0.25
Reading options from $HOME/.csoundrc
UnifiedCSD:  score_random.csd
STARTING FILE
Creating orchestra
Creating score

Program received signal SIGSEGV, Segmentation fault.
csoundTmpFileName (csound=0x804d340, buf=0x8077c80 "", ext=0x486481
".sco")
    at Top/one_file.c:114
114	Top/one_file.c: No such file or directory.
	in Top/one_file.c
(gdb) bt
#0  csoundTmpFileName (csound=0x804d340, buf=0x8077c80 "", ext=0x486481
".sco")
    at Top/one_file.c:114
#1  0x0038619a in createExScore (csound=0x804d340, pname=0x804d950, 
    score=0x804d954) at Top/one_file.c:415
#2  read_unified_file (csound=0x804d340, pname=0x804d950,
score=0x804d954)
    at Top/one_file.c:776
#3  0x00383317 in csoundCompile (csound=0x804d340, argc=1,
argv=0xbffff014)
    at Top/main.c:222
#4  0x08049672 in main (argc=2, argv=0xbffff014)
    at frontends/csound/csound_main.c:136


Thank You,
ciao,
francesco.




Date2012-03-13 23:13
FromTito Latini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-13 23:27
Fromfra III
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
> TMPDIR="$HOME" csound

Yes, it worked.
Thank You for today and good night, but tomorrow
could You please explain me why? It was working before i rebuilded
Csound. Ok, only if You want, i am just curious.

Again thanks, have a good night or a nice day.
ciao,
francesco.



Date2012-03-14 07:18
FromTito Latini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-14 07:57
FromTito Latini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-14 08:13
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  None  

Date2012-03-14 08:19
FromTito Latini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-14 08:51
FromTito Latini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-14 09:06
FromTito Latini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-14 09:06
FromVictor Lazzarini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
I meant "show them it can be done", which is what you've done.

Victor

On 14 Mar 2012, at 08:51, Tito Latini wrote:

>> great ideas, tito, show them! Score generation with your favourite scripting language.
> 
> Ok, after another coffee I have understood that I have to explain
> as it works in another post (soon)
> 
> 
> 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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2012-03-14 10:42
Fromfra III
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
apologies for delay.
i have rebuild csound after a git pull and after uninstalling csound and
cleanup in source. Then reinstalled and rebooted and ...
NO, again like yesterday.
I'm really sorry.
For test i use Your Perl example to be sure i'm using a working example.

thanks,
ciao,
francesco.

if useful (same commands You suggested yesterday):

Program received signal SIGSEGV, Segmentation fault.
csoundTmpFileName (csound=0x804d340, buf=0x8077c80 "", ext=0x4864a1
".sco")
    at Top/one_file.c:114
114	        sprintf(buf, "%s/csound-XXXXXX", (tmpdir[0] != '\0' ?
tmpdir : "/tmp"));
(gdb) bt
#0  csoundTmpFileName (csound=0x804d340, buf=0x8077c80 "", ext=0x4864a1
".sco")
    at Top/one_file.c:114
#1  0x003861ba in createExScore (csound=0x804d340, pname=0x804d950,
score=0x804d954)
    at Top/one_file.c:416
#2  read_unified_file (csound=0x804d340, pname=0x804d950,
score=0x804d954)
    at Top/one_file.c:777
#3  0x00383317 in csoundCompile (csound=0x804d340, argc=1,
argv=0xbffff014)
    at Top/main.c:222
#4  0x08049672 in main (argc=2, argv=0xbffff014) at
frontends/csound/csound_main.c:136



Date2012-03-14 10:49
FromTito Latini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-14 11:03
Fromfra III
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
> This bug has the counted hours
> 
> tito

and when You need a coffe, just call me.

ciao,
francesco.



Date2012-03-14 12:07
FromTito Latini
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-14 12:25
Fromfra III
SubjectRe: [Csnd] Re: Seeding options for tilde (~) in the score file
Yes, many thanks.
i can confirm that now it's ok.

again thanks,
ciao,
francesco.



Date2012-03-14 14:01
Fromjoachim heintz
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
okay, thanks; got it now. so there is a call like

python  myscript.py  first_score.ext  final_score.sco

where first_score.ext (= sys.argv[1] in python) is what is written in
the original score by the user. the script has to write its results in
final_score.sco (= sys.argv[2] in python). this file is then finally
read by csound.

when i read the description now again at
http://www.csounds.com/manual/html/CommandUnifile.html, i see that
everything is written there, but i had no idea from reading it. a simple
example would certainly be useful.

i will try to add a subchapter in the floss manual. i think this is a
really fertile feature. anyone who knows some scripting language, can
write his own score language because of this. some years ago, i did
something like this, but in a pipe which produced the score file and
then called csound at the end. but it's much nicer - and much more
adaptable by anyone - to do it in this combination (writing directly in
the score and then prepocessing with a script).

thanks again, tito, for your advices and the example -

	joachim



Am 13.03.2012 22:11, schrieb Tito Latini:
>> what am i doing wrong here?
> 
> filename = sys.argv[2]
> 
> 
> 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"
> 
> 

Date2012-03-14 16:27
Fromjoachim heintz
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
in other words, the example jake has given in the other thread can
already be written in csound:



instr 1
asig oscils 0dbfs/10, p5, 0
asig linen asig, p4, p3, p4
outs asig, asig	
endin


from random import random
from sys import argv
sco = open(argv[1], 'w')
for i in range(10000):
    note = "i 1 " + str(random() * 60.0) + " 0.05 0.02 " + str((100 +
random() * 1000)) + "\n"
    sco.write(note)



	joachim

Am 13.03.2012 23:30, schrieb Tito Latini:
> Another idea, python inside the score
> 
> 
> 
> 
> instr 1
>   prints "--- score in python ---\n"
> endin
> 
> 
> 
> 
> import sys
> sys.stdout = open(sys.argv[1], 'w')
> print "i1 0 1\n"
> 
> 
> 
> 
> tito
> 
> 
> 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"
> 
> 

Date2012-03-14 16:30
FromRory Walsh
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
That's neat.

On 14 March 2012 16:27, joachim heintz  wrote:
> in other words, the example jake has given in the other thread can
> already be written in csound:
>
> 
> 
> instr 1
> asig oscils 0dbfs/10, p5, 0
> asig linen asig, p4, p3, p4
> outs asig, asig
> endin
> 
> 
> from random import random
> from sys import argv
> sco = open(argv[1], 'w')
> for i in range(10000):
>    note = "i 1 " + str(random() * 60.0) + " 0.05 0.02 " + str((100 +
> random() * 1000)) + "\n"
>    sco.write(note)
> 
> 
>
>        joachim
>
> Am 13.03.2012 23:30, schrieb Tito Latini:
>> Another idea, python inside the score
>>
>> 
>> 
>>
>> instr 1
>>   prints "--- score in python ---\n"
>> endin
>>
>> 
>> 
>>
>> import sys
>> sys.stdout = open(sys.argv[1], 'w')
>> print "i1 0 1\n"
>>
>> 
>> 
>>
>> tito
>>
>>
>> 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"
>


Date2012-03-14 16:32
FromTito Latini
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-14 16:47
FromRory Walsh
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
I found it tricky to grasp from your perl code, but from looking at
the examples you and Joachim posted in Python it looks like a really
powerful extension.

On 14 March 2012 16:32, Tito Latini  wrote:
> You have grabbed the concept, no external files
> and no limits for the musical fantasy.
>
> tito
>
> On Wed, Mar 14, 2012 at 05:27:21PM +0100, joachim heintz wrote:
>> in other words, the example jake has given in the other thread can
>> already be written in csound:
>>
>> 
>> 
>> instr 1
>> asig oscils 0dbfs/10, p5, 0
>> asig linen asig, p4, p3, p4
>> outs asig, asig
>> endin
>> 
>> 
>> from random import random
>> from sys import argv
>> sco = open(argv[1], 'w')
>> for i in range(10000):
>>     note = "i 1 " + str(random() * 60.0) + " 0.05 0.02 " + str((100 +
>> random() * 1000)) + "\n"
>>     sco.write(note)
>> 
>> 
>>
>>       joachim
>>
>> Am 13.03.2012 23:30, schrieb Tito Latini:
>> > Another idea, python inside the score
>> >
>> > 
>> > 
>> >
>> > instr 1
>> >   prints "--- score in python ---\n"
>> > endin
>> >
>> > 
>> > 
>> >
>> > import sys
>> > sys.stdout = open(sys.argv[1], 'w')
>> > print "i1 0 1\n"
>> >
>> > 
>> > 
>> >
>> > tito
>> >
>> >
>> > 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"
>


Date2012-03-14 16:49
FromTito Latini
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
AttachmentsNone  

Date2012-03-14 17:03
FromMichael Gogins
SubjectRe: [Csnd] Seeding options for tilde (~) in the score file
The main difference between jpff's "bin" attribute and my suggestions
for a "syntax" attribute is that the "bin" attribute calls out to any
external program with the tag text as input file, whereas the "syntax"
attribute would call an internal Csound parser with the tag text as
input.

Frankly, for the original question, I fail to see that the bin
facility doesn't answer the requirement. Why not?

However, the "syntax" attribute could in theory, since the parser
would operate in Csound's address space, call back into Csound during
rendering (to access control channels, etc.). Perhaps such
communications could go the other way as well, allowing the user to
"conduct" the score.

Regards,
Mike

On Wed, Mar 14, 2012 at 12:49 PM, Tito Latini  wrote:
>> I found it tricky to grasp from your perl code, but from looking at
>> the examples you and Joachim posted in Python it looks like a really
>> powerful extension.
>
> and idem for bash, perl, etc
> all is embed-able (there is also a bash example in the ~-post-noise here)
>
>
> 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