-
me-andmymonkey
@whale-av ah, that's a beautiful solution! Thank you
-
me-andmymonkey
Thanks @alexandros.
So, if I just don't have the commas in the text file, I can output a line and format from there, like so:
But can I get [text get] to just output all of the comma separated line from the text file?
-
me-andmymonkey
Okay, so I've got a text file with a number of fields. Each starts with a number, which is followed by comma separated lists, consisting of 3 symbol/float pairs.
The idea is to use [text search] to find the line with the correct number, feed that to [text get] to get all the data in that line, trim off the leading number (and the 'list' identifier) and then send the comma separated lists to a route object, which will route the floats to their respective destinations.
At the moment using [text get] allows me to access the first symbol/float combo. However, I cannot access the second and third symbol/float combo in the comma separated list. This is where I am getting stuck. I don't know how [text get] is dealing with the data and how to access it correctly.
Any advice on how to do this?
Here's a screenshot showing the patch and the text file I am using. Here's the patch: text to list to route.pd and text file: SoundSelect-test.txt
-
me-andmymonkey
@lacuna I'm currently just playing files using [readsf~]. I'm only using [soundfiler] to get the sample length of the next audio file I want to play, so I can figure out what random snippet from it I want to play.
Each audio file might be up to hour or two in length, and there are around 40–50 files the patch can choose from at random, so loading them all into array doesn't seem very efficient to me.
I need the number of samples (and sample rate) of the file in order to do this. [soundfiler] just seems very heavy handed for all I want to do.
[soundfile_info] works perfectly. I'll look into these other solutions you'e flagged.
-
me-andmymonkey
@seb-harmonik-ar I got it working too actually. But I'm still curious about Vanilla-friendly solutions if there are any!
-
me-andmymonkey
Okay, so I know [soundfiler] does exactly this: gives the sample size of a file from its left outlet. However, it is also heavy handed, in that it is causing audio dropouts while another file is playing using readsf~
I know that [soundfile_info] from iemlib does this. However, it's not compiled for 64 bit MacOS and I also need it to run on a Raspverry Pi as well.
Are there other solutions?
-
me-andmymonkey
@oid right on. Thanks very much. Lots of learning in this stuff. Thanks everyone.
-
me-andmymonkey
Hey all, this is a really tidy solution to the problem. I was not aware of the 'urn' object. I assume this is a Max thing that's been brought over to PD.
@whale-av by index I mean, the position of a value in a list message. I hope that makes sense!
@ingox really interesting! I still haven't really dived into the [text] object. I'm still only getting my head around lists.
To make things a little bit more complicated, I also wanted to make it so that instead of totally clearing the 'check list' in my patch (that stores the index values), the list keeps the final 5 values. This would mean that when the 'check list' resets, it still won't output the last 5 values from before the last reset.
I've figure out a way of doing that using [list split] that seems to work well. I'd be curious as to how it would work with [text].
Anyway, thank you both so much. This is great.
-
me-andmymonkey
Hello,
So I've been working on this abstraction that is supposed to select a random element from a 'to use' list, without repeating until every element from the list has been selected.
Each time the list is fed in, another 'check' list stores what index has been used, checking to see if the random index generated has been previously used. If it hasn't, that index is used to pick from the 'to use' list. If the index has been used previously, then a new random number is generated.
If the length of the 'to do' list and the 'check' list are the same, then the 'check' list is cleared and the process starts from fresh.
Okay, so the abstraction I've made technically works. However, I am getting a nasty stack overflow problem when the 'check' list resets. When I trace the error from Pd says that it's coming from the [list-abs/list-find] abstraction I'm using.
Here's the patch: patch.zip
I'm struggling to find a way of getting over this error. Sort of stumped. Any help / a simpler way of getting around this problem would be great...
-
me-andmymonkey
@toxonic thanks for this!
Another library I found with a nice spatialisation external for 4 and 8 channels is this: https://github.com/solipd/AudioLab. Check out pp.spat4~ and pp.spat8~
-
me-andmymonkey
Hello all,
I've been hunting through the forum looking for some examples of Quad Panners that are also usable on a Raspberry Pi. There are some examples out there and others that seem to have been lost to dead web pages over the years.
I thought I'd reach out to see if there anything that people are currently using / worth trying.
C
-
me-andmymonkey
To explain why the last entry is $f1, I need to pass that number on for another operation if it doesn't meet any of the conditions. But of course that was the issue. I've changed the 'true' entry to a three digit number, that then gets caught by a [sel] object to trigger the soundfile.
-
me-andmymonkey
duh! thank you for pointing out that very obvious mistake! @ingox
-
me-andmymonkey
So, I'm working on a patch that is supposed to trigger a sound file to play on the hour and on the half between a specific start and end time.
I'm getting the time using zexy's [time] object. I'm then feed that into an [expr] object that's performing some basic logic to determine if the current time is between the specified start hour and end hour for playback, and either at the beginning of the hour or the beginning of the half hour, and the seconds are equal to zero. If all these conditions are true, the [expr] object outputs a 1, which then triggers the soundfile to play.
This expression looks like this:
expr if(($f1 >= $f4 && $f1 <= $f5) && ($f2 == 30 || $f2 == 0) && ($f3 == 0), 1, $f1)
where:
$f1 is the current hour
$f2 is the current minute
$f3 is the current second
$f4 is the start hour (this is currently set to 12 – i.e. noon)
$f5 is the end hour (currently set at 18 – i.e. 6pm)It works perfectly. However, if $f1, $f2, $f3 are values like 1, 29, 32 (that's 01:29:32 in 24 hour time), the [expr] gives me true when it should be false! 01:29:32 is not within the specified start or end hour for playback.
I can't figure this out at the moment. I'm wondering if someone can help point out what dumb mistake I'm probably making.
Thanks
-
me-andmymonkey
Ah, this makes sense. I wasn't aware that single binary libraries were a thing. I must be getting old.
-
me-andmymonkey
Hey, so I was just working on a patch and realised I could use some zexy externals to help with my problem. But when I try to install zexy, I get all the help files and any other zexy objects that are made as abstractions (.pd files) but there's no .pd_darwin files that have been installed at all. I've installed other externals recently with no problems. I'm wondering what the hell I'm doing wrong?
I'm installing the latest release available (I've tried the other too, with the same problem)
I'm running Mac OS Catalina....
-
me-andmymonkey
@alexandros are you using Buster? Or a different dist of Raspbian? I was able to get around this problem by using LXDE for autostart. However I occasionally get an error now about Alsa not being able to restart.
-
me-andmymonkey
Bump. I'm running into similar issues and can't seem to get around it at the moment. Any help is great appreciated...
-
me-andmymonkey
Hi @whale-av
64bit PD on my Macbook (macOS Catalina).
On the Pi it's 32bit (I'm presuming?).
The file I was originally trying to play was 3.2GB
I made a smaller file that was 398MB and that worked on the Pi no problem. I've made other shorter files (similar file sizes) and I was getting the same error... Sort of stumped.
EDIT: Ignore the last part of my post. I think I was doing something stupid when rendering out...
-
me-andmymonkey
Hey all,
I'm trying to play a (quite large) 8-channel sound file via readsf~ on my Raspberry Pi (I have an 8-channel soundcard for the Pi, which is tested and works using Pure Data).
When I try to play the file, I get the following error:
dsp: /home/pi/Desktop/soundfile.wav: Value too large for defined data type
Does anyone have any ideas what this problem would be? I'e tested this on my Macbook and I can get the file to play. I'm wondering if the file is somehow too large for the Raspberry Pi?
Thanks!
EDIT: The file I was using with the Pi was around 1 hour long (44.1/24 WAV file). I made a shorter 10 minute snippet and it's working. Does anyone know why I can't use the longer file? I didn't think this would be a problem...