ET IN TERRA (2017) for realtime Csound (PC and Android versions) Arthur B. Hunkins abhunkin@uncg.edu www.arthunkins.com Adveniat regnum tuum. Fiat voluntas tua, sicut in caelo et in terra. The Lord's Prayer From community arises compassion; from compassion, justice; from justice, peace. THE VERSIONS For PC's (all platforms): TerraStereo.csd - stereo output, 1-2 "voices", requires MIDI controller with 4-9 knobs/sliders and up to 16 buttons/notes TerraQuad.csd - same as TerraStereo, except quad output For Android devices (all smartphones and tablets - OS 4.1.1 and up): TerraAndroidSimple.csd - stereo output, 1 "voice" - uses standard Android Csound GUI (comprising 5 sliders, 5 buttons and optional trackpad). Latest Csound6 app available free at: https://play.google.com/store/apps/details?id=com.csounds.Csound6 *Note that the above app requires Android OS 5 or higher. Csound5 and 6 Android apps that can run on earlier devices (down to OS 4.1.1) can be found at: http://dream.cs.bath.ac.uk/Csound-archive/OldReleases/ (Look under Csound5 and Csound6 for Android apps indicated by the .apk extension.) TerraAndroidEnhanced.csd - stereo output, 1-2 "voices" - requires one of the enhanced (alternative) Csound Android apps found at: http://arthunkins.com/Android_Csound_Apps.htm *Note: This version uses 9 sliders and up to 16 of the 12-16 buttons of these apps. THE CONTROLS The minimum performance requirement for ET IN TERRA is 4 knobs/sliders only. This comprises 3 controls for "voice 1" plus a base freqency (base freq) slider. The first slider of voice 1 is an amplitude (amp) control, the second is a "tone" control, the third a "note" control. The lower range of this third control produces broad-band noise; however, as the control raises, it morphs into a pure pitch (or, better, a bell tone with specific frequencies - i.e., a "note"). This "voice" randomly wanders through stereo or quad space. With 5 knobs/sliders available, we can add either a noise control or a "shimmer" control; I suggest the noise control. This is basically again broad-band noise, but which is effectively low-pass filtered randomly. While it appears equally to the left and right (including in quad) and overall amplitude is identical, the random filtering and amplitude adjustments are independent. With a total of 6 controls, we add the choice not taken with 5. The "shimmer" control adds resonance (actually reverb) to the upper frequencies of the "voice" (or "voices") only. IMPORTANT NOTE: It is only to be used when the voice pitch control(s) are at 100% (pure pitch for the voices - no noise component). When 7 controllers are available, I suggest implementing a 2-voice version. The second voice duplicates the first, on a different basic pitch and with its own (three) dedicated controls. This gives us two voices plus a base freq control that moves the pitches of both voices in a constant ratio. (This arrangement eliminates the separate noise and shimmer controls.) With one or two additional controls, the same choices are made as for 5- and 6-control implementations above. Again, I would recommend adding the noise control first, then shimmer. Then there are the 0-16 buttons/keys - in two sets of 8 each. The first set comprises 8 tone selections - different FM modulation ratios for the voice, when devoid of noise. In two-voice versions, the same ratio applies to each voice. The second set of 8 buttons/keys is a selection of frequency ratios *between* the two voices. When 8 or fewer buttons are available, it is the first set which is the default. The Android versions fix the first 8 buttons as the first set, and 9-16 as the second set. For the standard Android GUI of five buttons, five settings have been selected from the first set. For the enhanced apps which include just 12 buttons, only the first half of the second-set options are available. PHYSICAL ARRANGEMENT OF THE CONTROLS In Android versions, physical placement is fixed. In the simple version, the five sliders are, in order, the three sliders of voice 1, the base freq slider and the noise slider. Shimmer may be controlled by the x axis of an x/y trackpad, if available. (A trackpad is included in the current Android Csound6 app, under Settings | Screen Layout | Widgets.) As mentioned above, the five buttons are selections from the first set of 8 "tones." In enhanced apps, the three sliders of voice 2 are added between the base frequency slider and the noise slider; shimmer is the final (9th) slider. The first up to 8 buttons are the 8 tones; any further buttons are (in order) from the frequency ratio set. Basically, the Android buttons are implemented as a single (up to) 16-button set. There is much more flexibility in the arrangement for PC's. Though the default configuration mirrors the enhanced Android setup, it will need to be customized toward the top of your .csd - in the series of #define macros. Since .csd's are simple text files, edits can be made by any text editor. MIDI controller numbers and/or notes need to be assigned to the knobs/sliders and button/keys. IMPORTANT NOTE: All MIDI messages must be sent on channel 1. The macro CTRL1 specifies the first controller of three for voice 1; BASEFREQ for the single base frequency controller (that applies to both voices if present); CTRL2 for the first of three voice 2 controllers; NOISE for the noise controller; SHIMMER for the shimmer or "brilliance" controller. CTRLTONE specifies the initial MIDI *note* of the set of up to 8 (FM) tone options; and CTRLRATIO the first note number for the set of frequency ratios between the two voices. The single controls, and groups of controls, can be arranged in any desired physical order, and can be ignored if unwanted. The sets of MIDI notes can be truncated, though their internal order cannot be changed. (When using a single voice, the set of CTRLRATIO notes is irrelevant.) TWEAKING THE ANDROID CSOUND FILES These Android .csd's, especially the enhanced version, are demanding on the limited-power Android CPU's. Particularly in older devices, minor editing of these text files may be required. (Editing can be done within nearly all of the Android Csound apps themselves.) If you experience sonic "pops", erratic timing, or unexpected slider or button performance, try the following in order, until you get glitch-free performance on your device: 1) Reduce the sample rate (sr) from 44100, to 32000, then to 22050. (Substitute the new value toward thet top of the .csd at "sr = 44100." If this does not cure the problem, we'll need to start taking away features. 2) (Note: you may want to try step 4 prior to step 2, though by itself, step 4 will probably not have sufficient effect.) Starting back with sr = 44100, place a semicolon (;) at the beginning of the line starting "i 1" near the end of the file. This will eliminate the action of all the buttons, leaving you with only the default selections. NOTE: It is possible (and easy) to change the default values for the two buttons; the values are toward the top of the file - "gkmod init 1.200", the default for the first (up to) 8 buttons; "gkcps2 init 1.2" for the second group of up to 8 buttons (if available). The default values are those of the first button in each set. Feel free to substitute any of the values of the remaining buttons as the default for gkmod: (in order) 1.222, 1.244, 1.276, 1.31, 1.321, 1.355 or 1.385. You can do the same for gkcps2: (again in order) 1.25, 1.316, 1.353, 1.429, 1.488, 1.564 or 1.649. (Note too that these default substitutions can be made even if you are *not* defeating the button functions.) 3) Again reduce the sample rate as above. 4) With sample rate back at 44100, add a semicolon before the "i 4" line in the Simple version, or the "i 5" line in the Enhanced (again at file end). This will defeat the shimmer control. 5) Again reduce the sample rate. 6) As a final drastic step, here only with the Enhanced version (and back at sr = 44100), put a semicolon before the "i 4": this defeats "voice" 2 (and sliders 4-7). Then, if necessary, reduce the sample rate a final time. 7) General suggestion: Place semicolons at the beginning of all "i X" lines that correspond to controls you will not use (see items above). Any "performance lines" you comment out like this, will help eliminate glitches. OTHER POSSIBLY NEEDED .CSD EDITS In the PC versions, you'll likely need to modify several items for your particular setup. First, under - again near the top of the file, you'll need to adapt for Linux if you are on other than a Windows or Mac system. (Recall that an opening semicolon comments out a row of code; removing the semicolon implements the row). If you have a single MIDI device, the default -M0 is fine. If the console output includes an "unrecognized MIDI device" error, look for the MIDI device list, and substitute your appropriate device number for the zero in -M0; then rerun Csound. In the Quad version, if your console output aborts with an "invalid number of channels" message, you'll need to find the audio output device list, then edit the number of your *quad* driver in -odacX (e.g., -odac5). (-odac defaults to -odac0, the number of your usual stereo device.) A SAMPLE PERFORMANCE OUTLINE ET IN TERRA is essentially an electronic instrument design. The outline below is only one of many possible frameworks for improvization - one "interpretation." Another rendition might, for example, completely reverse the sequence of actions below. This basic scenario can be realized even by TerraAndroidSimple. It features a single "voice" and makes no use of buttons. (It is also the template for the sample website recording.) IMPORTANT NOTE: All knob/slider movement is slow, and for the most part, one controller at a time. (Android is limited to one at a time.) 1) Zero all knobs/sliders. 2) Start Csound. 3) Bring up (separate) noise control to moderate level. Remain for a time. 4) Noise control to lower level. 5) Amp (first) control of voice 1 to low level, then after short time, to moderate level. 6) Vary amp control of voice 1. 7) Along with #6, vary tone (second) control of voice 1. (When finished, leave amp control of voice 1 at moderate level.) 8) Along with #7, vary note (third) control of voice 1 from 0 - 50%. 9) Along with #7, vary note (third) control of voice 1 from 0 - 100%. 100% is brief and rare. 10) Increasingly add varying base freq control to the mix of the above two controls, eventually extending its range to the entire control. Spend some time varying these three controls; the note control is ever more frequently, and for longer periods of time, at 100%; and the base freq control migrates to its upper range. IMPORTANT NOTE: Make sure that base freq only changes when note control of voice 1 is in its low range or at zero. 11) Base freq arrives, and remains at 100%. 12) Note control arrives, and remains at 100%. 13) Tone control of voice 1 varies, finally arriving at 100%. 14) Noise control to zero. 15) Shimmer control gradually moves to max (or near max). 16) Tone control of voice 1 moves to moderate level. 17) Shimmer control gradually back to zero. 18) Amp control of voice 1 returns slowly to silence. 19) Stop Csound. ADDENDUM FOR A TWO-VOICE RENDITION (based on the above scenario) Introduce voice 1 first, adding voice 2 later. Once both have entered, continue to vary their relative levels - including completely fading one or the other out. Have only one pitch clearly emerge at a time, and only gradually have the pitches appear closer together. Toward the end they can emerge and eventually sustain together, with both tone controls rising to max. The ending could represent the two voices staging down alternately in a process similar to that suggested in the single-voice outline above. IMPORTANT NOTE: in two-voice performance (similar to one-voice), the note control of *either sounding voice* must be at a low level or off whenever base freq is moved. IMPORTANT NOTE: also in two-voice renditions, the amp control for *voice 2 only*, must be at zero when a new button from the second set of 8 is activated. Unlike when a button from the first set is pressed, the pitch of voice 1 remains unaffected. (Voice 2's pitch changes suddenly - an action not intended to be heard.) GENERAL PERFORMANCE INSTRUCTIONS The overall level is moderate. In all performances, it is crucial to set all knobs/sliders to zero before starting Csound. If you wish to initialize non-amplitude controls to a setting above zero, do so by raising the control *after* starting Csound. Sound will then begin only once you move an amplitude knob/slider, and all controls will immediately register at their desired settings. Otherwise, the only performance requirement is to observe the IMPORTANT NOTEs embedded throughout the text above.