Njb/MUS220a/FinalProject

From CCRMA Wiki
Jump to: navigation, search

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;
  }


ChucK Files

Ork.ck The main controllable instance of a single Ork. To add multiple Orks, simply add multiple shreds of the ChucK file.

Orkestra.ck The Orkestra class that allows global parameters and real-time update control (Conductor). You must add this as a shred first before any Orks are sporked!

Who-ra.ck A unison chant that gets sent to all 16 output speaker channels

Conductor.ck Gives examples of what you can do to update the Orkestra in real-time. Simply uncomment one of the desired modifications and add Shred. For example, it is possible to increase, decrease, or mute of volume level on a channel by channel basis.

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 large numbers of controllable channels by 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, and a sync/no sync quantization. From there, the conductor control can be used to update the global parameters in real-time. The controllable global parameters and examples of what can be done 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) Edit Preferences and select the running folder to be where ever the code is stored on the compute
   3) Open Orkestra.ck, Ork.ck, Who-ra.ck, and Update.ck
   4) Add Shred Orkestra.ck
   5) Add Shred Ork.ck
   6) Listen to the looping pattern.
   7) Add addition Ork.ck shreds on top with varying rhythm
   8) Add Shred Update if needed to manipulate the parameters
   9) Add Shred Who-ra.ck
   10) Assemble Orkestra ...and concur the world

CHUCK AND AUDIO FILES TO DOWNLOAD

Chuck/Audio Files (zip) Chuck/Audio Files (rar)

OR

Access the files via ~njb/Library/Web/220a/final_project/code_and_audio