[PD] display waveform in GEM

Frank Barknecht fbar at footils.org
Mon Jun 6 14:45:37 CEST 2005

geadsch at controverse.net hat gesagt: // geadsch at controverse.net wrote:

> Yeah, I'll post it soon. Unfortunately I have to tidy it up a bit.
> AND my Laptop crashed yesterday.. aarghh


> Actually I asked a similar question as this a few month ago.
> I also played around a bit with the [curve 2] object and posted my first result
> on the list too..
> But as I couldn't come up (and no-one else) with a effective solution I decided
> just to use .jpg images of the waveforms (as IOhannes suggested)
> Still I would also be very interested in a solution..
> I imagine that a [curve] object with an input for a list of points would be very
> useful..

Now I remember. The approach I took in my suggestion also involves
[repeat]. [repeat] is used to divide one GEM render command, which
occurs every 50 ms normally, into multiple commands: 

  [repeat 50]
  [t a b b b ... ]

While the triggered "a"nythings are sent directly to a [curve 3]
object - which in the example with in fact behave like 50 [curve]s -,
the triggered bangs lookup values stored in a table (the soundfile)
using a simple counter as index i to [tabread]. The resulting values
are then converted into control points for the curve: One is at "i
-y", the other at "i 0" and the third at "i y" which looks like this: 

   |   .
   | | |
   - - - - - -> i
   | | |
   |   °

With "y = [tabread table] at position i".

The index counter is reset to 0 using a bang triggered by [gemhead]
before the [repeat] is reached.

If you need to display bigger soundfiles, it would be wise to do some
averaging so you don't have to display tens of thousands of curves.

 Frank Barknecht                               _ ______footils.org__
          _ __latest track: "scans" _ http://footils.org/cms/show/41

More information about the Pd-list mailing list