Difference between revisions of "Njb/MUS220a/FinalProject"

From CCRMA Wiki
Jump to: navigation, search
('''LIVE CODING PERFORMANCE''')
('''CODE OVERVIEW''')
Line 43: Line 43:
  
 
=='''CODE OVERVIEW'''==
 
=='''CODE OVERVIEW'''==
An Orkestra class is used to initialize input control to each instance of an Ork.  The Orkestra class can be modified to allow an effectively infinite number of controllable channels.  currently four channels of globally controllable Orks are used. For each instance of an Ork, the channel, the pitch range, a sync quantization can be selected as well as the global initial values are sent from the Orkestra class to the Ork.  From there, an update control can be used to update the global parameters in real-time. The controllable global parameters are shown below.
+
An Orkestra class is used to initialize input control to each instance of an Ork.  The Orkestra class can be modified to allow a large number of controllable channels be increasing the array sizes for each parameterCurrently five channels of globally controllable Orks are used. In addition to the globally controllable parameters, each instance of an Ork gets assigned a channel number, the pitch range, a sync/no sync quantization.  From there, an update control can be used to update the global parameters in real-time. The controllable global parameters are shown below.
  
 
     Master Volume
 
     Master Volume

Revision as of 20:10, 7 December 2007

Ch-Ork-Estra: Strongly-timed, Concurrent, and On-the-fly Orkestra

IDEA/CONCEPT

To implement a dynamically controllable set of ChucK programs for the purpose of live performance, synchronization, and orchestration of previously recorded short duration loop-able audio files. As an example of performance, human grunting sounds recorded from the home-brew microphone are used to create images of the underworld in the CCRMA 16-channel Listening Room. The grunting sounds of the audio files paint a clear image of orks marching around a desolate land working on medieval devices (similar to many scenes from the Lord of the Rings).


PROCESS/DESIGN

Thirty individual grunting sounds (Grunt.wav) (10 short, 10 medium, and 10 long) were recorded into Audacity as a single stream. The files were then cut up into isolated events and saved with a numerical naming convection. Three folders were created to organize and store each class of recorded sounds (using folder names 1,2,3) as well. The naming convection allows for easy manipulation and access within the ChucK programing language.


Once all of the files are ready, the SndBuf command in ChucK can be used to playback the files. For variation, a random number generator can be used to pick a random file among the folders and set a random playback rate (slower for lower grunts, faster for higher grunts). The playback of a single sample can then be looped and added together with other samples, all in a synchronized fashion (similar to moe.ck, larry.ck, and curly.ck files found in the ChucK distribution).

Synchronization in ChucK:

   //Define time duration
   .5::second => dur T;
   //Synchronize
   T - (now % T) => now;

For performance, quantization synchronization is only allowed on certain voices while allow others to simply loop periodically (not strongly synchronized or in phase). By varying the synchronization quantization, playback rates, tempo, volume, panning, and the number of simultaneous sample playback very interesting/exciting sounds result.


To paint the image of an underworld filled with Orks marching around, the 16-channels of discrete audio must be used intelligently with dynamic panning abilities (specific to CCRMA Listening Room). Within the listening space, four channels are spatially spaced below the listener, four above, and eight all around. The lower four channels are used for larger sounding (slower play rate) samples as in a dungeon, where as the upper four channels are used for the smaller (faster play rate) sounding samples. The middle eight channels are used for mid-range sounds. Occasionally, overlap occurs for the specific reason of sounding like an army marching around.


To simulate marching, each looping sample playback must gradually move from one speaker to the next making a circular pattern within its respective speaker range.

Feet.JPG

To do this ideally, 16 individual gain values should be used to equal-power-pan a single sample playback. Unfortunately, this requires an array of 16 gain unit-generators for a single sample playback, limiting the overall number of voices allowed in ChucK. To avoid this issue and take advantage of the simple panning requirement of moving in a circle, only two gain values can be used with a dynamically updating assignment to which channel the output audio feeds into using the chuck and unchuck commands. This allows the voices to freely move around in a circle using only two gain coefficients and reduces the panning problem to an simple equal-power panning for two channels.

Equal-power panning function in ChucK:

  fun void stereopan(Gain g[],float panvalue)
  {  //panvalue can be between [-1,1]
     panvalue/2.0+.5 => float left;
     1.0-left => float right;
     Math.sqrt(left*left + right*right) => float power;
     right/power => g[0].gain;
     left/power => g[1].gain;
  }

CODE OVERVIEW

An Orkestra class is used to initialize input control to each instance of an Ork. The Orkestra class can be modified to allow a large number of controllable channels be increasing the array sizes for each parameter. Currently five channels of globally controllable Orks are used. In addition to the globally controllable parameters, each instance of an Ork gets assigned a channel number, the pitch range, a sync/no sync quantization. From there, an update control can be used to update the global parameters in real-time. The controllable global parameters are shown below.

   Master Volume
        [.1] soft
        [1]  loud
   Panning Rate
        [.1] slower pan
        [2]  faster pan (going from one speaker to the next each grunt)
   Panning Direction (Clockwise or Counter Clockwise)
        [-1] Clockwise
        [1]  Counterclockwise 
   Elevation (any two speaker channels to repeat between.  
        [0,3] low elevation
        [4,11] middle elevation
        [12,15] high elevation
        [0,15] marches up a mountain from low to high or high to low depending on direction

LIVE CODING PERFORMANCE

To get an Orkestra performance up and running do the following:

   1) Start ChucK
   2) Open Orkestra, Ork, and Update Control
   3) Add Shred Orkestra
   4) Add Ork
   5) Modify the parameters with update control

REAL-TIME CONTROL

Real-time input control over global parameters (master volume, looping rate, rate of panning, direction of panning, and elevation) can be done using reference variables.

RECORDED SOUNDS

Short Duration Grunts (zip)

Medium Duration Grunts (zip)

Long Duration Grunts (zip)


FINAL CHUCK FILES