jmslexamples
Class GrainMaker

java.lang.Object
  extended by jmslexamples.GrainMaker

public class GrainMaker
extends java.lang.Object


   Generate a CSound score file using statistical distributions of grains read from input sound file

  Example of one line of output:
 ; ins          strt    dur     amp     skip             atk            rel             pan
    i1    0     0.01   .5       0       .0025    .0025  0.5


  Assumes a CSound orc file like the following, where "aiff\marimba.aif" is the source for grains and has length 0.126 sec.

 sr = 44100               ; audio sampling rate is 44.1 kHz
 kr = 4410                 ; control rate is tenth that Hz
 ksmps = 10               ; number of samples in a control period (sr/kr)
 nchnls = 2                 ; number of channels of audio output

  instr 1
     idur        =    p3
     iamp        =    p4
     iskiptime   =    p5   
     iattack     =    p6
     irelease    =    p7
     ipan                        =              p8               
     kamp        linen      iamp, iattack, idur, irelease  
     asig        soundin   "aiff\marimba.aif", iskiptime
     arampsig    =   kamp * asig           
     outs      arampsig * ipan, arampsig * (1-ipan)
  endin     

Author:
Nick Didkovsky

Constructor Summary
GrainMaker()
           
 
Method Summary
 double getInDur()
           
 double getMaxGrainDur()
           
 double getMinGrainDur()
           
 int getNumGrains()
           
 int getNumSplatters()
           
 double getOutDur()
           
 double getSpread()
           
 boolean getUseGauss()
           
static void main(java.lang.String[] args)
           
 void makeGrains()
          Top level method.
 void setInDur(double n)
           
 void setMaxGrainDur(double n)
           
 void setMinGrainDur(double n)
           
 void setNumGrains(int n)
           
 void setNumSplatters(int n)
           
 void setOutDur(double n)
           
 void setSpread(double n)
           
 void setUseGauss(boolean b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrainMaker

public GrainMaker()
Method Detail

setNumSplatters

public void setNumSplatters(int n)

setNumGrains

public void setNumGrains(int n)

setSpread

public void setSpread(double n)

setOutDur

public void setOutDur(double n)

setInDur

public void setInDur(double n)

setMaxGrainDur

public void setMaxGrainDur(double n)

setMinGrainDur

public void setMinGrainDur(double n)

setUseGauss

public void setUseGauss(boolean b)

getNumSplatters

public int getNumSplatters()

getNumGrains

public int getNumGrains()

getSpread

public double getSpread()

getOutDur

public double getOutDur()

getInDur

public double getInDur()

getMaxGrainDur

public double getMaxGrainDur()

getMinGrainDur

public double getMinGrainDur()

getUseGauss

public boolean getUseGauss()

makeGrains

public void makeGrains()
Top level method. Blast a number of bursts of grains into and output score file


main

public static void main(java.lang.String[] args)