Working on a thing to sonify silent colour videos.

One [vcf~] per pixel with center frequency Hz determined by hue and Q determined by saturation (just using HSV for now, nothing fancy).

One 20ms delay line per column of pixels

Input to each column's filters is a weighted sum of nearby delay lines.

Output is panned to stereo according to column's position in space

Decidedly not realtime even with OpenMP parallelism on 16 CPU threads.

(though maybe if I ported it to OpenCL and used single precision on GPU and kept video resolution low...)

Smooth droney sounds.

Maybe I can make it richer with some [hilbert~] magic (given a sinusoid, hilbert~ outputs 2 sinusoids approximately 90degrees out of phase for "most" of the spectrum, allowing you to get a [phasor~] out of it, which you can then waveshape at will - I'm thinking Chebyshev polynomial recursion to get bandlimited sawtooth waves).

Follow

@mathr How do you have video information direct sound then exactly? Just by volume, xceeding certain thrshholds and such. Or a complete FFT analysis with an array of values and interpretations behind?

· · Web · 1 · 0 · 0

@jayrope currently it's downscaled to 160x90 pixels. then each pixel has a delay line, vcf, and sawtooth waveshaper in a feedback loop, with the delays being read from neighbouring pixels too (like a spatial blur). the colour of each pixel in HSV space controls the filter: hue controls pitch (scaled like mtof over two octave range), saturation*value controls Q. full details in the source code:
code.mathr.co.uk/rodney/tree/6 check sonify.cl for the DSP, sonify.c for the control code, and sonify.sh for how to use it

@mathr Ah, so that's not Puredata anymore. My C skills are next to zero. Shame on that. And thank you for the pointer.

@jayrope inspired by / copy/pasta from Pd source code, but not Pd it's true. might be possible to rig up something similar with clone~, but I'm not really using Pd much at all any more, find it easier to edit text than patches....

@mathr How do you copypaste form PD in regards to C code?

@jayrope compare my code.mathr.co.uk/rodney/blob/6 vcf function with the inner loop of Pd's github.com/pure-data/pure-data (Pd has a linear interpolated table lookup for cos() which is faster but less accurate; I just use the C math library which makes it simpler but slower - lines 415,419-433 of Pd's code are implementing something like `cos(cf)` and `sin(cf)`)

the process is extracting the core mathematics/algorithms, and hardcoding it in C without any of the wrapping API layers that make it useable from a patcher system

Sign in to participate in the conversation
Mastodon

This is a brand new server run by the main developers of the project as a spin-off of mastodon.social 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!