-
youcloudsofdoom
Ah, excellent, that does it! Thank you again!
-
youcloudsofdoom
Hmm, yeah, that's what I thought - I've attached the patch I just edited, can you tell me if this is acting right to you?list3.pd
-
youcloudsofdoom
One last thing - if I wanted to flip it so that it output the highest number, rather than lowest, what would need to be changed? I've had a quick play and can't quite get that functionality to work.
-
youcloudsofdoom
@gsagostinho ah, for some reason when I redownloaded it, the patch worked fine! Thanks so much for that, you solved some serious headscratching I was having!
-
youcloudsofdoom
@gsagostinho Ah, okay, I must have misunderstood your patch then - I've replaced inf with 1000, and it seems that only the first list I send gets through the spigot, and then anything else isn't passed, regardless of what number it ends in. What have I missed here?
-
youcloudsofdoom
Hi @gsagostinho and @rjp9
Thanks for taking the time to reply! I really appreciate it.
I don't think I explained my requirements properly, as I don't think these aren't quite what I was after. The exact situation is that each list is a set of midi info basically, ending in the negative number. Each of these lists is being sent from another software over OSC at various times. I want to only play the midi info contained in the list ending with the lowest number at any one point, which will probably involve checking incoming lists against what is already playing back, and replacing the currently playing list with the new one, if that new list has a lower negative number (by that I mean if a list ending in -32 was playing, then that would be replaced if a list with -23 was received). Is that a little clearer? It's a weird situation and an odd problem, I know!
-
youcloudsofdoom
Hi all,
So, I have lists formatted as a series of varying-length strings each ending in a negative number, such as:
[this that and -32(
and
[but 35that -23(
etc
I have these coming into my patch at various times, and what I need is a way to check each list as it arrives, and to only pass it if it ends in a negative number smaller than that in any of the previous lists. There may at times be two or three such lists arriving at once, so any solution needs to dynamically compare multiple lists and output the list which ends in the smallest number. Any thoughts on how this could be achieved? -
youcloudsofdoom
I solved it actually - turns out it was due to user permissions for the script in rc.local which meant the script didn't have access to the sound hardware. For future ref if you have this problem, you need to add the main user (in this case pi) to the rc.local script along with whatever you want it to execute.
-
youcloudsofdoom
Hi all,
I'm using a Pi to auto run a script that runs pd-extended in nogui made on startup. On start up, the script appears to run fine, no errors in the log, but there's no sound. If I stop that process and then run the same script again manually, it runs fine and there is sound. I've tried putting a 1 sec delay between loadbang and dsp in the patch as suggested elsewhere, and I've also tried running the login script from both crontab and /etc/rc.local, both with the same results. Any suggestions?
-
youcloudsofdoom
Hmm so I built a system around what we discussed here, but something's still going wrong. When I launch this on my Mac, it runs correctly - the list populates, starts playing a random track from it, and then at the end sfplay bangs out and another random track is selected and played (repetitions are fine).
However, when I run this on my Pi, it always plays the playlist in the same order (though that order appears to have been randomly generated) when it loads, and continues playing through it in the same order after the first track finishes. Very odd. Any thoughts?
-
youcloudsofdoom
Ah, got it, didn't realise the inlet on the browser accepted messages instead of bangs. Excellent, just going to put a [random] in front of it which receives the bang from sfplay~. Perfect, thanks!
-
youcloudsofdoom
@EEight I am waiting on a new SD card so haven't had the chance to run your solution on the Pi yet, but thank you so much for posting it.
@alistair_blunt this also looks very interesting - how can you randomise the list order? If it randomised the order every time the folder was loaded, I could just bang out from sfplay~ at end of file and have it generate another random track for me...that would be exactly what I need!
-
youcloudsofdoom
It's on a pi, though my python knowledge is almost non existent! That sounds like an interesting solution though...
-
youcloudsofdoom
Hi all,
I want to make a randomised playlist of audio files using Pd - the plan is to have a USB stick full of wav files that can just be plugged in and have an a randomised, looping playlist made from them when Pd boots. This way I can change the tracks just by loading new files onto the USB stick, without having to alter the patch each time. What's the best solution for this?
-
youcloudsofdoom
I run the script with sudo, it won't execute properly without it. Weirdly I replaced [udpreceive] with [dumpOSC] and the problem corrected itself - the issue is now that dumpOSC has a really noticeable lag compared to udpreceive (possibly one of the reasons it was retired!). I'm going to try it with netrecieive and see what happens.
-
youcloudsofdoom
Yeah, good idea Alexandros, thanks.
Here's the shell script:
#!/bin/bash NUM_BANKS=20 while [[ "$input" != "\e" ]] ; do networks=$(iwlist wlan0 scanning | awk 'BEGIN{ FS="[:=]"; OFS = " " } /ESSID/{ #gsub(/ /,"\\ ",$2) #gsub(/\"/,"",$2) essid[c++]=$2 } /Address/{ gsub(/.*Address: /,"") address[a++]=$0 } /Encryption key/{ encryption[d++]=$2 } /Quality/{ gsub(/ dBm /,"") signal[b++]=$3 } END { for( c in essid ) { print "/wlan_scan ",essid[c],signal[c],encryption[c] } }' ) read -t 0.3 input echo "$networks" | while read network; do set $network hash=` echo "$2" | md5sum | awk '{ print $1 }'| tr '[:lower:]' '[:upper:]'` bank=`echo "ibase=16;obase=A; $hash%$NUM_BANKS " | bc` echo "$1$bank $2 $3 $4" echo "$1$bank $2 $3 $4" | sendOSC -h localhost 9997 done #echo "$networks" | sendOSC -h localhost 9997 done
This pipes into a Pd patch which reads the info from [udpreceive].
And this is the script I'm trying to make that automates the running of the Pd patch as well as the above scanning script:
#!/bin/bash pd-extended -nogui /home/pi/patch.pd & sudo /home/pi/libOSC/scan.sh && fg
As I said, what seems to be happening is that the first packet is received by Pd, but then none after that. The scanning script is definitely still scanning and sending, but for some reason the packets aren't being received by Pd.
I hope this makes it clearer!
-
youcloudsofdoom
No thoughts? Let me know if there's anything I can add.