SGRAN2

Stochastic granular synthesizer

in RTcmix/insts/std


quick syntax:

SGRAN2(outsk, dur, AMP, RATELOW, RATEMID, RATEHIGH, RATETIGHT,DURLOW, DURMID, DURHIGH, DURTIGHT,FREQLOW, FREQMID,FREQHIGH, FREQTIGHT, PANLOW, PANMID, PANHIGH, PANTIGHT, WAVETABLE, GRAINENV, [, maxgrains])

CAPITALIZED parameters are pfield-enabled for table or dynamic control (see the maketable or makeconnection scorefile commands). Parameters after the [bracket] are optional and default to 0 unless otherwise noted.

Param Field Parameter Units Dynamic Optional Notes
p0 output start time seconds no no  
p1 total duration seconds no no  
p2 amplitude absolute, for 16-bit soundfiles: 0-32768 yes no  
p3 grain rate low seconds per grain yes no  
p4 grain rate mid seconds per grain yes no  
p5 grain rate high seconds per grain yes no  
p6 grain rate tight - yes no >1, tighter preference, btwn 0 and 1, inverted preference
p7 grain dur low seconds yes no  
p8 grain dur mid seconds yes no  
p9 grain dur high seconds yes no  
p10 grain rate tight - yes no >1, tighter preference, btwn 0 and 1, inverted preference
p11 grain freq low Hz or oct.pc yes no  
p12 grain freq mid Hz or oct.pc yes no  
p13 grain freq high Hz or oct.pc yes no  
p14 grain freq tight - yes no >1, tighter preference, btwn 0 and 1, inverted preference
p15 grain pan low 0.0-1.0 yes no  
p16 grain pan mid 0.0-1.0 yes no  
p17 grain pan high 0.0-1.0 yes no  
p18 grain pan tight - yes no >1, tighter preference, btwn 0 and 1, inverted preference
p19 wavetable reference to pfield table-handle yes no  
p20 grain amp env reference to pfield table-handle yes no  
p21 max grain limit number no yes default: 1500

Parameters labled as Dynamic can receive dynamic updates from a table or real-time control source.

Author: Kieran McAuliffe, 2023.


SGRAN2 is a granular synthesizer, with pfield control and improved performance after Mara Helmuth’s SGRANR (SGRANR) and original sgran.

Usage

SGRAN2 can produce either stereo or mono output.

Sample Score

   rtsetparams(44100, 2)
   load("SGRAN2")

   outskip = 0
   dur = 15

   amp = maketable("line", 1000, 0, 0, 8, 0.8, 16, 1, 17, 0)

   ratelo = 0.004
   ratemid = 0.005
   ratehi = 0.007
   rateti = maketable("line", "nonorm", 200, 0, 8, 1, 0.2)

   durlo = 0.01
   durmid = 0.05
   durhi = 0.08
   durti = 0.1

   freqlo = maketable("line", "nonorm", 200, 0, 400, 1, 200)
   freqmid = maketable("line", "nonorm", 200, 0, 430, 1, 350, 2, 600)
   freqhi = maketable("line", "nonorm", 200, 0, 440, 1, 460, 2, 800)
   freqti = maketable("line", "nonorm", 200, 0, 6, 1, 0.2)

   panlo = 0
   panmid = maketable("line", "nonorm", 200, 0, 0.1, 1, 0.1, 2, 0.5)
   panhi = maketable("line", "nonorm", 200, 0, 0.2, 1, 0.5, 2, 1)
   panti = 0.4

   wave = maketable("wave", 1000, "square")
   env = maketable("window", 1000, "hanning")

   SGRAN2(outskip, dur, 800 * amp, ratelo, ratemid, ratehi, rateti, durlo, durmid, durhi, durti, 
   freqlo, freqmid, freqhi, freqti, panlo, panmid, panhi, panti, wave, env)

Examples

First

Second


See Also

SGRANR,STGRANR, GRANSYNTH, JGRAN, GRANULATE, JCHOR,