mirror of
https://github.com/thestk/stk
synced 2026-01-11 12:01:52 +00:00
Version 4.4.1
This commit is contained in:
committed by
Stephen Sinclair
parent
eccd8c9981
commit
b6a2202011
@@ -8,7 +8,7 @@ AC_CONFIG_FILES(src/Makefile projects/demo/Makefile projects/effects/Makefile pr
|
||||
AC_SUBST( GXX, ["no"] )
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXX(g++ CC c++ cxx)
|
||||
AC_PROG_RANLIB
|
||||
AC_PATH_PROG(AR, ar, no)
|
||||
if [[ $AR = "no" ]] ; then
|
||||
|
||||
@@ -2,6 +2,12 @@ The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995-2009.
|
||||
|
||||
v4.4.1: (3 June 2009)
|
||||
- added multi-channel/frame tick() virtual function to WvIn and WvOut abstract base classes (required update to RtWvOut class)
|
||||
- updated configure script to select g++ compiler by default
|
||||
- in demo.cpp: removed voicer grouping for messages, fixing polyphony when messages are on the same MIDI/SKINI channel
|
||||
- updates to RtAudio and RtMidi
|
||||
|
||||
v4.4: (30 April 2009)
|
||||
- all classes embedded in the "stk" namespace (except RtAudio, RtMidi, and RtError)
|
||||
- class WaveLoop renamed FileLoop
|
||||
|
||||
@@ -31,7 +31,7 @@ PROJECT_NAME = STK
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 4.4.0
|
||||
PROJECT_NUMBER = 4.4.1
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
/*! \page download Download, Release Notes, and Bug Fixes
|
||||
|
||||
\section down Download Version 4.4.0 (30 April 2009):
|
||||
\section down Download Version 4.4.1 (3 June 2009):
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="http://ccrma.stanford.edu/software/stk/release/stk-4.4.0.tar.gz">Source distribution</A></LI>
|
||||
<LI><A HREF="http://ccrma.stanford.edu/software/stk/release/stk-4.4.1.tar.gz">Source distribution</A></LI>
|
||||
</UL>
|
||||
|
||||
|
||||
\section notes Release Notes:
|
||||
|
||||
\subsection v4dot4dot1 Version 4.4.1
|
||||
|
||||
<ul>
|
||||
<li>Added multi-channel/frame tick() virtual function to WvIn and WvOut abstract base classes (required update to RtWvOut class).</li>
|
||||
<li>Updated configure script to select g++ compiler by default.</li>
|
||||
<li>In demo.cpp: removed voicer grouping for messages, fixing polyphony when messages are on the same MIDI/SKINI channel.</li>
|
||||
<li>Updates to RtAudio and RtMidi.</li>
|
||||
</ul>
|
||||
|
||||
\subsection v4dot4dot0 Version 4.4.0
|
||||
|
||||
<ul>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
STK: A ToolKit of Audio Synthesis Classes and Instruments in C++
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995-2007.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995-2009.
|
||||
|
||||
STK Classes - See the HTML documentation in the html directory for complete information.
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
\file RtAudio.h
|
||||
*/
|
||||
|
||||
// RtAudio: Version 4.0.5
|
||||
// RtAudio: Version 4.0.6
|
||||
|
||||
#ifndef __RTAUDIO_H
|
||||
#define __RTAUDIO_H
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
*/
|
||||
/**********************************************************************/
|
||||
|
||||
// RtMidi: Version 1.0.9
|
||||
// RtMidi: Version 1.0.10
|
||||
|
||||
#ifndef RTMIDI_H
|
||||
#define RTMIDI_H
|
||||
|
||||
@@ -73,7 +73,7 @@ class RtWvOut : public WvOut
|
||||
checked if _STK_DEBUG_ is defined during compilation, in which
|
||||
case an incompatibility will trigger an StkError exception.
|
||||
*/
|
||||
void tick( StkFrames& frames );
|
||||
void tick( const StkFrames& frames );
|
||||
|
||||
// This function is not intended for general use but must be
|
||||
// public for access from the audio callback function.
|
||||
|
||||
@@ -31,6 +31,9 @@ public:
|
||||
//! Compute one sample frame and return the specified \c channel value.
|
||||
virtual StkFloat tick( unsigned int channel = 0 ) = 0;
|
||||
|
||||
//! Fill the StkFrames argument with computed frames and return the same reference.
|
||||
virtual StkFrames& tick( StkFrames& frames ) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
StkFrames data_;
|
||||
|
||||
@@ -44,6 +44,9 @@ class WvOut : public Stk
|
||||
*/
|
||||
virtual void tick( const StkFloat sample ) = 0;
|
||||
|
||||
//! Output the StkFrames data.
|
||||
virtual void tick( const StkFrames& frames ) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
// Check for sample clipping and clamp.
|
||||
|
||||
@@ -69,8 +69,8 @@ void processMessage( TickData* data )
|
||||
register StkFloat value2 = data->message.floatValues[1];
|
||||
|
||||
// If only one instrument, allow messages from all channels to control it.
|
||||
int channel = 1;
|
||||
if ( data->nVoices > 1 ) channel = data->message.channel;
|
||||
//int group = 1;
|
||||
// if ( data->nVoices > 1 ) group = data->message.channel;
|
||||
|
||||
switch( data->message.type ) {
|
||||
|
||||
@@ -81,13 +81,13 @@ void processMessage( TickData* data )
|
||||
|
||||
case __SK_NoteOn_:
|
||||
if ( value2 == 0.0 ) // velocity is zero ... really a NoteOff
|
||||
data->voicer->noteOff( value1, 64.0, channel );
|
||||
data->voicer->noteOff( value1, 64.0 );
|
||||
else // a NoteOn
|
||||
data->voicer->noteOn( value1, value2, channel );
|
||||
data->voicer->noteOn( value1, value2 );
|
||||
break;
|
||||
|
||||
case __SK_NoteOff_:
|
||||
data->voicer->noteOff( value1, value2, channel );
|
||||
data->voicer->noteOff( value1, value2 );
|
||||
break;
|
||||
|
||||
case __SK_ControlChange_:
|
||||
@@ -96,34 +96,34 @@ void processMessage( TickData* data )
|
||||
else if (value1 == 7.0)
|
||||
data->volume = value2 * ONE_OVER_128;
|
||||
else if (value1 == 49.0)
|
||||
data->voicer->setFrequency( value2, channel );
|
||||
data->voicer->setFrequency( value2 );
|
||||
else if (value1 == 50.0)
|
||||
data->voicer->controlChange( 128, value2, channel );
|
||||
data->voicer->controlChange( 128, value2 );
|
||||
else if (value1 == 51.0)
|
||||
data->frequency = data->message.intValues[1];
|
||||
else if (value1 == 52.0) {
|
||||
data->frequency += ( data->message.intValues[1] << 7 );
|
||||
// Convert to a fractional MIDI note value
|
||||
StkFloat note = 12.0 * log( data->frequency / 220.0 ) / log( 2.0 ) + 57.0;
|
||||
data->voicer->setFrequency( note, channel );
|
||||
data->voicer->setFrequency( note );
|
||||
}
|
||||
else
|
||||
data->voicer->controlChange( (int) value1, value2, channel );
|
||||
data->voicer->controlChange( (int) value1, value2 );
|
||||
break;
|
||||
|
||||
case __SK_AfterTouch_:
|
||||
data->voicer->controlChange( 128, value1, channel );
|
||||
data->voicer->controlChange( 128, value1 );
|
||||
break;
|
||||
|
||||
case __SK_PitchChange_:
|
||||
data->voicer->setFrequency( value1, channel );
|
||||
data->voicer->setFrequency( value1 );
|
||||
break;
|
||||
|
||||
case __SK_PitchBend_:
|
||||
short temp;
|
||||
temp = data->message.intValues[1] << 7;
|
||||
temp += data->message.intValues[0];
|
||||
data->voicer->pitchBend( (StkFloat) temp, channel );
|
||||
data->voicer->pitchBend( (StkFloat) temp );
|
||||
break;
|
||||
|
||||
case __SK_Volume_:
|
||||
@@ -143,7 +143,7 @@ void processMessage( TickData* data )
|
||||
data->currentVoice = voiceByNumber( (int)value1, &data->instrument[i] );
|
||||
if ( data->currentVoice < 0 )
|
||||
data->currentVoice = voiceByNumber( 0, &data->instrument[i] );
|
||||
data->voicer->addInstrument( data->instrument[i], channel );
|
||||
data->voicer->addInstrument( data->instrument[i] );
|
||||
data->settling = false;
|
||||
}
|
||||
|
||||
@@ -224,14 +224,14 @@ int main( int argc, char *argv[] )
|
||||
|
||||
// Check the command-line arguments for errors and to determine
|
||||
// the number of WvOut objects to be instantiated (in utilities.cpp).
|
||||
data.nWvOuts = checkArgs(argc, argv);
|
||||
data.wvout = (WvOut **) calloc(data.nWvOuts, sizeof(WvOut *));
|
||||
data.nWvOuts = checkArgs( argc, argv );
|
||||
data.wvout = (WvOut **) calloc( data.nWvOuts, sizeof(WvOut *) );
|
||||
|
||||
// Instantiate the instrument(s) type from the command-line argument
|
||||
// (in utilities.cpp).
|
||||
data.nVoices = countVoices(argc, argv);
|
||||
data.instrument = (Instrmnt **) calloc(data.nVoices, sizeof(Instrmnt *));
|
||||
data.currentVoice = voiceByName(argv[1], &data.instrument[0]);
|
||||
data.nVoices = countVoices( argc, argv );
|
||||
data.instrument = (Instrmnt **) calloc( data.nVoices, sizeof(Instrmnt *) );
|
||||
data.currentVoice = voiceByName( argv[1], &data.instrument[0] );
|
||||
if ( data.currentVoice < 0 ) {
|
||||
free( data.wvout );
|
||||
free( data.instrument );
|
||||
@@ -239,16 +239,16 @@ int main( int argc, char *argv[] )
|
||||
}
|
||||
// If there was no error allocating the first voice, we should be fine for more.
|
||||
for ( i=1; i<data.nVoices; i++ )
|
||||
voiceByName(argv[1], &data.instrument[i]);
|
||||
voiceByName( argv[1], &data.instrument[i] );
|
||||
|
||||
data.voicer = (Voicer *) new Voicer( data.nVoices );
|
||||
data.voicer = (Voicer *) new Voicer( 0.0 );
|
||||
for ( i=0; i<data.nVoices; i++ )
|
||||
data.voicer->addInstrument( data.instrument[i], i+1 );
|
||||
data.voicer->addInstrument( data.instrument[i] );
|
||||
|
||||
// Parse the command-line flags, instantiate WvOut objects, and
|
||||
// instantiate the input message controller (in utilities.cpp).
|
||||
try {
|
||||
data.realtime = parseArgs(argc, argv, data.wvout, data.messager);
|
||||
data.realtime = parseArgs( argc, argv, data.wvout, data.messager );
|
||||
}
|
||||
catch (StkError &) {
|
||||
goto cleanup;
|
||||
|
||||
56
projects/examples/test.cpp
Normal file
56
projects/examples/test.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
// sineosc.cpp STK tutorial program
|
||||
|
||||
#include "FileWvIn.h"
|
||||
#include "RtWvOut.h"
|
||||
using namespace stk;
|
||||
|
||||
int main()
|
||||
{
|
||||
// Set the global sample rate before creating class instances.
|
||||
Stk::setSampleRate( 44100.0 );
|
||||
|
||||
int nFrames = 100000;
|
||||
WvIn *input;
|
||||
// FileWvOut output;
|
||||
WvOut *output;
|
||||
|
||||
try {
|
||||
// Load the sine wave file.
|
||||
input = new FileWvIn( "hellosine.wav" );
|
||||
|
||||
// Open a 16-bit, one-channel WAV formatted output file
|
||||
// output = new FileWvOut( "hellosine.wav", 1, FileWrite::FILE_WAV, Stk::STK_SINT16 );
|
||||
output = new RtWvOut();
|
||||
}
|
||||
catch ( StkError & ) {
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
//input.setFrequency( 440.0 );
|
||||
|
||||
// Option 1: Use StkFrames
|
||||
/*
|
||||
StkFrames frames( nFrames, 1 );
|
||||
try {
|
||||
output->tick( input->tick( frames ) );
|
||||
}
|
||||
catch ( StkError & ) {
|
||||
exit( 1 );
|
||||
}
|
||||
*/
|
||||
|
||||
// Option 2: Single-sample computations
|
||||
for ( int i=0; i<nFrames; i++ ) {
|
||||
try {
|
||||
output->tick( input->tick() );
|
||||
}
|
||||
catch ( StkError & ) {
|
||||
exit( 1 );
|
||||
}
|
||||
}
|
||||
|
||||
delete output;
|
||||
delete input;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ StkFloat Granulate :: tick( unsigned int channel )
|
||||
// Accumulate the grain outputs.
|
||||
if ( grains_[i].state > 0 ) {
|
||||
for ( j=0; j<nChannels; j++ ) {
|
||||
sample = data_[ nChannels * grains_[i].pointer + j ];
|
||||
sample = data_[ nChannels * grains_[i].pointer + j ];
|
||||
|
||||
if ( grains_[i].state == GRAIN_FADEIN || grains_[i].state == GRAIN_FADEOUT ) {
|
||||
sample *= grains_[i].eScaler;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
*/
|
||||
/************************************************************************/
|
||||
|
||||
// RtAudio: Version 4.0.5
|
||||
// RtAudio: Version 4.0.6
|
||||
|
||||
#include "RtAudio.h"
|
||||
#include <iostream>
|
||||
@@ -403,7 +403,9 @@ unsigned int RtApi :: getStreamSampleRate( void )
|
||||
// implementation.
|
||||
struct CoreHandle {
|
||||
AudioDeviceID id[2]; // device ids
|
||||
#if defined( MAC_OS_X_VERSION_10_5 ) && ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 )
|
||||
AudioDeviceIOProcID procId[2];
|
||||
#endif
|
||||
UInt32 iStream[2]; // device stream index (or first if using multiple)
|
||||
UInt32 nStreams[2]; // number of streams to use
|
||||
bool xrun[2];
|
||||
@@ -5646,7 +5648,7 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
|
||||
}
|
||||
|
||||
// Set the buffer number, which in ALSA is referred to as the "period".
|
||||
int totalSize, dir;
|
||||
int totalSize, dir = 0;
|
||||
unsigned int periods = 0;
|
||||
if ( options ) periods = options->numberOfBuffers;
|
||||
totalSize = *bufferSize * periods;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
*/
|
||||
/**********************************************************************/
|
||||
|
||||
// RtMidi: Version 1.0.9
|
||||
// RtMidi: Version 1.0.10
|
||||
|
||||
#include "RtMidi.h"
|
||||
#include <sstream>
|
||||
@@ -743,7 +743,7 @@ void RtMidiOut :: sendMessage( std::vector<unsigned char> *message )
|
||||
|
||||
unsigned int packetBytes, bytesLeft = nBytes;
|
||||
unsigned int messageIndex = 0;
|
||||
MIDITimeStamp timeStamp = 0;
|
||||
MIDITimeStamp timeStamp = AudioGetCurrentHostTime();
|
||||
CoreMidiData *data = static_cast<CoreMidiData *> (apiData_);
|
||||
|
||||
while ( bytesLeft > 0 ) {
|
||||
|
||||
@@ -165,7 +165,7 @@ void RtWvOut :: tick( const StkFloat sample )
|
||||
writeIndex_ = 0;
|
||||
}
|
||||
|
||||
void RtWvOut :: tick( StkFrames& frames )
|
||||
void RtWvOut :: tick( const StkFrames& frames )
|
||||
{
|
||||
#if defined(_STK_DEBUG_)
|
||||
if ( data_.channels() != frames.channels() ) {
|
||||
@@ -195,7 +195,8 @@ void RtWvOut :: tick( StkFrames& frames )
|
||||
nFrames = frames.frames() - framesWritten;
|
||||
bytes = nFrames * nChannels * sizeof( StkFloat );
|
||||
StkFloat *samples = &data_[writeIndex_ * nChannels];
|
||||
memcpy( samples, &frames[framesWritten * nChannels], bytes );
|
||||
StkFrames *ins = (StkFrames *) &frames;
|
||||
memcpy( samples, &(*ins)[framesWritten * nChannels], bytes );
|
||||
for ( unsigned int i=0; i<nFrames * nChannels; i++ ) clipTest( *samples++ );
|
||||
|
||||
writeIndex_ += nFrames;
|
||||
|
||||
Reference in New Issue
Block a user