src/codeandchords/PortAudioAudioIO.java
private void runRealTime() {		
		AudioContext context = getContext();

		int bufferSizeInFrames = context.getBufferSize();

		float[] interleavedOutput = new float[this.numOutChannels * bufferSizeInFrames];

		while (context.isRunning())
		{
			update(); // this propagates update call to context
			for (int i = 0, counter = 0; i < bufferSizeInFrames; ++i) {
				for (int j = 0; j < this.numOutChannels; ++j) {
					interleavedOutput[counter++] = (int) context.out.getValue(j, i);
				}
			} // for - i

			// TODO: maybe just write for availableToWrite, not whole buffer?
			if(outStream == null)
			{
				throw new IllegalArgumentException("PAAIO.runRealTime: outStream is null.");
			}
			this.outStream.write( interleavedOutput, bufferSizeInFrames );
		} // while

	}
/** Update loop called from within audio thread (created in start() method). */
Update loop called from within audio thread (created in start() method).
Update loop called from within audio thread ( created in start () method ) .
private void runRealTime() {		
		AudioContext context = getContext();
		int bufferSizeInFrames = context.getBufferSize();
		float[] interleavedOutput = new float[this.numOutChannels * bufferSizeInFrames];
		while (context.isRunning())
		{
			update(); 
			for (int i = 0, counter = 0; i < bufferSizeInFrames; ++i) {
				for (int j = 0; j < this.numOutChannels; ++j) {
					interleavedOutput[counter++] = (int) context.out.getValue(j, i);
				}
			} 
			if(outStream == null)
			{
				throw new IllegalArgumentException("PAAIO.runRealTime: outStream is null.");
			}
			this.outStream.write( interleavedOutput, bufferSizeInFrames );
		} 
	}
private void runRealTime ( ) { AudioContext context = getContext ( ) ; int bufferSizeInFrames = context . getBufferSize ( ) ; float [ ] interleavedOutput = new float [ this . numOutChannels * bufferSizeInFrames ] ; while ( context . isRunning ( ) ) { update ( ) ; for ( int i = 0 , counter = 0 ; i < bufferSizeInFrames ; ++ i ) { for ( int j = 0 ; j < this . numOutChannels ; ++ j ) { interleavedOutput [ counter ++ ] = ( int ) context . out . getValue ( j , i ) ; } } if ( outStream == null ) { throw new IllegalArgumentException ( "PAAIO.runRealTime: outStream is null." ) ; } this . outStream . write ( interleavedOutput , bufferSizeInFrames ) ; } }
Update loop called from within audio thread (created in start() method).
Update loop called from within audio thread ( created in start () method ) .
// this propagates update call to context // for - i // TODO: maybe just write for availableToWrite, not whole buffer? // while