PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Music app for PPC

stickyfingers · 18 May 2005, 11:37 UTC
I'm playing around with a music app for the PPC platform (eventually also for Symbian OS). My problem is that I want the PPC to playback a series of wav sounds at specific times. At the same time I want to be able to change the tempo of the playback, which requires a really highprecision timer interrupt. I was looking into using the GapiDraw::ProcessNextFrame but that design is not fine grained enough for a guaranteed highprecision timer.

Any ideas???

-Thomas
Why not look at some source code for something like the Hekkus sound library? It obviously has some sort of precision timing involved.

The older versions were released with source code. Not too sure if it's still available...

Hekkus uses a separate thread with high priority. You'd probably want to do the same.
The change of the pitch of a sound or song has nothing to do with having a high precision timer or not.

The only thing what the speed of the timer (and the size of the buffers) enables one to do, is have a higher or lower latency.

The latency is the time it takes between the sound being 'rendered' and the sound actually being heared.

If you are just playing a song, the latency doesn't need to be high, and normal timers and big buffers suffice, If you want to play sound fx, you'd need a faster timer with short buffers to increase the latency. Otherwise the soundfx would sound a few seconds too late ;^)


The pitch of a samples is controlled by rendering the samples to the output buffer with a variable stepping value. The lower the value, the lower the pitch. When you use interpolation (to compensate for the coarseness of the input sample) you can change the pitch up or down an octave without the sounds starting to sound too unbelievable.

Cheers,

Reinier