Wave Trigger board serial communication CONTROL_TRACK command 'STOP' stops ALL the playing tracks!

I’m using the Wave Trigger board (firmware v1.34)
and communicate with it using the Serial Control @ 57.6kbps with success.

Here is a copy of my ‘untouched’ wavtrigr.ini file installed on my SD card:


This file was generated by the WAV Trigger Init File Maker v1.20
It is only required if you wish to over-ride default settings. You
may add your own comments below this line →

I communicate with it using a PIC microcontroller
and its UART port set at 57,6kbps.
I can play separate tracks in polyphony using the
CONTROL_TRACK command
(PLAY_POLY = 0x01: Play track polyphonically)
Fine.

But when I try to stop a specific playing track from others
my function showed below stops ALL the playing tracks instead !!!
I don’t see what is wrong according to the user manual.
Can you help ?

// The following function works correctly.
// Only the selected track plays. Fine
///////////////////////////////////////////////
void Wave_Trigger_PLAY_file(unsigned int file_number)
{
// Wave Trigger CONTROL TRACK command (PLAY)
unsigned char LSB, MSB;

LSB = (unsigned char)(file_number &0x00FF);
MSB = (unsigned char)(file_number >> 8);
putch(0xF0);
putch(0xAA);
putch(0x08); // 8 bytes messages
putch(0x03); // Message Code 3 (PLAY POLY)
putch(0x01); // Polyphony selected
putch(LSB);
putch(MSB);
putch(0x55); // End of message byte
}

// But the following function kills ALL the playing files
// .. not only the selected one (variable named file_number) as it should
///////////////////////////////////////////////
void Wave_Trigger_STOP_file(unsigned int file_number)
{
// Wave Trigger CONTROL TRACK command (STOP)
unsigned char LSB, MSB;

LSB = (unsigned char)(file_number &0x00FF);
MSB = (unsigned char)(file_number >> 8);
putch(0xF0);
putch(0xAA);
putch(0x08); // 8 bytes messages
putch(0x04); // Message Code 4 (STOP)
putch(0x01); // Polyphony selected
putch(LSB);
putch(MSB);
putch(0x55); // End of message byte
}

I found my problem..
My function named:
void Wave_Trigger_STOP_file(unsigned int file_number)

Should have been written the following way:

///////////////////////////////////////////////
void Wave_Trigger_STOP_file(unsigned int file_number)
{
// Wave Trigger MIDI note OFF command
unsigned char LSB, MSB;

LSB = (unsigned char)(file_number &0x00FF);
MSB = (unsigned char)(file_number >> 8);
putch(0xF0);
putch(0xAA);
putch(0x08); // 8 bytes messages
putch(0x03); // CONTROL_TRACK CODE
putch(0x04); // STOP selected file
putch(LSB);
putch(MSB);
putch(0x55); // End of message byte
}

1 Like

Great work!