[Csnd] Seeding options for tilde (~) in the score file
Date | 2012-03-09 05:55 |
From | Deepak |
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 |
Date | 2012-03-09 06:28 |
From | David Akbari |
Subject | Re: [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 |
Date | 2012-03-09 06:34 |
From | Deepak |
Subject | Re: [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, -- www.myspace.com/dcompanymusic www.myspace.com/thewoodshedmusicians |
Date | 2012-03-09 07:51 |
From | Oeyvind Brandtsegg |
Subject | Re: [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 |
Date | 2012-03-09 07:59 |
From | "Dr. Richard Boulanger" |
Subject | Re: [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:
|
Date | 2012-03-09 13:17 |
From | Deepak |
Subject | Re: [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:
-- www.myspace.com/dcompanymusic www.myspace.com/thewoodshedmusicians |
Date | 2012-03-09 13:54 |
From | Oeyvind Brandtsegg |
Subject | Re: [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 |
Date | 2012-03-09 14:21 |
From | Deepak |
Subject | Re: [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, -- www.myspace.com/dcompanymusic www.myspace.com/thewoodshedmusicians |
Date | 2012-03-09 15:56 |
From | Adam Puckett |
Subject | Re: [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 |
Date | 2012-03-10 17:38 |
From | Tito Latini |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-12 11:49 |
From | joachim heintz |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
hi tito - very cool example. i never knew about the |
Date | 2012-03-12 11:58 |
From | Tito Latini |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-12 13:47 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
> hi tito - > very cool example. i never knew about the |
Date | 2012-03-12 15:41 |
From | joachim heintz |
Subject | Re: [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 |
Date | 2012-03-12 16:12 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [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 ( |
Date | 2012-03-12 16:16 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [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 |
Date | 2012-03-12 16:58 |
From | J Clements |
Subject | Re: [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 |
Date | 2012-03-12 19:25 |
From | joachim heintz |
Subject | Re: [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" > > |
Date | 2012-03-12 19:29 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [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 |
Date | 2012-03-12 21:00 |
From | joachim heintz |
Subject | Re: [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 |
Date | 2012-03-13 10:09 |
From | Tito Latini |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-13 21:07 |
From | joachim heintz |
Subject | Re: [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: |
Date | 2012-03-13 21:11 |
From | Tito Latini |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-13 21:31 |
From | Tito Latini |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-13 22:06 |
From | francesco |
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. |
Date | 2012-03-13 22:29 |
From | Tito Latini |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-13 22:30 |
From | Tito Latini |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-13 22:40 |
From | Tito Latini |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-13 23:12 |
From | fra III |
Subject | Re: [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. |
Date | 2012-03-13 23:13 |
From | Tito Latini |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-13 23:27 |
From | fra III |
Subject | Re: [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. |
Date | 2012-03-14 07:18 |
From | Tito Latini |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-14 07:57 |
From | Tito Latini |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-14 08:13 |
From | Victor.Lazzarini@nuim.ie |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None None |
Date | 2012-03-14 08:19 |
From | Tito Latini |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-14 08:51 |
From | Tito Latini |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-14 09:06 |
From | Tito Latini |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-14 09:06 |
From | Victor Lazzarini |
Subject | Re: [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 |
Date | 2012-03-14 10:42 |
From | fra III |
Subject | Re: [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 |
Date | 2012-03-14 10:49 |
From | Tito Latini |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-14 11:03 |
From | fra III |
Subject | Re: [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. |
Date | 2012-03-14 12:07 |
From | Tito Latini |
Subject | Re: [Csnd] Re: Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-14 12:25 |
From | fra III |
Subject | Re: [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. |
Date | 2012-03-14 14:01 |
From | joachim heintz |
Subject | Re: [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" > > |
Date | 2012-03-14 16:27 |
From | joachim heintz |
Subject | Re: [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: |
Date | 2012-03-14 16:30 |
From | Rory Walsh |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
That's neat. On 14 March 2012 16:27, joachim heintz |
Date | 2012-03-14 16:32 |
From | Tito Latini |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-14 16:47 |
From | Rory Walsh |
Subject | Re: [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 |
Date | 2012-03-14 16:49 |
From | Tito Latini |
Subject | Re: [Csnd] Seeding options for tilde (~) in the score file |
Attachments | None |
Date | 2012-03-14 17:03 |
From | Michael Gogins |
Subject | Re: [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 |