[Csnd] athenaCL within Csound
Date | 2013-01-29 20:21 |
From | menno |
Subject | [Csnd] athenaCL within Csound |
Hi all, i want to use values returned by AthenaCL for note generation and such, from within Csound. I know about the article "Python at the Control Rate: athenaCL Generators as Csound Signals" from the Csound Journal. In that article there is only one note played and athenaCL Generators can be used to for example to change the cutoff frequency of a filter - all at k rate. What i would like to know if it is possible to generate the notes itself or use the produces values for other purposes. Can this be done somehow with "event"? I was trying this example, where i use the string method (http://www.flexatone.org/static/docs/athenacl/www/sect-python-generator.htm). Python runs, but no value is returned. Any ideas? |
Date | 2013-01-30 07:12 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] athenaCL within Csound |
Hi menno, I have wanted to look into using athenaCL from within Csound too, but haven't got around to it yet.pseudo-ish code: (in global instr) pyruni "import athenaCL.libATH.libPmtr" pyruni "po = parameter.factory(['ws','t',6,0,-1,1])" instr 1 k1 pycalli "po", 1 endin As I said, never got around to trying it, so it's a shot in the dark... Oeyvind 2013/1/29 menno <nabob_cd@yahoo.com> Hi all, -- 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 |
Date | 2013-01-30 13:53 |
From | Michael Gogins |
Subject | Re: [Csnd] athenaCL within Csound |
Before trying to answer your question, it would be helpful to know more about what you are trying to do. Do you want to generate a score? Control performance? (i.e. set up control channel values). Then, do you need to do this before performance, during performance, or both? There are examples of doing various sorts of this kinds of things with both Python and Lua in the csound/examples/opcode_demos directory. On Wed, Jan 30, 2013 at 2:12 AM, Oeyvind Brandtsegg |
Date | 2013-01-30 14:03 |
From | menno |
Subject | [Csnd] Re: athenaCL within Csound |
Sound logic, Oeyvind, but perhaps too logic: it does not work :) I get a segmentation fault AND 0 errors. This was my try: |
Date | 2013-01-30 14:35 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] Re: athenaCL within Csound |
Sorry for not being able to provide a secure and tested solution... but can you test the same statements in Python, to see that it does not produce an error there?To include the current working dir in the search path, I routinely do this: pyinit pyruni "import sys" pyruni "import os" pyruni "sys.path.append(os.getcwd())" pyruni "import mymodule_residing_in_cwd" The above code requires you to run Csound from the terminal, and being situated in the directory where the csd and py files reside (cd to that directory). If you run Csound from Qt or other frontend, the current working directory may be something else than the directory where the csd file resides, and the above won't work. best Oeyvind Oeyvind 2013/1/30 menno <nabob_cd@yahoo.com> Sound logic, Oeyvind, but perhaps too logic: it does not work :) -- 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 |
Date | 2013-01-30 14:49 |
From | menno |
Subject | [Csnd] Re: athenaCL within Csound |
The article that Ariza wrote for the Csound Journal 9 explains how you can use the returned values of (sections of) athenaCL. The returned values can be used - at k rate - to change filters or frequency within ONE note's duration. That's great and i'm greatful. What i also want is: let AthenaCL generate notes. And amps for those notes, and rhythmic distributions with those notes and everything else that AthenaCL can do as a standalone program. All that i want to have embedded within a csd. Personally don't need its pitch analysis system. AthenaCL is very nice. It gives me positive feedback because of the algorithmic nature of the textures, but it produces a fixed end result while i would like to be able to change and adapt the produced values within a csd. That is why i want AthenaCL to function within a csd. And the final goal is to use AthenaCL as an instrument within Blue, so it can be used in the composition. Those are my humble wishes :) -- View this message in context: http://csound.1045644.n5.nabble.com/athenaCL-within-Csound-tp5719687p5719707.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2013-01-30 14:55 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] Re: athenaCL within Csound |
Here's a simple example of using python data to generate instrument events with varying rhytm and pitch. Perhaps it can be used as a basis for what you want to do?;********************************************************************* ; generate a melody by calling python to get note data ;********************************************************************* instr 2 kindex init p4 ; where in the note series to start ioffset = p5 ; note offset (octave or other offset) kbpm = p6 ; tempo in beats per minute ktempo = kbpm/60 ; tempo in ticks per second kRhythm init 1 ; rhytm multiplier value (f.ex. 4 will be a quarter note) kmetrofreq = ktempo*kRhythm ; calculate rhythm as metronome frequency kTrig metro kmetrofreq ; generate metronome pulse kNote, kRhythm pycall2t kTrig, "serial2_rhythm.getNextNote", kindex ; get note (both note number and rhythm multiplier) if kTrig == 0 kgoto done kDur = (1/(ktempo*kRhythm)) * 0.9 ; here, note duration is 90% of the time until the next note kAmp = -10 instrNum = 31 ; select instrument for playback event "i", instrNum, 0, kDur, kAmp, kNote+ioffset ; trigger csound audio synthesis instrument done: endin
2013/1/30 menno <nabob_cd@yahoo.com> The article that Ariza wrote for the Csound Journal 9 explains how you can -- 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 |
Date | 2013-01-30 15:04 |
From | Michael Gogins |
Subject | Re: [Csnd] Re: athenaCL within Csound |
Thanks Menno, I'll be getting back to you with some suggestions about generating notes. Again, are notes to be generated prior to performance, or during performance in response to other events? Or both? Regards, Mike On Wed, Jan 30, 2013 at 9:55 AM, Oeyvind Brandtsegg |
Date | 2013-01-30 15:09 |
From | menno |
Subject | [Csnd] Re: athenaCL within Csound |
some progress here: |
Date | 2013-01-30 15:46 |
From | Steven Yi |
Subject | Re: [Csnd] Re: athenaCL within Csound |
Attachments | athenaTest.zip |
Hi Menno, Regarding AthenaCL and Blue, you can run AthenaCL from within a Blue ExternalObject or ObjectBuilder object. It would have to run a system-installed python interpreter with AthenaCL installed with that Python. I tried a long time ago with Jython (the java version of Python that is included with Blue), but there's a large data file used as a class in AthenaCL that can not be compiled down to a Java class so it can not run. (Haven't checked in a long time though). However, I did get AthenaCL to run via ExternalObject a long while back though. I had to look in my email archive and found a discussion I had with Christopher Ariza about it from about 2005. I have attached a .blue and .py file that work together to run AthenaCL to produce some score. I don't have AthenaCL installed at the moment so I can't test it, but I imagine it would either work or be a good start for how to integrate the two. Cheers! steven On Wed, Jan 30, 2013 at 2:49 PM, menno |