[Stk] delete instrument then reuse

Gary Scavone gary@ccrma.Stanford.EDU
Sun, 2 Mar 2003 20:49:04 -0800 (PST)


Hi Dan,

Did you give the new instrument a noteOn?

--gary

On Sun, 2 Mar 2003, Dan Riley wrote:

>>Hi, I'm trying to play an instrument and then switch to a different
>>type of instrument and play it.
>>
>>So basically I have an m_instrument object and an m_output object.
>>At the beginning they are set to a BeeThree and an RTWavOut(1)
>>respectively and it works fine I get some sound. Then when I want to
>>switch the instrument, I do something like:
>>
>>delete m_instrument;
>>
>>m_instrument = new WhateverInstrument();
>>
>>however when I go back to play it I get no sound. Do I need to
>>delete and reallocate the output object as well?