02 October 2011
14 April 2010
Phase-Locked STFT Time-Scale Modification in MATLAB

This is a non-realtime MATLAB implementation of frequency-domain time-scale modification algorithms by Puckette (1995) and Laroche, Dolson (1999) which take into account vertical phase coherence between channels of the STFT. This type of technique is commonly referred to as the Phase Vocoder. For more information on these topics see the references below.
The file PhaseVocoders.m launches a simple GUI for loading .wav samples, choosing parameters for the algorithms, and previewing and saving the results. The quality of the resulting time-scale modified signals is sensitive to the choice of parameters. The FFT size and overlap follow the standard STFT model for overlapping analysis/synthesis windows.
There is a simple peak picking algorithm necessary for the Laroche/Dolson algorithms, which identifies spectral peaks whose amplitudes are larger than their N nearest neighbors and are greater than a certain threshold (to avoid picking peaks in noise or silence). Both of these parameters for the peak picking algorithm can be chosen in the GUI.
Phase Vocoder GUI for MATLAB
References:
M. Puckette, “Phase-locked vocoder,” IEEE ASSP Workshop on Applications of
Signal Processing to Audio and Acoustics, 1995.
J. Laroche and M. Dolson, “Improved phase vocoder time-scale modification of
audio,” IEEE Transactions on Speech and Audio Processing, vol. 7, no. 3, pp.
323-332, May 1999.
11 April 2010
Modal Windchime

This project is a virtual model of a windchime, built using the DIMPLE physical environment created in IDMIL at McGill's department of Music Technology. Six chime-like bars are suspended from a fixed top plates using ball joints. When they collide with each other or the center mass, modal synthesis events are triggered in Max/MSP.
The modal synthesis patch in Max/MSP consists of three bandpass filters per chime voice (reson~ objects) which are tuned to the approximate first three modes of a metallic or bamboo woodchime, determined manually using LPC analysis to pick the three largest peaks in the spectral envelope of samples of each type of chime. Each chime collision in DIMPLE sends an OSC message to Max/MSP, triggering a burst of exponentially damped noise whose amplitude is proportional to the velocity of the collision. The noise excites the filters, producing the synthetic chime sound.
Wiimote controls were also added using GlovePie. The joystick and +/- buttons are used to control the camera pan and zoom, and the acceleration of the wiimote creates virtual "wind" forces on the chime objects proportional to the amplitude and direction of the acceleration. A video demonstration is shown below. Please excuse the slightly clicky audio track - the audio was synthesized on a netbook.
03 April 2010
A method for sending OSC messages from Arduino over USB virtual serial port
This is a function for the Arduino compiler in addition to a small terminal program for Mac OS X which together implement a method of acquiring data from the Arduino over USB to be sent as OSC messages from the host computer. The serialOSC program is a simple C/C++ program written using the oscpack library for C++ and code for reading from the serial port by Tod E. Kurt. It can send messages to any port on any host, as specified in the config.txt file, but is currently hard-coded to only send messages named "/arduino/data", with any number of arguments. Due to RS232 limitations, the maximum speed at which messages may be sent without error may vary. In the setup I was testing it with (Arduino Duemillanove at 115.2 kbaud), the maximum error-free rate I could achieve was around 500 Hz for a 4-argument message.
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:
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
Subscribe to:
Posts (Atom)