Author |
Message |
Tim Kleinert
Joined: Mar 12, 2004 Posts: 1148 Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236
|
Posted: Sun Oct 28, 2007 2:03 pm Post subject:
polyphonic "intelligent elastic audio" sampler Subject description: sample-accurate intelligent grain detection and other goodies :-) |
 |
|
Hi folks,
Anyone remember the old AKAI samplers? They had two algorithms for time-stretching, one called "cyclic" and the other called "intelligent".
The "cyclic" one basically chopped up the sample into small grains of a constant size and simply spreaded them out over the desired sample length, applying crossfading to circumvent audio clicks. Conceptually, this process is basically the exact reverse of the "classic" pitch shifting algorithm of FX units, with which it unfortunately shares the same sonic drawbacks: The grain size (with pitch shifting, it would be the length of the delay line) intermodulates with the audio signal, producing all sorts of "flangey" artefacts. (Expectedly, these "artefacts" have since been turned into a common (and hence overused) effect. There was a period when you couldn't get away from house tracks full of "timestretched-to-death" vocal hooks. "Sssuuuggggaaarrrrdddaaddddddeeeyyy", anyone? )
All of my previous elastic audio attempts where built around this "constant grain size" idea, with the aforementioned side-effects. To alleviate those, various jitter parameters (jittering the grain frequency, pitch and position) were introduced primarily as an attempt to mask the intermodulations and the resulting "flangey" artificial sound. On simple monophonic source material, this sometimes worked OK. On more complex stuff (and especially drum loops) it sounded either cool and "techy" or utter shite, depending on personal taste. (I gravitate towards the latter... )
Back to the vintage AKAI time-stretcher. It also had an "intelligent" mode. This process scanned the audio material for positive-going zero crossings, thereby extracting single waveform cycles. These were then looped into larger grains (the amount of cycles could be manually set) and these again were spread out over the desired sampling time. This had the advantage that no crossfading was necessary, since there are no clicks -the individual waveform cycles are seamlessly joined to each other. Also, the resulting variable grain size is relative to the source material, causing no more intermodulations, and a more natural sound.
If you've read this far, you probably know what's coming... Yes. I've managed to build this concept on the G2. But contrary to the old AKAI, the G2 does it in realtime, turning it into a performable "elastic audio" thing. It even tracks keyboard pitch.
This patch contains all of my newest X-rated perversions of abusive G2 patching. It features innovations like non-drifting sample-accurate access to the delay lines (without the old klutzy time-stamping workaround), intelligent realtime zero-crossing detection and grain generation, DIY oscillators (for keyboard tracking) and other insanities. Most of it is abstract "low-level" style stuff, so please don't ask me to explain it. To be honest, I don't understand most of it myself anymore, now when I look back at it. But lo and beholds, it works.
Next to the functional improvements over my older designs, the audio quality is also considerably improved. The old patches suffered from the fact that the delay lines were driven by control rate (24kHz) readout pointers, making it somewhat "lo-fi". Here, everything relevant is clocked at 96kHz. Big difference.
Controls description:
INPUT, CHANNEL: Selects input channel for audio capturing.
SAMPLE Capture: Pressing this button starts the sampling. (2.7 seconds)
SAMPLE <scrub>: Freely scrub around in the captured sample (without affecting pitch). Also assigned to modulation wheel.
TIME <dir>: Time axis of the sample (independent of pitch). Zero means that time stands still. Positive or negative amounts make time move forwards or backwards. This parameter is assigned also to the pitch stick, enabling you to comfortably jog around in the sample.
TIME KBT: Makes the time axis track the keyboard, making higher keys move faster.
PITCH Coarse: Tuning of the sample (independent of speed)
PITCH KBT: Makes the sample track the keyboard.
(Note: Activating TIME KBT and PITCH KBT together makes the patch behave similar to a conventional sampler.)
GRAIN Size: Amount of discrete waveform cycles per grain (counted in increments of 0.5).
GRAIN SIZE Jitter: Adds jitter to each grain cycle, making it less static.
DUAL GRAIN MODE On/Off: Yup, there's a second grain generator under the hood. Activating this makes the sound thicker. Imagine two oscillators instead of one. You have to add some grain size jitter for this function to have any effect! Only by adding jitter will the grain oscillators go out of phase and create a denser sound.
VOLUME A,D,S,R: Envelope
No FX. You can always add if you want.
Note 1: When you first load the patch, it is silent. In order to hear something, you a)have to capture some audio, b)press a key, and c)futz around with the modwheel and pitch stick. (Just to restate the obvious...)
Note 2: The pitch keyboard tracking isn't perfect, due to internal calculation resolution of the G2. I pushed it as far as it could go....
Note 3:The patch fits "neatly" :(100% mem ) on a DSP, making for 4- or 8-voice polyphony depending on your G2 expansion status.
Have fun.
best,
tim
: Capture your voice, deactivate DUAL MODE and GRAIN SIZE Jitter, set time axis to zero and scrub for an audible waveform. Now, futz around with GRAIN SIZE. Instant Aphex Twin ...
Update: This stuff is a work in progress. A polyphonic granular synth (with more features) based on this new elastic audio technique can be found here:
http://www.electro-music.com/forum/topic-21543.html
Description: |
sample-accurate polyphonic elastic audio patch based on an intelligent time stretch algorithm. |
|
 Download |
Filename: |
IntElasticSyntTK.pch2 |
Filesize: |
5.56 KB |
Downloaded: |
2143 Time(s) |
Last edited by Tim Kleinert on Sun Nov 04, 2007 8:28 am; edited 2 times in total |
|
Back to top
|
|
 |
Tim Kleinert
Joined: Mar 12, 2004 Posts: 1148 Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236
|
|
Back to top
|
|
 |
Fozzie

Joined: Jun 04, 2004 Posts: 875 Location: Near Wageningen, the Netherlands
Audio files: 8
G2 patch files: 49
|
Posted: Sun Oct 28, 2007 2:51 pm Post subject:
Re: polyphonic "intelligent elastic audio" sampler Subject description: sample-accurate intelligent grain detection and other goodies :-) |
 |
|
tim wrote: | Hi folks,
...... It features innovations like non-drifting sample-accurate access to the delay lines (without the old klutzy time-stamping workaround
........Most of it is abstract "low-level" style stuff, so please don't ask me to explain it. To be honest, I don't understand most of it myself anymore, now when I look back at it. But lo and beholds, it works.
|
You keep amazing me with your contraptions. However, as I was just about to get to grips with your previous time-stamping and grain techniques, I am utterly lost here looking at your patch. I know you don't want to explain the whole thing, but could I seduce you to say a few things about the new timing-technique? I love your 'old' beat-syncable elastic audio patches; could this new timing stuff also be used to sync to the master clock? _________________ Spinning at ~0.0000115740740741 Hz |
|
Back to top
|
|
 |
v-un-v
Janitor


Joined: May 16, 2005 Posts: 8933 Location: Birmingham, England, UK
Audio files: 11
G2 patch files: 1
|
Posted: Sun Oct 28, 2007 3:05 pm Post subject:
|
 |
|
Tim, PLEASE send us an mp3 or something!! ;D _________________ ACHTUNG!
ALLES TURISTEN UND NONTEKNISCHEN LOOKENPEEPERS!
DAS KOMPUTERMASCHINE IST NICHT FÜR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKSEN.
IST NICHT FÜR GEWERKEN BEI DUMMKOPFEN. DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HÄNDER IN DAS POCKETS MUSS.
ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN. |
|
Back to top
|
|
 |
Tim Kleinert
Joined: Mar 12, 2004 Posts: 1148 Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236
|
Posted: Sun Oct 28, 2007 3:07 pm Post subject:
Re: polyphonic "intelligent elastic audio" sampler Subject description: sample-accurate intelligent grain detection and other goodies :-) |
 |
|
Fozzie wrote: |
You keep amazing me with your contraptions. However, as I was just about to get to grips with your previous time-stamping and grain techniques, I am utterly lost here looking at your patch. I know you don't want to explain the whole thing, but could I seduce you to say a few things about the new timing-technique? |
Sure. It's so glaringly obvious that nobody thought of it. The delay line is 2.7 seconds long, which equals 259200 samples at 96kHz. So all you have to do is make the G2 count to 259200. Doh! Counter circuits can be built with feedbacking mixers.
That's the easy theory. The hard practice is actually getting it to work .
Fozzie wrote: | I love your 'old' beat-syncable elastic audio patches; could this new timing stuff also be used to sync to the master clock? |
Absolutely, but with vastly improved audio quality. Time stamping took away 2 bits of audio resolution, and the 24kHz readout pointers didn't make things better either. Plus, the intelligent time stretching is a totally different ballgame. I'll patch it next time I have time. |
|
Back to top
|
|
 |
Blue Hell
Site Admin

Joined: Apr 03, 2004 Posts: 24033 Location: The Netherlands, Enschede
Audio files: 276
G2 patch files: 320
|
Posted: Sun Oct 28, 2007 3:28 pm Post subject:
Re: polyphonic "intelligent elastic audio" sampler Subject description: sample-accurate intelligent grain detection and other goodies :-) |
 |
|
tim wrote: | Sure. It's so glaringly obvious that nobody thought of it. [...] So all you have to do is make the G2 count to 259200. |
Sounds obvious now  _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
Burp

Joined: Dec 18, 2006 Posts: 51 Location: Utrecht - NL
G2 patch files: 7
|
Posted: Mon Oct 29, 2007 12:09 am Post subject:
|
 |
|
Amazing, and what a great obvious idea to count the sample length!
Can't wait to play with it. _________________ if you don't know where you're going, you will allways arrive |
|
Back to top
|
|
 |
mother misty

Joined: May 13, 2004 Posts: 681 Location: Ghent / Belgium
Audio files: 82
G2 patch files: 130
|
Posted: Mon Oct 29, 2007 6:03 am Post subject:
|
 |
|
Nice piece of work!
Lots of fun!
thanks for sharing!
misty. |
|
Back to top
|
|
 |
Aesoteric

Joined: Nov 29, 2005 Posts: 11 Location: Bristol
G2 patch files: 2
|
Posted: Thu Nov 01, 2007 4:55 pm Post subject:
|
 |
|
Tim, this is amazing stuff.
You always seem to remotivate me to more complex patching on my modular. I adore my G2 for live work (processing/sampling/mangling), but as soon as I get the thought of more advanced patching (granular), I get drawn back to Max, as it causes me less of a headache, but I've been toying with the idea of building some kind of mlr ( http://monome.org/data/app/mlr ) functionality into one of your loop-reorder patches.
I'm always looking for ways to take the pressure off my laptop live, so anything I can do with the G2 is a help. To be able to sample a loop, jump around in 16ths triggered by CC assigned pads quantised to the master clock. And perhaps even to be able to record button push patterns...
Anyways, thanks for these amazing patches, and for the inspiration. If you have any suggestions about the best way to keep the quantise tight, then please, please feel free to share!!
Cheers,
Tim (the other one) |
|
Back to top
|
|
 |
Tim Kleinert
Joined: Mar 12, 2004 Posts: 1148 Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236
|
Posted: Sat Nov 03, 2007 11:19 am Post subject:
|
 |
|
Aesoteric wrote: | To be able to sample a loop, jump around in 16ths triggered by CC assigned pads quantised to the master clock. And perhaps even to be able to record button push patterns...
Anyways, thanks for these amazing patches, and for the inspiration. If you have any suggestions about the best way to keep the quantise tight, then please, please feel free to share!!
Cheers,
Tim (the other one) |
You're welcome, Tim . Accessing the individual 16th slices after capturing is an easy task with my approach. I measure the length of the sampled loop with a precision of 1/96000 second. 16th fractionals of that value gets me to the individual slices -very easy, in theory. I say "in theory", because many modules have exhibited very subtle unprecisions, undetectable in normal applications, but noticeable with low-level stuff like this. (Eg., the NoteScaler or the Xfader are very very subtly out of whack.)
I don't quite understand what you mean with "CC assigned pads"? Wouldn't it be more straightforward to use MIDI Note On/Offs to trigger the individual slices?
Explain what you need and I can try to have a go at it. Shouldn't be that hard...
best,
tim |
|
Back to top
|
|
 |
Aesoteric

Joined: Nov 29, 2005 Posts: 11 Location: Bristol
G2 patch files: 2
|
Posted: Sun Nov 04, 2007 4:07 am Post subject:
|
 |
|
Hi Tim,
Thanks! The basic idea is you can sample a phrase, which is then chopped into 16/8/4 slices and each slice assigned to a midi note. The sample plays as normal unless you press a key, which then jumps playback to this position, and the sample continues from there. Jumps are quantized according to a specified subdivision of the master clock.
More advanced tricks are to be able to record a series of 16/8 notes in real time to create a new pattern that will loop until told to stop, when playback will return to normal.
Finally, probably the most unrealistic idea on the G2, would be to be able to push two notes simultaneously, and for the phrase to loop between those two points only. For example, the loop goes 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16...then you push 2+4, it would loop 2, 3, 4, 2, 3, 4, 2, 3, 4 etc. until you hit another note which will recommence playback from that point.
If you get a chance to try any of this out, I would be hugely grateful. I spent yesterday banging my head into my Powerbook with frustration.
A lot of thank you's,
Cheers,
Tim |
|
Back to top
|
|
 |
Tim Kleinert
Joined: Mar 12, 2004 Posts: 1148 Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236
|
Posted: Sun Nov 04, 2007 4:39 am Post subject:
|
 |
|
All of this, even the last bit with looping between the region defined by two keys, is doable. I already have an idea how to patch it.
Cannot guarantee yet if it will still fit on a single DSP, but conceptually it's possible on the G2. I'll patch it.
However, give me a weeks time, as I only have access to the internet on weekends at the moment.
Have a good week.
tim |
|
Back to top
|
|
 |
Aesoteric

Joined: Nov 29, 2005 Posts: 11 Location: Bristol
G2 patch files: 2
|
Posted: Sun Nov 04, 2007 5:39 am Post subject:
|
 |
|
Thanks a million Tim,
If you happen to find yourself in the UK, I owe you a bunch of beers...
Have a good week yourself.
Cheers,
Tim |
|
Back to top
|
|
 |
W.T.

Joined: Jul 11, 2004 Posts: 272 Location: The Netherlands
Audio files: 1
G2 patch files: 11
|
Posted: Mon Feb 11, 2008 6:39 am Post subject:
|
 |
|
It makes a lot of hard and aggressive noise sounds!
thanks a lot  |
|
Back to top
|
|
 |
|