« Return to Thread: Cross Fading problems

Re: Cross Fading problems

by scacinto :: Rate this Message:

Reply to Author | View in Thread

Hi Robert Pierzak,

Every time you write "Synth(..." you are creating a new instance of whatever synth you are calling.  Synth("whatever") is just shorthand for Synth.new("whatever"). (that info is in the help file)

The below code creates two synths, waits 0.03 seconds then creates two new synths, one with a gate of 1, the other a gate of 0.  Then, in the 7.do function, you create more new synths, and on and on.  

What you must do is a) read the SynthDef and Synth help files, and b) create a variable to reference the the synths by ( x = Synth.new(...  then x.set(\gate, 0) ) or create them explicitly using the server messaging syntax.

Make sense?

Cheers,

SP(e)



P.S. "there's a pattern for that."


mayortacoghost wrote:
                Synth.new("fade-out");
                Synth.new("fade-in");
                0.03.wait;
                Synth("fade-in").set(\gate, 1);
                Synth("fade-out").set(\gate, 0);
               
                7.do{
               
        Synth("sine-test",[\freq_sine, 400, \peak_amp_sine, 0.8]);
       
        Synth("saw-test",[ \freq_saw, 600, \peak_amp_saw, 0.8]);

        5.wait};

       

        loop( {
       
        Synth("saw-test",[ \freq_saw, 600, \peak_amp_saw, 0.8]);

        5.wait

})
});

)

a.play;
______________________________

Scott Petersen
Assistant Director, YalMusT
Music Technology Specialist
Department of Music
Yale University, New Haven, CT 06511
United States

 « Return to Thread: Cross Fading problems