本文整理汇总了C++中maxiOsc::square方法的典型用法代码示例。如果您正苦于以下问题:C++ maxiOsc::square方法的具体用法?C++ maxiOsc::square怎么用?C++ maxiOsc::square使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maxiOsc
的用法示例。
在下文中一共展示了maxiOsc::square方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: play
void play(double *output) {
CurrentCount=myCounter.phasor(1, 1, 9);//phasor can take three arguments; frequency, start value and end value.
if (CurrentCount<5)//simple if statement
myOscOutput=mySwitchableOsc.square(CurrentCount*100);
else if (CurrentCount>=5)//and the 'else' bit.
myOscOutput=mySwitchableOsc.saw(CurrentCount*50);//one osc object can produce whichever waveform you want.
if (CurrentCount==1)
myEnvelope.trigger(0,myEnvelopeData[0]); //trigger the envelope
myFilteredOutput=myFilter.lores(myOscOutput,(myEnvelope.line(6, myEnvelopeData)),10);//lores takes an audio input, a frequency and a resonance factor (1-100)
myPanPosition=myAutoPanner.sinewave(1);
myOutputs.stereo(myFilteredOutput,myStereoOutput,myPanPosition);//Stereo, Quad or 8 Channel. Specify the input to be mixed, the output[numberofchannels], and the pan (0-1,equal power).
output[0]=myStereoOutput[0];//When working with mixing, you need to specify the outputs explicityly
output[1]=myStereoOutput[1];//
}
示例2: play
void play(double *output) {
CurrentCount=myCounter.phasor(1*((another.sawn(0.1)+1)/2), 1, 9);//phasor can take three arguments; frequency, start value and end value.
if (CurrentCount<5) {//simple if statement
myOscOutput=mySwitchableOsc.square(myArray[CurrentCount]);
}
else if (CurrentCount>=5) {//and the 'else' bit.
myOscOutput=mySwitchableOsc.sawn(myArray[CurrentCount]);//one osc object can produce whichever waveform you want.
}
output[0]=myOscOutput;//point me at your speakers and fire.
output[1]=output[0];
}
示例3: play
void play(double *output) {
CurrentCount=myCounter.phasor(1, 1, 9);//phasor can take three arguments; frequency, start value and end value.
// here we use a conditional to make something happen at a specific time.
if (CurrentCount<5)//simple if statement
myOscOutput=mySwitchableOsc.square(CurrentCount*100);
else if (CurrentCount>=5)//and the 'else' bit.
myOscOutput=mySwitchableOsc.sinewave(CurrentCount*50);//one osc object can produce whichever waveform you want.
output[0]=myOscOutput;
output[1]=output[0];
}
示例4: play
void play(double *output) {
myCurrentVolume=myEnvelope.line(4,myEnvelopeData);
CurrentCount=myCounter.phasor(1, 1, 9);//phasor can take three arguments; frequency, start value and end value.
if (CurrentCount<5)//simple if statement
myOscOutput=mySwitchableOsc.square(CurrentCount*100);
else if (CurrentCount>=5)//and the 'else' bit.
myOscOutput=mySwitchableOsc.sinewave(CurrentCount*50);//one osc object can produce whichever waveform you want.
if (CurrentCount==1)
myEnvelope.trigger(0,myEnvelopeData[0]); //trigger the envelope
*output=myOscOutput*myCurrentVolume;//point me at your speakers and fire.
}