# Difference between revisions of "ChucK/stereo noise.ck"

From CSWiki

Line 1: | Line 1: | ||

− | // the patch, note pan2 is stereo | + | // the patch, note pan2 is stereo |

− | noise n => pan2 p; | + | noise n => pan2 p; |

− | p.chan(0) => JCRev l => dac.chan(0); | + | p.chan(0) => JCRev l => dac.chan(0); |

− | p.chan(1) => JCRev r => dac.chan(1); | + | p.chan(1) => JCRev r => dac.chan(1); |

− | .1 => n.gain; | + | .1 => n.gain; |

− | // variable | + | // variable |

− | 0.0 => float t; | + | 0.0 => float t; |

− | // smaller == smoother | + | // smaller == smoother |

− | 10::ms => dur T; | + | 10::ms => dur T; |

− | // time loop | + | // time loop |

− | while( true ) | + | while( true ) |

− | { | + | { |

// pan goes from -1 (left) to 1 (right) | // pan goes from -1 (left) to 1 (right) | ||

math.sin(t) => p.pan; | math.sin(t) => p.pan; | ||

// increment t (scaling by T) | // increment t (scaling by T) | ||

T / second * 2.5 +=> t; | T / second * 2.5 +=> t; | ||

− | + | ||

// uncomment to print out pan, last left, last right | // uncomment to print out pan, last left, last right | ||

// <<<p.pan(), dac.left.last(), dac.right.last()>>>; | // <<<p.pan(), dac.left.last(), dac.right.last()>>>; | ||

− | + | ||

// advancde time | // advancde time | ||

T => now; | T => now; | ||

− | } | + | } |

## Revision as of 02:21, 9 March 2006

// the patch, note pan2 is stereo noise n => pan2 p; p.chan(0) => JCRev l => dac.chan(0); p.chan(1) => JCRev r => dac.chan(1); .1 => n.gain;

// variable 0.0 => float t; // smaller == smoother 10::ms => dur T;

// time loop while( true ) { // pan goes from -1 (left) to 1 (right) math.sin(t) => p.pan; // increment t (scaling by T) T / second * 2.5 +=> t; // uncomment to print out pan, last left, last right // <<<p.pan(), dac.left.last(), dac.right.last()>>>; // advancde time T => now; }