I'm new to Pd and generally more comfortable with imperative languages so I'm struggling a bit with arrays of stuctured data.
What I'm trying to achieve is something like this:
- define a structure that is capable of:
- receiving a path to a .wav file to play
- playing the .wav file
- receiving two arguments (for example pitch and volume) to alter .wav file playback
- automatically patch audio output to
- trigger a message via libPD to create or destroy such a structure and push/pop it to a list so it can be easily managed.
In simpler terms I'd like to be able to add or remove different .wav players passing for each player a different .wav file path and different volume/pitch.
I had a look on the forum and already found the tips-for-arrays post super helpful, especially Data_structures_arrays and Popping_and_Pushing_arrays.
That helps in terms of creating a
struct that would hold the data I need to manage in an array (e.g. filename/volume/pitch), but I don't understand how I could have that also automatically create
readsf~ objects and auto route the audio output to
dac~. Additionally, I imagine would some sort of unique ID to be able to remove a certain element from the array dynamically.
How do you recommend I should resolve this ?
Thank you for your time,