Hello,
This post is about a plan to develop a software library with realtime analysis routines, to be used in Pd and possibly other realtime dsp frameworks. The idea was loosely discussed with Jwif in another thread.
My concept of RAP (realtime analysis project) would be based on the following: an audio stream has features which can be found from the waveform itself, features which can be used to reorganize that waveform in a sensible and musically pleasing way. A realtime cut and paste concept, applied to an incoming audio stream, rather than a file from disk. I apply this concept already in Instant Decomposer and Slice//Jockey. Jwif does so in his RjDj apps.
Analysis procedures for realtime cut and paste must be very precise, robust, and low-latency. Existing signal analysis classes in Pd (bonk~, fiddle~, sigmund~) are of good quality, but they can not give very precise locations of where things happen in a signal.
For this reason, I had earlier developed classes slicerec~ and sliceplay~, which operate with sample-precise attack cuepoints to indexes in a signal buffer. With this construction, incoming audio is spliced so fast and precise that rhythms can be created on the fly without sloppiness in the timing. slicerec~'s attack detector is however not so sensitive for all signal types as bonk~.
The concept of realtime splicing could be expanded beyond the obvious cut-on-attack approach, if period tracking is taken into account. If period length is known, periods can be cut, copied and pasted as well. This is a finer grain of signal reorganization, but still based on information of the signal itself. Like complete notes, periods can be stretched or shrunk to change their spectral information. You could use this for pitch shifting, realtime stretching or formant manipulation. Together, transient- and pitch detection give sufficient information to do very weird things with a signal, without completely loosing the original character.
The main info's needed from a signal are: envelope, attack point, transient length, and in case of periodicity the period length.
The RAP library would be a set of analysis routines written in C, which can be used in different combinations to create RAP-based Pd classes. The C routines should be of high quality and efficiency. For pitch tracking, procedures in [helmholtz~] are probably the best option (http://www.katjaas.nl/helmholtz/helmholtz.html). For attack detection, procedures in [bonk~] can be a guideline.
RAP-based Pd classes could be, for example:
a class [attackpoint~], taking an audio stream and an index stream, and producing cuepoint messages
a better [slicerec~]
a PSOLA pitch shifter
The above ideas sketch a very rough impression of what RAP could be. To design it's structure and implementation will be a delicate and time-consuming process. Do not expect it to be ready within days or weeks. If we take time to work out a decent structure, it will be possible to use the library for all sorts of purposes, and extend it over time. Like Pd, it should be BSD licensed to avoid limitations in the way how we can use it.
Katja