-
Notifications
You must be signed in to change notification settings - Fork 12
Blue's athenaCL
Author: Menno Knevel
This article is a bit old in that the original athenaCL was depending on Python2.7, which is no longer part of modern (Linux?) distributions. A new fork of AthenaCL can be found here: https://github.com/ales-tsurko/athenaCL. Ales Tsurko ported the program to Python3, and recently, a seed option has been added by Michael Gogins and Menno Knevel. A video on the matter can be found on https://youtu.be/8rgqVNlo9PQ
AthenaCL, a program by Christopher Ariza, generates values by using (musical) algorithms. Okay, athenaCL can do other things, like pitch analyses, but for our purpose, only the score generator part is used. In Blue i chose the ObjectBuilder to hold athenaCL, as i think it is best suited for the task.
It took me quite some time to understand the system of ideas behind athenaCL, but once you understand the basics, it is logical - although sometimes rigid to use; a type error is done in the blink of the eye and hard to detect; there is no feedback at all, apart from a returned empty window! Also, using the Python language for score generation somewhat slower than nGen (C language) or JMask (Java). It takes a few moments to generate the hundreds of events, but in practice does not pose a big problem.
But the fact that it is NOT possible to set a seed value has kept me from using athenaCL extensively. Without being able to give a seed, every time events are generated, the clock time is used as the program's seed – and the clock always changes. This means that when you decide you like a certain combination of events and wish to keep it - forget it, as the next time you will be running the same athenaCL script, a new set of different events will be produced. In that perspective, athenaCL is unpredictable and thus unreliable. The only option then is to Freeze the athenaCL ObjectBuilder and hope you like this frozen texture. Or you should just simply accept the fact that it will be the same but different every time you run the script...
On one hand, the outcome of the events may be unreliable (but of course within the set of rules you gave), on the other hand, athenaCL is also surprisingly fun! And, as you know, fun is an important incentive to “play and enjoy” with the sound material. So, once again, the famous words of soccer icon Johan Cruyff: “Every advantage has its disadvantage.” So - hurray for athenaCL :)
The flexibility of Blue, in that it is easy to make Objects shrink or stretch, the moving around of this Object anywhere within the composition, the way it is designed to integrate external score programs such as athenaCL - all this makes it even more fun and appealing to want to use it. While JMask/CMask with its seed option is great fun and perfect to get more or less predictable results, athenaCL has a lot more options, is far less transparent in what the final resulting events will be. It is fun if you like surprises!
Stretching an ExternalObject in Blue also re-evaluates the start times of the events produced by athenaCL. Stretching produces more room in between the notes, shrinking makes the pattern dense – sometimes so dense that notes become a sound texture that resembles grain modulation. Fading in and out such Objects can produce nice, moving-over-time textures. Time for a sounding example!
The command for calling athenaCL from the ExternalObject and giving back the score to Blue is “python athenaPipe.py $infile”. Steven Yi, creator of Blue, has written a little program by the name athenaPipe.py that transforms the contents of the athenaCL commands sent from Blue so, that athenaCL can read that temporary file and sends the score back to athenaPipe.py, that, in turn, sends it back to Blue. athenaPipe.py can be found in the examples folder of Blue. Be sure to put this program in your PYTHONPATH, so your system may find it. If it is not in PYTHONPATH, just use the whole path in the commandline. On Linux systems, the path will most likely be /usr/local/lib/python2.7/dist-packages or the like.
A possibility to add comments (#blah) was added to athenaPipe.py. This is very useful, because Blue uses the acronyms for commands of athenaCl ; it’s a pretty compact language and looks alien. Comments are important here for later reference, as well as keeping the manual of athenaCL open to check out all its options. In our athenaCL ObjectBuilder the comment text can also be entered in a textfield - use it!
In short, what we will be doing here is creating - in Csound terms - p1, p2, p3 and p4 (notes) example:
- set EventMode to CsoundExternal. EXAMPLE: "emo ce" = set EventMode Output to CsoundExternal
- choose the TextureModule. EXAMPLE: "tmo ha" = set TextureModule Output to HarmonicAssembly. The TextureModule has great impact on how the timing and note pitches or chords are formed.
- input notes. EXAMPLE: "pin pathA C7, B3" means that a new path instance (pitches of notes) with the name “pathA” will be created to hold the notes C7 and B3.
- create the texture that contains this path (notes). EXAMPLE: "tin a 1 1" creates a new texture called “a” and has 1 extra p-field p4
Inputting notes may also contain groups of notes. EXAMPLE: "pin b D2, E1,y,y,B5,B6,y,n" means: create a path instance called "b" that holds 1 group of the notes D2 and E1, then create another group that contains B5 and B6.
This is what it would look like if you were running athenaCL from a terminal running Python2.7:
Now you understand why the "y,y and y,n" are present in the ObjectBuilder: we are just following the layout of the athenaCL program. (Note that also notenumbers may be used instead of note names.)
A bigger weight can be given to a group of notes, if you want to hear more of those notes than the notes in the other group. EXAMPLE: "pidf 1,2" where the notes in the second group (B6,B7) will be 2 times more present than the notes of the first group (D2,E1)
In the previous example, a rudimentary score was created; the start times were entirely derived from the TextureModule, "ha" in this case, that stands for HarmonicAssembly. Other TextureModules will result in different timings or sometimes even chords, but also in how pitches are being modified according to the rules of that particular TextureModule. The TextureModules themselves have presets, that make them how they react to the timing of the events and the modifying of the notes (like transposition or octave scaling). These presets, or "selectors" can be modified at will. But it's better to start with the presets, as there is already so much going on....easy does it!
Here are some examples of what small changes to some parameters can provoke: 3 fragments of 20 seconds each. Same basic instrument and same notes, but small changes in TextureModule and Temperament (= scale division)
...and the result.
Caveats:
- When you create 3 extra p-fields as in the example “tin a 1 3”, these p-fields expect to be named: x0, x1 and x2...
- when editing the externalObject, be sure that you do not leave your cursor blinking on an extra, empty line. When an extra empty line is created, athenaPipe.py will see that as an extra, but empty p-field. Result is: no result,an empty window with no events...
...empty newline = no score ...produces correct output...
- in a terminal i have the terminal open, running Python2.7 and athenaCL (athenaCL only runs with Python2). Sometimes the ParameterObjects of athenaCL become so complicated i try something out using athenaCL from the terminal. The command "timap", for example, shows an image of how that ParameterObject will look like - it gives you an idea of what to expect. Impossible to show from within Blue...
So, some decisions had to be made so that the collaboration of Blue and the athenaCL code would make sense, and that it would make athenaCL simpler for the user. For example, when one works in Python/atheanCL only, it would suffice to put in some notes and create the Texture without any additional parameters. It is even possible to not give any notes at all; when creating the Texture, athenaCL will default to using one note, i.e. C4, as well as to the automatic generation of several parameters like rhythm, duration of note, amplitude, BPM, panning etc. etc. In fact, this is a basic setup for the midi file creation that athenaCL can do. In the Blue's athenaCL score generator however, notes are internally copied and stored in P4. The user has to assign p-fields for amplitude and so on.
ptyhon2.7 and athenaCL running from the terminal
The design of the Csound instrument dictates the order and meaning of the extra p-fields. We accomplish this by adding these p-fields to the auxiliary parameters x0, x1,...xN in the code page of the ObjectBuilder.
Other options of the athenaCL system are simply not working in Blue, or not needed; as stated in the beginning of this article, athenaCL has a pitch analysis system that now cannot be used. Also the image showing all produced events cannot be shown. In athenaCL a copy of a Texture can be made (TextureClone) but we don't need that in Blue: now, on the timeline in Blue we can do the copying, moving, and scaling of Objects.
the athenaCL ObjectBuilder
The design of the athenaCL system is somewhat different from the Csound p-field system. In Csound, the first 3 p-fields are fixed: p1 for instrument number, p2 for the start time of a note and p3 stands for the duration of a note. But athenaCl has a more musical approach. The rhythm - or Pulse - is divided into 3 portions: duration (the time until a next event), the sustain of the note, add an accent, and if yes, how much? Also, some of the Rhythm Parameters are not taking the BPM (beats per minut) into account at all, other do. In the manual: "Pulses are noted as a list of three values: a divisor, a multiplier, and an accent. a Pulse of (1,1,1) is a quarter note, equal in duration to a beat. For example: ((4,2,1),(4,2,1), (4,3,1))." In Csound terms this means that p2 and p3 are intertwined and related to each other. I've tried to make this idea clear visually in the athenaCL score generator by putting the + sign in between p2 and p3 in the athenaCL score generator. This is the blue file for note generation.
The athenaCl score generator does well in scrambling your notes, but it can make your samples to live as well. You can set op a directory of samples and let the score program choose the samples. How it does this job, is up to the user by setting the right parameters.
Here is a sounding example of the athenaCL score generator and what it can do to some samples as found in the assigned Sample Directory...sounds like someone has been slicing tapes back in the '50s. Here is the blue file.
Wanting to use the AthenaCL system with Blue forced me to make some decisions. I needed to organize the remaining options into groups. It made me aware that building a score generator in Blue is different from building an instrument. There is still a lot of data to put in manually - on the other hand, the Dropdown Menu containing the ParameterObject's Names or Texture Modules gives a far better overview then i have ever had when compared to the terminal/Python/AthenaCL program. The ObjectBuilder has a better overview of what the athenaCL settings will likely do when pushing the TEST button. Generating score has become easier and it is more fun to try out things quickly, although the manual of AthenaCl is never far away...
october 2021