LUX MAGNA (A Great Light) for CsoundAV and MIDI Slider Bank (2004) Arthur B. Hunkins Dies sanctificatus illuxit nobis: venite gentes et adorate Dominum: quia hodie descendit lux magna in terris. Haec dies, quam fecit Dominus: exultemus et laetemur in ea. A holy day has dawned for us: come, nations, and worship the Lord, for today a great light has descended to earth. This is the day which the Lord has made; let us rejoice exceedingly and be glad in it. Alleluia-Verse from the Third Mass for Christmas Day GENERAL LUX MAGNA is a largely meditative solo or duo performance piece for Windows-based computer running CsoundAV. It requires, in addition, a MIDI slider or rotary-pot bank of eight (optionally nine) controllers. The basic stereo version is named "stlight.csd" and features four sustained tones/ bells treated (and stereo panned) as a single larger sonority. A quadraphonic variant (and probably the more interesting version) is entitled "light4.csd." This adds manual or random *quad* panning to the combined tone/bell sonority, but otherwise is identical to its stereo counterpart. Soundcard requirements are different for the two versions: stlight.csd is playable by a standard stereo soundcard, whereas light4.csd requires a multichannel (4+) soundcard and ASIO driver. (ASIO drivers are available for nearly all multichannel cards.) Two special parallel versions of Lux magna permit a single performer to realize this composition at a MIDI device which comprises 11 or 12 rotary pots/sliders. (Live performance takes place entirely at the device, not at the computer.) The only limitation to these variants is that *random rather than manual* panning is obligatory (for more on panning options, see below). These versions are entitled "stlighta.csd" and "light4a.csd," and they are discussed further at the end of these instructions. The performance instrument is a set of four tones/bells, whose frequencies are determined by the performer. Via MIDI sliders, the performer controls the amplitude of the four basic tones as well as that of the AM sidebands (bell components) associated with each tone. Performance consists largely of manipulating these four pairs of sliders as the composite bell moves in space (panned by the performer/s or auto-random panned). The performance - otherwise one single sustained sonority - concludes with a short, then a longer composite bell "strike." As is evident from the above, spacial placement is an important ingredient of the music - either stereo or quad as the case may be. Panning can be either manual or random-automatic. Using primarily the random-automatic option, a single performer can handle everything. In predominantly manual pan mode, separate performers are probably required at the console and the MIDI controller box (see further below). The computer required for performance must be running a version of Windows - 95B or higher. (With Windows 95 you must be sure that OpenGL has been installed.) The program that executes the selected .csd file is Gabriel Maldonado's CsoundAV, v0.043 or higher. Prior to performance, be sure to close as many programs running in your Windows taskbar as possible. This will minimize any chance of audio breakup. (Depending on your system, there is a good possibility of disaster otherwise.) Lux magna does not lend itself to multi-speaker sound diffusion. If multichannel realization is desired, perform the quad light4.csd. Minimum duration is 5 minutes. GENERAL SETUP The performer downloads and installs the current version of Maldonado's CsoundAV from http://www.csounds.com/csoundav . The file to download is named CsoundAV_Win.exe . Please be aware that a *graphics tablet* version of this composition, indicated by a final "G" in the filename, requires the *very latest* v0.0432 CsoundAV. (For more about "G" versions of this piece, see the end of these instructions.) This latest v0.0432 may be available *only* at the URL above. To run CsoundAV (and this composition), click on the program icon, and on the popup window that appears, type the name of the desired .csd performance file into the Orc field. Alternately, drag the .csd file onto the window. Click OK, and the performance window for the piece will appear. When you run any performance file, you will be queried (via pop-up window) to specify a Portaudio OUT Device number (-+P#), and if MIDI controllers are involved, a MIDI In Device number (-+K#). Once you determine appropriate device ID's for your setup, you may add them to your CsOptions flags (as, for example, -+K0 and -+P8). (These flags are located toward the beginning of the .csd text file. You can edit them in any text editor, including Windows' Notepad.) Doing so will thereafter happily bypass the device selection process. For any problems, please consult Maldonado's CsoundAV Manual, also downloadable at http://www.csounds.com. This HTML manual comes as a zipped archive named CsoundAV_Manual.zip. See particularly its sections entitled Special Command Line Flags and Command Line Hints. (Command line flags are the same as CsOptions flags.) DIRECTSOUND If your system software includes *DirectSound*, slider/pot response time (latency) will improve substantially. DirectSound is present by default in systems running Windows 98SE and above. You also need a DirectSound driver for your soundcard. Any recently-manufactured stereo soundcard will install DirectSound drivers; "legacy" (ISA) soundcards will not. DirectSound drivers (or multichannel ASIO drivers - see below) may be available on your system. On the Portaudio OUT Device Select popup window, you'll see any and all DirectSound and ASIO (in addition to MME) drivers listed. Specify one of the DirectSound (or ASIO) numbers; if it works, add this number to your -+P flag (as, for example, -+P5). DirectSound and ASIO are *particularly* sensitive to any programs running in the background, including those in the taskbar; be sure to close as many as possible. As mentioned above, the quadraphonic version of Lux magna, light4.csd, requires a 4+ channel soundcard and ASIO drivers. ASIO drivers are distinct both from MME and DirectSound; neither of the latter are multichannel with CsoundAV. (Lux magna is not demanding on system resources: light4.csd runs on a Pentium-class CPU under Windows ME with as little as 16MB RAM. The key is to minimize all programs running in the background.) Hint: If you are still having a problem getting clean, click-free sound, run a *MIDI* version of this work (it is less demanding on system resources). Also, at the slight sacrifice of some high frequency content, you can try halving the values for sr and kr (also at the top of your .csd file) to 22050 and 2205 respectively. (You cannot use ASIO drivers at these rates.) Otherwise, you may need a faster computer. PRE-PERFORMANCE The set of eight (or nine) sliders/rotary pots needed by these versions are found on a variety of MIDI devices, including keyboards. Most of these devices are dependent on serial MIDI interfaces, usually found on sound cards. Some more recent MIDI controllers incorporate *USB* interfaces, and so are particularly appropriate for use with laptop computers (which normally lack MIDI interfaces). The performance files assume that all required sliders/pots are set to function as continuous controllers, and to output values 0-127 on channel 1 - all of which is usually true by default. In some cases, nothing will have to be programmed into the MIDI device; this is true when controller numbers for the eight-slider bank are consecutive. (The performer must consult the device documentation to learn the multiple numbering sequences that are available as "presets." Controller numbers for banks are often consecutive, in at least some preset option.) The default configuration in the on-screen performance window incorporates consecutive numbering. In the unlikely case that no such configuration is available, you'll need to program the controller numbers manually on your controller bank. (Be sure also that they all transmit on channel 1.) All MIDI versions provide for two additional controller configurations that may be rarely encountered. 1) ALL CONTROLLERS USE THE SAME CHANNEL, BUT NOT #1: Locate the line toward the beginning of the performance file - "#define CHAN #1#", and change the channel number to the one you need (from 2-16) with any text editor, such as Notepad. (This revision is active until you change it again.) Note that the "#" characters around the channel number must remain. 2) EACH CONTROL (of a hardware bank of 16) USES A UNIQUE CHANNEL, BUT WITH (channel volume) CONTROLLER #7: For this situation, either the overall Amplitude Controller # box (when applicable) or the Bank 1 1st Controller box on the performance screen includes a special, coded controller number. To enable this layout: For the Amp Controller #, select 128; for Bank 1 1st Controller #, select -1. All controllers will now be consecutive, in the order of their default numbering on screen. Note that the Amp Controller is always first. (Any optional controller, default coded to "#128", is placed last. Since 16 pots/sliders are available, optional controllers are always included here.) Most of the controls shown in the on-screen performance window are to be preset; they are not to be changed once sound starts. These presets include Bell Frequencies, Bell Amplitude Modulation Factors (ratio of modulation frequencies to carrier/Bell frequencies), Shimmer (a fast random frequency variation), Random Maximum Decay for Event 2 (maximum possible length of fadeout for the final event), as well as several controller numbers. The default (and nonexistent!) Random Pan Controller number, found in an on- screen box, is 128; at this value, it is the *Pan Speed counter* that determines how fast panning occurs. (Pan Speed relates to the amount of time it takes to get from one manually- or randomly-selected pan position to another.) If the Random Pan Controller number is anything but 128, the specified MIDI slider controls pan speed, overriding the Pan Speed control. (The range of control is the same in either case). Note that this Random Pan Controller option requires a ninth MIDI controller. Either way, Pan Speed can vary during performance, though it may also be preset (probably to a moderate level, such as 2.5). Also to be preset is the Richer Modulation box. When the box is checked, bell (modulation) sidebands are considerably more prominent, while pitches remain the same. Overall amplitude is user-determined and preset; the external master level remains unchanged throughout the composition. Each bell has the same dynamic range. Overall performance volume should never exceed a robust moderate level. Set maximum level by turning all eight frequency sliders to max and press either of the two on-screen Event buttons. The initial attacks of these events (which occur as the piece ends) are the loudest points. While the default frequency selections work fine (and are intended as a guide), you are encouraged to create your own custom bell sets (see "Creating Your Own Custom Default Version" below). The only general guideline is to create sonorities that do not clash or strongly beat with one another, and that are homogeneous. Test all combinations to be sure they sound well with one another, and are sonicly consistent. SPECIFIC SETUP AND PERFORMANCE After bringing up the performance window, turn all controller pots to zero or other initial positions you have selected - including the Random Pan pot/slider (if you are using it). Note that these sliders *must be moved* to another position *after the performance window is opened*. (The pots output their lowest value - as though they were turned all the way down - until they are changed!) Also, lock in your other presets (see above). Finally, select your initial Stereo or Quad Pan position. The default setting is fine, but you are free to select any other. The on-screen slider or joystick controller can either be clicked and dragged to a new location, or you can simply click a new location. (The length of time it takes to glide to the new position is determined by the Pan Speed setting). With Stereo Pan, you can also click on the handle of the slider (thereby selecting it), and use the keyboard's cursor controls to change position. The performance begins by checking the on-screen Start/Stop checkbox. Any tones whose volumes are preset above zero (and as many may be "on" as desired), will appear within one second. Once the first sonority has entered, for as long as "Start" is on, sound is to be continuous. Sliders/ pots set to zero may now be brought in at any point and speed (but not initially fast). (All eight sliders vary bell and modulation sideband volume; they are laid out in pairs.) Levels should all be low at the beginning. Though there is no limit on how many controls may be varied simultaneously, at first changes should be simpler and deliberate ("take time"). As soon as at least *four* sliders are up at once, a minimum of *two* must remain sounding for the duration. The first portion of the performance consists of slowly fading the various bell components in and out, constantly varying the composite sonority. The Pan position remains as preselected. When all the components have been introduced, panning is begun. (This can happen immediately - Random Pan may even be *preset* to on - if all levels are raised initially. If Random Pan is on prior to the start of performance, the opening pan position will also be random.) Panning may either be manual or random, or a combination of both. (Random Pan may be freely started and stopped.) This allows for all sorts of panning schemes, including starting and ending the piece in the same or a related point in space, or alternating between actively controlling bell tone components, and location. In any case, panning ceases - in place - when Stop is pressed. If Pan Speed is varied during performance (this is optional, though recommended - see above), it should be set slow to begin, and gradually increased. (The lowest .5 speed is a good starting point, and is the default.) Manual pan activity (selecting new pan positions) should correspondingly accelerate during the piece, only optionally stabilizing prior to hitting the Stop button. When predominantly *manual* panning is envisioned, two performers are probably needed - unless little or no MIDI slider manipulation is contemplated past the opening sequence. Otherwise, performance activity on the MIDI sliders can become very intense as the composition grows, and can well represent as much as a single person can handle. (One person would perform the MIDI controllers while the other would be at the monitor and mouse.) The piece gradually intensifies as the amplitude sliders/pots open toward full, as the composite bell sonority varies more actively, and (optionally) as the Pan Speed increases. (Panning and sonority variation should never reach the point where they sound "hectic," however.) Eventually, the slider levels all reach their highest levels simultaneously and remain there - at least briefly. (Most of these controls will be at their maximum positions, but not all "highest levels" need be.) When the spatial location is at a point desired *as the end location for the piece* (see panning options above), the Start/Stop box is unchecked, and sound does a quick fadeout. Immediately, the Event 1 button is clicked, followed - as soon as Event 1 dissipates - by Event 2. These three actions take place in a very short amount of time - nearly as fast as the performer can move the mouse and click. The spatial focal point for the two concluding Events is wherever panning has arrived when Stop is pressed. (With *manual* panning active, this location can be predetermined, and movement can briefly stabilize before Stop is initiated. When Random Pan is switched off, pan next moves to the indicated *manual* pan position - which could well be where pan was located just prior to Random Pan activation.) These two Events are unique in that the four component bells decay in different directions and at different rates. This process is particularly evident in the lengthy Event 2 fadeout. The prominence of this "sonic dissipation" is determined by the Rand Max Dec/Event 2 value, which presets the longest possible (randomly selected) decay for these components. The performance ends as the last bell component from Event 2 disappears. STLIGHTA.CSD AND LIGHT4A.CSD These stereo and quad variants permit a single performer to realize Lux magna entirely from a MIDI controller bank of 11 or 12 pots/sliders, without having to deal with the computer monitor/mouse at all during performance. The on-screen performance controls - Start/Stop, Random Pan Start/Stop, and the two Event buttons - are replaced by three additional MIDI pots. These three pots consitute a second, consecutively numbered bank, for which the first controller number is specified in a new on-screen Extra Bank Controller # field. (This may well be a numerical continuation of the eight-controller bank.) The first controller of this bank is the new Start/Stop switch. "Start" by moving the pot from zero to partly on; "Stop," from partly on back to zero. The second controller is the Random Pan Start/Stop replacement; it works like the first switch. The third controller is a combination of the Event 1 Start and the Event 2 Start buttons; moving the pot from zero to partly on triggers Event 1, while moving it back to zero triggers Event 2. As previously mentioned, single-person realization of this work is only feasible under random panning mode. There are two practical performance options: either random panning can be preselected, with Stereo and Quad Position entirely irrelevent; or the initial Stereo/Quad Position can be preset (in manual mode), with random panning enabled for everything but the opening and close. (In the latter case, opening and closing pan position will be identical.) As with the other versions, be sure *move* all pots to zero or to their initial positions once the performance screen appears. It is also best to turn the *eight-slider bank to zero* before moving the Extra Bank pots. These versions are designed to work well with a single bank of 12+ rotary pots or sliders. (If you have a choice between a device with sliders or one with rotary pots, choose the sliders.) If both pots and sliders are to be used (as in sets of eight sliders and eight pots), assign the Extra Bank of three to the rotary pots. The crucial main amplitude controls are much more conveniently manipulated as sliders - particularly when you need to move a number of controls simultaneously. CREATING YOUR OWN CUSTOM DEFAULT VERSION For either version of Lux magna, you can make a file that contains your own presets ("default version"). Here's how: 1. Using the stereo or quad version you want, create your own live, initial setup. 2. Note, and write down settings that are *different* from the preexisting version. Include both the setting and the control name. 3. Open the same .csd file in any text editor (such as Windows' Notepad). Look toward the beginning of the file for all the lines that prominently feature "FL" statements. Particularly identify lines beginning "FLsetVal_i". These are the default values that you'll change. 4. The default value you change is the first number after "FLsetVal_i." This value is associated with the control name in the line immediately above it. Be sure that the number you substitute is within the allowable range; this range is indicated by the first two numbers following the control name in the line above. 5. You can change any control that has a corresponding "FLsetVal_i" line. This includes all controls except a checkbox (FLbutton) - which is necessarily unchecked. (If you need to change the "Richer Mod" checkbox, do so manually prior to performance.) 6. The initial "Stereo (or Quad) Pan" position can also be changed. Pan assignments are decimal values between zero and one. A pan value (ix) of zero places sound far left; one, far right. In quad, far rear (iy) is zero, far front is one. In other words, the "ix" parameter represents left to right, "iy" (in quad) front to rear. 7. When finished, save your text file with a new file name, preferably with .csd extension. 8. Check to see that your new defaults display (and work) properly. If not, go back and revise them. ADDENDUM: VERSIONS THAT USE A KORG KAOSS PAD (OR X/Y CONTROLLER) AS SECOND MIDI CONTROLLER Light4K and light4aK are two additional versions that duplicate light4 and light4a - except that they use a Korg KAOSS Pad in place of the on-screen joystick (FLjoy). (Light4K also eliminates the Random [quad] Pan option.) Either a KAOSS Pad 1 or 2 will work (and in exactly the same way). The KAOSS Pad is a control surface that consists of two contiguous MIDI controllers, one representing the x coordinate, the other the y. The Pad's default controller numbers 12 and 13 are also default for these versions. (Be sure to configure the Pad to transmit *only* x- and y-axis touch panel messages - on channel 1.) The first controller number is preset in the on- screen window prior to performance. IMPORTANT: As part of initial setup (once the run has started), touch the pad in the *topmost center position*; this will place the initial sound front-and-center. The Pad is performed either by dragging a finger over the surface, or by simply touching the pad in different positions. In the latter case especially, the Pan Lag Factor control is crucial. This control is both preset on-screen to an initial desired value, and varied during performance. Activity on the KAOSS Pad can be intermittent; the only requirement is that perceived spatial movement not be sudden or jerky. Also, the KAOSS Pad can optionally be assigned to a second performer. Since Csound currently only permits a single MIDI input, the two MIDI outputs must be combined into one. Three methods are available: 1) The simplest method is available whenever one of the MIDI devices has a MIDI Thru or MIDI In connector that will accept input from the other device. For this to work, the receiving device must also be capable of *MIDI merge*; some devices have this capability, others don't. Unfortunately, neither of the KAOSS models do, so this feature must be offered by your *other* MIDI device. 2) This method is the most universal, and will work as long as you can get both MIDI signals into your computer. Download (http://www.midiox.com) and install both MidiOx and MidiYoke. These utilities are free, and simple to use. They combine two or more MIDI data streams and present them to Csound as a single MIDI input. (MidiOx does many other fascinating things too - for example, enabling the *computer keyboard* to generate MIDI data.) The key (in MIDI Yoke) is to specify the MIDI devices you wish to combine, as "MIDI *Inputs*," and MIDI Yoke Junction 1 as the "MIDI *Output*." Then, in Csound, select MIDI Yoke Junction 1 as your MIDI *In* device. 3) The third option applies only when both devices use 5-pin DIN (traditional MIDI) connectors and cables: a simple, self-powered MIDI Merge/ Thru box with at least two MIDI inputs and one MIDI output. A few of these diverse boxes even adapt MIDI output to USB. Finally, *any* MIDI device that comprises two continuous controllers (with successive numbers) could substitute for the KAOSS Pad in these versions. In particular, a simple X/Y joystick will work well - especially if not spring- loaded. To convert joystick data to MIDI (which is required), run the handy (and free) MIDI Joystick v1.1 utility (by Hubi!) found at: http://members.magnet.at/hubwin/midi.html (MDJSTK11.ZIP). Set the X and Y axes for Channel 1 and Controllers 12 and 13 (or whatever pair of numbers you want to specify under "KAOSS 1st Cont #"). Select MIDI Yoke Junction 1 as "Out". Whatever spatial controller you use, be sure that sound starts in the front- and-center position, and moves smoothly throughout performance. OTHER KAOSS PAD SUBSTITUTES - THE "G" VERSIONS Light4G and light4aG are basically "poor person's KAOSS Pad substitutes" that duplicate the KAOSS Pad versions described above. They should be selected only when a KAOSS Pad is unavailable and quad panning is desired. Suffice it to say that you will find the KAOSS Pad versions to be far more user-friendly and intuitive. (This is probably true of the X/Y joystick option as well.) The "G" stands for "graphics," and these versions are performable by any graphics pad, preferably in "pen mode." They will also work, however, in "mouse mode," or indeed (when pressed into service) with *any mouse or touchpad* as spatial controller. (Since none of these controllers involve MIDI, MidiOx and MidiYoke are not required.) The following recommendations/ instructions apply: 1) The "G" versions require CsoundAV v0.0432 or later. 2) Screen resolution must be one of the following: 640x480, 800x600, 1024x768 or 1152x864 (note that these are all 4:3 aspect ratios). The default resolution for "G" version performance is 800x600. ("G" versions are the only ones for which screen resolution is an issue.) If you prefer any *other* screen resolution, you must edit your .csd file by substituting the corresponding screen *width* as the init value for *giwidth* shortly after the beginning of the CsInstruments section. (Specify screen width only, not height.) 3) In Taskbar Properties, uncheck "Always on top" (and "Auto hide"). (Right-click on taskbar, choose "Properties.") 4) With graphics pad, "Pen mode" is recommended (and full-screen window). 5) All on-screen controls are *preset* in these versions. Only event "Start(/Stop)" boxes/buttons are clicked during actual performance. 6) When using a pen, set the tip feel/response to as firm as possible. This will help avoid unwanted clicks on the numerous controls present in the performance window. For the same reason, use a very soft touch when tapping the window (in contrast to dragging) during performance. 7) Avoid the extreme top and bottom of the performance window: a) the top title bar is inactive (watch out where you enter and leave it), and you can easily drag/reposition the window; b) the bottom edge is likewise (dangerously) draggable, so you can inadvertently either resize the window or minimize it (by clicking on what's below). Any of these occurrences can be fairly disastrous. 8) Before beginning, set the pointer at the top of screen, center (but not in the title bar!) This will produce initial sound front-and-center. 9) In performance, be careful to move only the pointing device (pen, mouse, touchpad) you intend. Remember that all these devices are simultaneously active. 10) In other respects, proceed as for the KAOSS Pad versions.