Live Events

Live Events are one of the more interesting features of CsoundQt. In its original form, Csound was designed to compile your orchestra and score code before producing output. Real-time input, for example from a MIDI keyboard, is now quite practical, as explained in Chapter 10—but MIDI places some limitations on how notes can be defined. Specifically, each note is associated with only two control parameters: its note number and velocity. The note events in your score, in contrast, can have many p-fields, but they must be compiled before Csound starts to play.

Live Events give you a simple, flexible way to type, edit, and trigger score events, in standard i-statement format, while Csound is running. Andrés Cabrera has uploaded three videos to You-Tube that give an introduction to using Live Events. You can easily find them by using the You-Tube search box and searching for QuteCsound (yes, under that name—at this writing, the YouTube videos haven’t been re-tagged with the new name), or go directly to www.youtube.com/watch?v=O9WU7DzdUmE.

In Csound Power! we’ll take a slightly more detailed look at the features of Live Events.

Live Events have two main uses. First, you can use Live Events as part of an improvised live performance. Second, they’re good for prototyping score sections. You can create a list containing an arbitrary number of note events and then edit the list while it plays back over and over in a loop. When you get to a phrase that has the characteristics you want, you can copy the events into your actual score (and perhaps adjust the p2 times as needed).

The main limitation to be aware of, before you get too excited about using Live Events live, is that at present Live Events have no way to sync loops to one another or to a master clock. (CsoundQt is not, let’s admit, going to compete with Ableton Live in the synced loops department. At least, not until you do quite a lot of coding by hand. A future version of CsoundQt may take this feature much further, however.) But if your music makes use of sustained sheets of sound or scattered sounds whose precise rhythmic relations are not crucial, using Live Events onstage might be an area that’s well worth exploring.

To start your experiments with Live Events, you might want to create a .csd file something like the one below. (As in other examples in this book, the outer tags and the standard orchestra header have been omitted.)


  giSine ftgen 0, 0, 8192, 10, 1

  instr 1
  idur = p3
  iamp = p4
  ifreq cpsxpch p5, 19, 2.0, 27.5
  iatk = p6
  irel = 0.1
  isus = idur - iatk
  index = p7
  ipan = p8

  kamp linsegr 0, iatk, iamp, isus, iamp, irel, 0
  kindex linsegr 0, iatk, index, isus, index * 0.2, irel, 0
  asig foscil kamp, ifreq, 1, 1, kindex, giSine
  aoutL, aoutR pan2 asig, ipan
  outs aoutL, aoutR
  endin

  </CsInstruments>
  <CsScore>
  e 3600

This instrument gives us several p-fields (duration, amplitude, frequency in octave/pitch-class format, attack time, FM index, and pan position) with which to experiment using Live Events. I chose to use cpsxpch to create 19-tone equal temperament simply because this is an interesting scale to play with. The last line is the only line in the score. An e-statement with a p-field value will cause Csound to run for that number of seconds—in this case, for an hour, which should be plenty.

When you click the Live Events icon in the toolbar, the LE Controller window will open (see Figure 5.7). Initially the list in this window will be empty. To create a new Live Events score sheet, click the New button. A score sheet that looks somewhat like the one in Figure 5.8 will appear. You can give the sheet a name by clicking in the Name field in the LE Controller window or by choosing Rename from the Menu in the Live Events score sheet window itself.

The empty score sheet will have one line and columns for five p-fields, so your first order of business will be to add a few lines and, if you’re using something like the instrument used in the code above, more columns for p-fields. To do this, right-click (Mac: Control-click) in the empty area of the box. From the pop-up menu, choose Add Columns, type 3 in the dialog box, and hit Return or Enter. Do the same thing to create some event rows.

Figure 5.7 The LE Controller window displays an interactive list of your Live Events score sheets.

image

Figure 5.8 A new Live Events score sheet, in which you can create Events by typing.

image

Add some values to your Live Events sheet—perhaps something like the events shown in Figure 5.9. After doing this, click the Run button in the main CsoundQt window. If you remembered to include a suitable p-field as part of the e-statement in your score, CsoundQt will begin running silently. In the LE Controller window, click the small green triangle (the Play button) on the line where your Live Events sheet is displayed. The events you’ve entered should play back. When you click the Play button again, the events will play again. In fact, you can click it several times quickly, and several iterations of the data in your score sheet will play, overlapping one another.

Figure 5.9 A Live Events score sheet with data entered in a number of columns and rows.

image

image

Tip A Live Events list starts playing not when you click on the Play button or Loop checkbox for the Events score sheet but when you release the mouse button. With a little practice, you can achieve reasonable (though not perfect) synchronization between rhythmic loops by pressing the mouse or trackpad button a little early and then lifting your finger at the right moment.


Editing Live Events

The right-click menu for a Live Events sheet contains a number of commands with which you can edit groups of values all at once, very much as if they were in cells in a spreadsheet program. You can select a column of cells by clicking on its header (p4, p5, and so on) or select a range of cells within a column or row by dragging across it with the mouse. Having done this, you can add, subtract, multiply, divide, randomize, rotate, reverse, or shuffle the values in the cells, or fill the cells with an arbitrary value.

In the example in Figure 5.9, for instance, you could select the p5 column, right-click on a cell in the column (not on the column header), choose Add from the menu, type 1, and hit Enter or Return. Because this p-field uses Csound’s octave/pitch-class format for the data, adding 1 would transpose the notes upward by an octave.

The dialog box for the Fill Cells command has a Mode field. A mode of 1 creates a linear fill between the first and last values you enter. Modes higher than 1 create progressively more exponential (that is, concave) curves, while modes between 0 and 1 create logarithmic (that is, convex) curves. This is an extremely useful feature.

As you’ll find while exploring loop playback, edits that you make using these commands will not be heard until the next time the loop starts playing. Essentially, this is because CsoundQt is sending the entire contents of a given Live Events list to Csound at the same time. Once the list has started playing, it can no longer be interrupted.

Events in a Live Events list can also be viewed as text, by choosing Text instead of Sheet in the little window’s View menu.

The Menu header in the upper-left corner has commands for New Frame (which creates a new, empty list, duplicating the function of the New button in the LE Controller window), Clone Frame, Delete Frame, Rename, and Mark Loop. The Delete Frame command in this menu is currently the only way to get rid of a list that you no longer want; it can’t be deleted from the LE Controller window. The Mark Loop command can be used after dragging across one or more rows with the mouse. You can also edit the loop range in the LE Controller window.

The Clone Frame command creates a copy of the entire score sheet—very handy for making alternate versions of a Live Events list. (You can also copy and paste events from one sheet to another.)

Playback and Looping of Live Events

While Csound is running, you can trigger Live Events sheets, edit their tempo, change their data values, and—if a phrase is looping—change the loop length and loop range. Changes will be heard only on the next repetition of the phrase.

The loop length, which is in beats based on the tempo set for the Live Events sheet, is independent of the durations and timings of the events in the loop. If an event list lasts for 16 beats, for instance, you could set a loop length of only 5 beats, 11 beats, or whatever. The new iteration of the loop will start before the last one finishes. Conversely, if the event list ends before the loop finishes, there will be some silence before the new iteration of the loop starts playing. The loop length does not have to be an integer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.79.241