The program has only currently been built and tested for Mac OS X with a PowerPC processor, but should theoretically also compile for Linux/Unix systems. Source requires installation of the oscpack library. I have not written a makefile for release yet, but assuming the standard C libraries are available, and the oscpack library files and headers are installed in a location accessible to the compiler, the source can be compiled using g++ from the source directory with:
g++ -Wall -o serialOSC -loscpack serialOSC.cpp
Also remember to use the proper endianness for your architecture when compiling the oscpack library.
All instructions for usage are in the README.txt file.
serialOSC 0.9 for PowerPC Macs
serialOSC 0.9 Source
The source for the Arduino function is below:
// Function definitions for serialOSC library for Arduino
// For use with serialOSC program
// Nick Donaldson, 2010
#include "WProgram.h"
#ifndef SENDOSC_H
#define SENDOSC_H
void sendOSCData( int* data, int num)
{
//begin message with 2 0xFF followed by comma
Serial.print(0xFF,BYTE);
Serial.print(0xFF,BYTE);
Serial.print(',', BYTE);
// follow by number of arguments
Serial.print(num, BYTE);
Serial.print(',', BYTE);
// arguments
for(int dt=0; dtSerial.print(data[dt]>>8,BYTE);
Serial.print(data[dt],BYTE);
}
Serial.print(',');
// end of message
Serial.print(0xFF,BYTE);
Serial.print(0xFE,BYTE);
Serial.print(',');
return;
};
#endif
No comments:
Post a Comment