Overlapping one sound multiple times with minim library

Hi, I’m working on the sound part of an interactive installation that would need an event to be triggered by osc an undefined number of times, making the sound linked to it overlaps instead of being rewinded and started again.

Would it be possible to do that without needing to make an array of loadings of the same sound?

Do you think it would be easier to achieve it with another programming software? Actually I’ve found myself in the same difficulties trying to do it with puredata. Any tip or clue would be extremely welcome.
Thanks a lot!

Hi :wave: I think as you mentioned, you need to set up an array for that. And it’s the same for puredata - if I remember correctly, you need to set up multiple subpatches using poly or something.

I thought node.js can be an easy way to do it, but on windows I tried sound-play, play-sound and audio-play and none of them worked out of the box. I mean, their idea is to use external commands like mplayer behind the scene - so maybe the easiest way is to trigger a system command (e.g., mplayer) from Processing to play the sound with exec() - like exec("mplayer sound.mp3"); - if you don’t have to control the player (e.g., stop the sound, toggle loop)

Hi, @micuat, thanks a lot for the inputs.
So, if the idea is making subpatches (pd) or making an array of loads (processing) , maybe it’s better to try the pd way: charge the audiodata in an array and read it from multiple subpatches via tabread4~.
Even that, I didn’t know it was allowed to open other programs from processing! That’s hyperpowerful, thanks a lot for show it to me!

Will try diferent options and post it here, including the solution not being processing.
Thanks again!

1 Like

Hi, thanks @micuat for the info. Finally that’s what I’ve done in pd:
Built different readers using [tabread4~] with [phasor~] for accessing independently from a single audioarray [table], each one of them with a control int for checking if they are actually reading the sound. In the moment where the osc message comes in, it iterates over the different control ints searching for the first one that is not being readen, and therefore reads the array with that first not used reader. Thanks!

1 Like

Hi @rojele. It sounds like you have a decent solution in Pd but I will just mention that my Processing library Pd4P3 GitHub - robertesler/Pd4P3: A real-time audio synthesis library for Processing 3. Pd4P3 implements Pure Data's signal processing objects via Pd++ native code. Pd4P3 stands for "Pd++ for Processing 3". brings all of the signal processing of Pd into Processing using Native code.
You can read from the same array using multiple [tabread4] objects, but with the Java lib you could also create and or destroy the Tabread4 objects as you need them or even copy the array if you need to.
There is an example I use from Pd’s here: Pd4P3/TimeCompression.pde at main · robertesler/Pd4P3 · GitHub

It reads from a single array from different Tabread4 objects. I happy to help if you need any. Your project sounds interesting. Good luck.

1 Like

Hi, @robertesler! Sounds impressive, good job, my congrats. Unfortunately, I’ve tried to reproduce different examples in windows 10 and haven’t got any output except for this one:

Attempting to load pdplusplus.dll

Maybe a disconfiguration in my side? I downloaded the libary from here:
https://www.robertesler.com/software/Pd4P3.zip
and put it in the correct place, that’s for sure.

Would like to see it in action. Sounds great. Congratulations again for the job!

Thanks @rojele. I’m sorry it’s not working for you. Are you using P3 or P4? Can you try deleting it and installing it from the Contribution Manager? Then try the Oscilloscope example. If you can at least see the animation then it’s working, just have to figure out the audio client. It will default to the system client. It should also print something like:

Attempting to load pdplusplus.dll
Output Device: Primary Sound Driver max chs: 2
Input Device: Primary Sound Capture Driver max chs: 2

If you get other errors or can’t build a sketch let me know, or post an issue here: Issues · robertesler/Pd4P3 · GitHub
I haven’t had issues with Windows 10 yet so hopefully we can figure it out.
If you are trying any of the SoundFiles examples then perhaps it is the path to the audio file, I don’t yet use built in paths (e.g. ./audio.wav) or include any audio files so you would have to specify the exact path. I do have an example of some file path tools in the same SoundFiles folder. Like Pd too, it doesn’t accept any compressed audio formats (only .wav, .aiff and raw).
Please let me know if I can be of any other help. Thanks again for the feedback.

Hi, @robertesler, sorry for the delay. I did what you said about downloading again from the contribution manager but I haven’t got any sound output from any of the examples. Maybe I’m forgotten anything? Puredata doesn’t need to be opened while pd4p3 is working,am I right?
I’m using windows with p3, and I frequently work with pd without problems.
When I try the oscilloscope example I get this output:

Attempting to load pdplusplus.dll
Output Device: Controlador primario de sonido max chs: 2
Input Device: Controlador primario de captura de sonido max chs: 2

When I tried the Soundfiles examples I made sure a valid url wahs put on so I really don’t know what else I can do.
Any step that I could have forgotten out of simply open processing and an pd4p3 example from the examples list?
Thanks, take care.

Hi @rojele. Thanks for getting back to this. Everything seems like it should be working. You have the correct print statements and if it isn’t crashing then the sketch is working. The only thing I can think of is your audio configuration is writing to a different audio device that isn’t working as expected.
Otherwise I’m stumped. The lib is completely independent from Pd so you don’t need Pd open or anything like that. Though I have had some odd issues with Windows audio when using ASIO drivers. They tend to behave strange when using multiple audio applications. But short from that the library has worked very well on all platforms I have tested.
I’d be happy to help more, you can always PM me and we can figure out a better method, a remote meeting or something.
Sorry I can’t help more at this moment. If you find a bug please let me know. Thanks for trying.