Difference between revisions of "Njb/MUS220a/FinalProject"

From CCRMA Wiki
Jump to: navigation, search
('''REAL-TIME CONTROL''')
Line 41: Line 41:
 
       left/power => g[1].gain;
 
       left/power => g[1].gain;
 
   }
 
   }
 +
 +
=='''CODE OVERVIEW'''===
 +
An Orkestra class is used to initialize input control to each instance of an Ork.  For each instance, 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.
 +
 +
    Master Volume
 +
    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'''===
 +
 +
 +
==='Global Parameters'===
  
  
 
=='''REAL-TIME CONTROL'''==
 
=='''REAL-TIME CONTROL'''==
  
Real-time input control over global parameters (master volume, looping rate, rate of panning, and direction of panning) to each spork (or Ork-looping voice) can be done using reference variables as inputs to each function while using the keyboard to control the values similar to the [http://chuck.cs.princeton.edu/doc/examples/hid/keyboard-organ.ck keyboard organ].
+
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'''==
 
=='''RECORDED SOUNDS'''==

Revision as of 16:14, 7 December 2007

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

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. For each instance, 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.

   Master Volume
   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=

'Global Parameters'

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