projects/aaron/marco_tester.cpp
// The processMessage() function encapsulates the handling of control
// messages.  It can be easily relocated within a program structure
// depending on the desired scheduling scheme.
// *atr - we may not need this in the end, but kept it for testing
The processMessage() function encapsulates the handling of control
messages.  It can be easily relocated within a program structure
depending on the desired scheduling scheme.
atr - we may not need this in the end, but kept it for testing
The processMessage () function encapsulates the handling of control messages . It can be easily relocated within a program structure depending on the desired scheduling scheme . atr - we may not need this in the end but kept it for testing
void processMessage( TickData* data )
{
  register unsigned int value1 = data->message.intValues[0];
  switch( data->message.type ) {
  case __SK_Exit_:
    if ( data->settling == false ) goto settle;
    done = true;
    return;
  case __SK_NoteOn_:
    std::cout << "note on\n";
    break;
  case __SK_NoteOff_:
    std::cout << "note off\n";
    break;
  case __SK_ControlChange_:
    switch ( value1 ) {
    case 20: { 
      std::cout << "effect type change=";
      int type = data->message.intValues[1];
      data->effectId = (unsigned int) type;
       std::cout << type << "\n";
      break;
    }
    case 22: 
      std::cout << "effect param 1 change\n";
      break;
    case 23: 
      std::cout << "effect param 2 change\n";
      break;
    case 44: 
      std::cout << "effect mix change\n";
      break;
    default:
      break;
    }
  } 
  data->haveMessage = false;
  return;
 settle:
  data->counter = (int) (0.3 * data->t60 * Stk::sampleRate());
  data->settling = true;
}
void processMessage ( TickData * data ) { register unsigned int value1 = data -> message . intValues [ 0 ] ; switch ( data -> message . type ) { case __SK_Exit_ : if ( data -> settling == false ) goto settle ; done = true ; return ; case __SK_NoteOn_ : std :: cout << " \n " ; break ; case __SK_NoteOff_ : std :: cout << " \n " ; break ; case __SK_ControlChange_ : switch ( value1 ) { case 20 : { std :: cout << " " ; int type = data -> message . intValues [ 1 ] ; data -> effectId = ( unsigned int ) type ; std :: cout << type << " \n " ; break ; } case 22 : std :: cout << " \n " ; break ; case 23 : std :: cout << " \n " ; break ; case 44 : std :: cout << " \n " ; break ; default : break ; } } data -> haveMessage = false ; return ; settle : data -> counter = ( int ) ( 0.3 * data -> t60 * Stk :: sampleRate ( ) ) ; data -> settling = true ; }
The processMessage() function encapsulates the handling of control
messages.
The processMessage () function encapsulates the handling of control messages .
//register StkFloat value2 = data->message.floatValues[1]; //data->envelope.setTarget( 1.0 ); //data->envelope.setTarget( 0.0 ); // Change all effect values so they are "synched" to the interface. // effect type change // effect parameter change 1 //     data->echo.setDelay( (unsigned long) (temp * Stk::sampleRate() * 0.95) ); //     data->lshifter.setShift( 1.4 * temp + 0.3 ); // effect parameter change 2 //      data->chorus.setModDepth( temp * 0.2 ); // effect mix //     data->echo.setEffectMix( temp ); // end of type switch // Exit and program change messages are preceeded with a short settling period. //data->envelope.setTarget( 0.0 );