mirror of
https://github.com/thestk/stk
synced 2026-01-17 22:51:53 +00:00
Version 4.4.0
This commit is contained in:
committed by
Stephen Sinclair
parent
d199342e86
commit
eccd8c9981
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "SineWave.h"
|
||||
#include "RtWvOut.h"
|
||||
using namespace stk;
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -9,6 +10,7 @@ int main()
|
||||
Stk::setSampleRate( 44100.0 );
|
||||
Stk::showWarnings( true );
|
||||
|
||||
int nFrames = 100000;
|
||||
SineWave sine;
|
||||
RtWvOut *dac = 0;
|
||||
|
||||
@@ -22,8 +24,19 @@ int main()
|
||||
|
||||
sine.setFrequency( 441.0 );
|
||||
|
||||
// Play the oscillator for 40000 samples
|
||||
for ( int i=0; i<40000; i++ ) {
|
||||
// Option 1: Use StkFrames
|
||||
/*
|
||||
StkFrames frames( nFrames, 1 );
|
||||
try {
|
||||
dac->tick( sine.tick( frames ) );
|
||||
}
|
||||
catch ( StkError & ) {
|
||||
goto cleanup;
|
||||
}
|
||||
*/
|
||||
|
||||
// Option 2: Single-sample computations
|
||||
for ( int i=0; i<nFrames; i++ ) {
|
||||
try {
|
||||
dac->tick( sine.tick() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user