Hi everyone,
I'm working on a system to automatically generate a vline~ message list starting from a custom envelope shape stored in an array, originally extracted from a .wav file.
I want to build a dynamic vline~ list like this: 0, 1 93.753, 1 0 187.506
But instead of typing values manually, I'd like to generate it automatically based on the shape of an envelope loaded from a waveform (array).
I already convert the array index to milliseconds using: [expr ($f1 / 44100) * 1000]
And I can manually draw or extract the envelope into an array — but I’m struggling to automate the construction of the vline~ list so it correctly represents:
- attacks
- holds
- releases
- plateaus (ecc)
at the moment i Load a .wav file containing an envelope shape, Store it into an array. Detect meaningful breakpoints (e.g. slope changes, thresholds) and Use those to automatically create a proper vline~ sequence.
here the patch and one env wav file
impose-envelope-wavetable-analog.pd
strike-1_6.wav
Is there a way to extract breakpoints or slope changes from an array to build a proper vline~ message?
Has anyone implemented something similar (using an envelope from a .wav as a wavetable)?
Would “wavetable envelope” be a good term for this? Is there a better one in Pd terminology?
Thanks in advance if anyone has ideas or guidance.
Even partial thoughts or pointers would help a lot!
I almost forgot: At the moment, I’m using GPT to convert the vline~ list into the format 0, 1 93.753, 1 0 187.506 (just an example), starting from a total duration in milliseconds — in this case, 2176 ms. This naturally results in very complex lists, like something along these lines:
0, 1 100, 0.6 400 100, 0.3 2000 500, 0.15 3000 2500, 0 10491 5500
I’d really like to find a way to resolve this and automate the process, but since I’m still a beginner, I wonder if I’m just making things unnecessarily complicated?
Emiliano