Hi,<br>I am still experiencing the same problems. I have understood the general principle, writing an array 2 spaces wide an computing the 2 samples this way, but I still can&#39;t get something simple as monophonic sound for testing purpose. And I also can&#39;t get different signals on both speakers. I also have a question about the code from Gregoire Davy, what is the meaning of the pPan function? I can&#39;t find a declaration in the STK Class overview. I am asuming that mySound is the data pointer?<br>
<br>Well, here is the code. Perhaps it&#39;s only a very simple mistake and I am too blind to see it.<br>
<br>#include &quot;SineWave.h&quot;<br>#include &quot;RtAudio.h&quot;<br>#include &quot;RtWvOut.h&quot;<br>#include &lt;cstdlib&gt;<br><br>using namespace stk;<br>using std::min;<br>// This tick() function handles sample computation only.  It will be<br>

// called automatically when the system needs a new buffer of audio<br>// samples.<br>int tick_c( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *dataPointer )<br>

{<br>  SineWave *sine = (SineWave *) dataPointer;<br>  register StkFloat outs[2];<br>  register StkFloat *samples = (StkFloat *) outputBuffer;<br>  int i,nTicks = (int) nBufferFrames;<br>  <br>  for (i=0; i&lt;nTicks; i++ ){<br>

    for( int h=0;h&lt;1;h++)<br>      {<br>      //*samples = 0; //if it&#39;s not outcomment I get an error when exiting the programm<br>      outs[h] = sine-&gt;tick();<br>      outs[h+1] = (sine-&gt;tick())*0;  //Should mute the right speaker - but it doesn&#39;t<br>

      *samples++ = outs[h];<br>      *samples++ = outs[h+1];}<br>    //samples++; //if it&#39;s not outcomment I get noise<br>  }<br>  return 0;<br>}//end callback function<br><br><br>int main()<br>{<br>  // Set the global sample rate before creating class instances.<br>

  Stk::setSampleRate( 48000.0 );//Standard: 44100<br>  SineWave sine;<br>  RtAudio dac;<br><br>  RtAudio::StreamParameters parameters;<br>  RtAudio::DeviceInfo devInfo;<br>  devInfo = dac.getDeviceInfo(dac.getDefaultOutputDevice() );<br>

<br>  // Figure out how many bytes in an StkFloat and setup the RtAudio stream.<br>  parameters.deviceId = dac.getDefaultOutputDevice();<br>  parameters.nChannels = 2; //outputchannel = 2<br>  parameters.firstChannel = 0;<br>

  RtAudioFormat format = ( sizeof(StkFloat) == 8 ) ? RTAUDIO_FLOAT64 : RTAUDIO_FLOAT32;<br>  sine.setFrequency(500);<br>  <br>  unsigned int bufferFrames = RT_BUFFER_SIZE;<br><br>  try {<br>    dac.openStream( &amp;parameters, NULL, format, (unsigned int)Stk::sampleRate(), &amp;bufferFrames, &amp;tick_c, (void *)&amp;sine );     <br>

  }<br>  catch ( RtError &amp;error ) {<br>    error.printMessage();<br>    goto cleanup;<br>  }<br>  try {<br>    dac.startStream();<br>  }<br>  catch ( RtError &amp;error ) {<br>    error.printMessage();<br>    goto cleanup;<br>

  }<br><br>  // Block waiting here.<br>  char keyhit;<br>  std::cout &lt;&lt; &quot;\nPlaying ... press &lt;enter&gt; to quit.\n&quot;;<br>  std::cin.get( keyhit );<br><br>  // Shut down the output stream.<br>  try {<br>
    dac.closeStream();<br>
  }<br>  catch ( RtError &amp;error ) {<br>    error.printMessage();<br>  }<br><br> cleanup:<br><br>  return 0;<br>}<br>