[Stk] Mandolin class
Liam Kelly
liamdotcom_@hotmail.com
Sat, 15 Mar 2003 11:19:25 -0000
Hi
Firstly congratulations on a really helpful resource. Have been getting
very much into the STK recently and being a newcomer to music DSP and
indeed C++ I have found it most accessible.
My main interests in the STK are the waveguide physical modelling
classes as I am currently writing a thesis on this. I have been trying
to get the Mandolin commuted model going but have so far not managed to
produce anything sounding musical. If anyone can help I would be very
grateful. My code is at the bottom.
Also if anyone knows of any other resources of impulse responses for
commuted synthesis I would be *extremely* grateful as I hope to produce
a commuted waveguide synthesiser VST plugin as part of my project.
Thanks for reading
/***********************************************************************
**/
#include "WvOut.h"
#include "Mandolin.h"
int main()
{
// Set the global sample rate before creating class instances.
Stk::setSampleRate( 44100.0 );
Mandolin *input = 0;
WvOut *output = 0;
MY_FLOAT frequency, amplitude;
try {
input = new Mandolin( 50 );
output = new WvOut( "mandolin.wav", 1, WvOut::WVOUT_WAV,
Stk::STK_SINT16 );
}
catch ( StkError & ) { goto cleanup; }
input->setBodySize(1.0);
frequency = 100;
amplitude = 0.1;
input->noteOn(frequency, amplitude);
for ( int i=0; i<120000; i++ )
{
try {output->tick( (input->tick() ) ); }
catch ( StkError & ) { goto cleanup; }
}
cleanup:
delete input;
delete output;
return 0;
}