Difference between revisions of "FaustWorkshop2014"

From CCRMA Wiki
Jump to: navigation, search
(Day 1)
(Day 1)
Line 18: Line 18:
 
myOsc(frequency,gain) = osc(frequency)*(smoothGain)  
 
myOsc(frequency,gain) = osc(frequency)*(smoothGain)  
 
with{
 
with{
 +
        // the smooth(0.999) function interpolates the different values of gain so that it doesn't click
 
smoothGain = gain : smooth(0.999);
 
smoothGain = gain : smooth(0.999);
 
};
 
};
Line 45: Line 46:
 
import("filter.lib");
 
import("filter.lib");
  
 +
// the metadata "[style:knob]" turns the horizontal slider into a knob
 
pan = hslider("pan [style:knob]",0.5,0,1,0.01) : smooth(0.999);
 
pan = hslider("pan [style:knob]",0.5,0,1,0.01) : smooth(0.999);
  
Line 62: Line 64:
 
gain = hslider("gain",0,0,1,0.01) : smooth(0.999);
 
gain = hslider("gain",0,0,1,0.01) : smooth(0.999);
 
freq = hslider("freq",440,50,1000,0.1) : smooth(0.999);
 
freq = hslider("freq",440,50,1000,0.1) : smooth(0.999);
 +
// the smooth function can be used as a simple envelope generator for gate
 
gate = button("gate") : smooth(0.999);
 
gate = button("gate") : smooth(0.999);
  
 
process = osc(freq),osc(freq*2),osc(freq*3) :> *(gain)*gate <: _,_;
 
process = osc(freq),osc(freq*2),osc(freq*3) :> *(gain)*gate <: _,_;
 
</pre>
 
</pre>

Revision as of 08:47, 8 July 2014

Day 1

Optional textbook to go further: http://www.amazon.com/Physical-Audio-Signal-Processing-Instruments/dp/0974560723

Simple Sine Oscillator Synthesizer

import("music.lib");
import("filter.lib");

g = hslider("myParameter",0,0,1,0.01);
freq = hslider("frequency",440,50,1000,0.1);

myOsc(frequency,gain) = osc(frequency)*(smoothGain) 
with{
        // the smooth(0.999) function interpolates the different values of gain so that it doesn't click
	smoothGain = gain : smooth(0.999);
};

process = myOsc(freq,g) ;

Working with Signals

process = _ <: _,_,_,_ :> _;

is the same as:

process = _ <: _+_+_+_;

Simple Panner

import("filter.lib");

// the metadata "[style:knob]" turns the horizontal slider into a knob
pan = hslider("pan [style:knob]",0.5,0,1,0.01) : smooth(0.999);

process = _ <: *(pan),*(1-pan);

Additive Synthesizer

import("music.lib");
import("effect.lib");

gain = hslider("gain",0,0,1,0.01) : smooth(0.999);
freq = hslider("freq",440,50,1000,0.1) : smooth(0.999);
// the smooth function can be used as a simple envelope generator for gate
gate = button("gate") : smooth(0.999);

process = osc(freq),osc(freq*2),osc(freq*3) :> *(gain)*gate <: _,_;