How to get distance data from a HC-SR04 Ultrasonic sensor into PD using Pduino?
The thing with the ultra-sound sensor is that it has a trigger and an echo pin. The trigger pin is an output and the echo an input. You send a high voltage to the trigger pin and start counting time until you get a high signal from the echo pin (to be honest, this is an assumption I've made, but I'm pretty convinced that this is how it works). Then you should make some sort of equation to translate the time passed into distance. Probably you should read Arduino's source code and see what's going on in the pulseIn() function.
Stepping Phase shifter
@phil123456 He plays a series of notes, which are then repeated...... as he says you hear the pattern better when he speeds it up and it is certainly repeated with a fading echo.
I just listened a bit further (single notes) and I am pretty sure it is an echo with "phaser" applied........ confirm?.... probably.
Here you go....... I don't have a guitar to check it with...... and I wouldn't be able to play it anyway!...... but........
step_phaser.pd
For Vanilla you will have to replace the "output~" module.......
David.
Stepping Phase shifter
so you confirm a phase shifter is a pd phasor
but what's with the echo ? it does not sound like an echo in the video at all, more like some stepping function on some phasor parameter
Stepping Phase shifter
@phil123456 Have a look in your pd installation folder "Pd/doc/3.audio.examples/H15.phaser.pd......
You will find an example of an echo with feedback (or the feedback will be easy to implement) in the same folder..
Then feed the output of the echo into the phaser and you will have what you want..... with a little work......
David.
ArguScore
Here is an updated version
arguscore-update.zip
and a few Purr Data compatibility replacement objects: purr-data-compatible-replacements.zip
A creation argument only object driven system for instant music making;
Objects so far;
Required;
globaltimer - outputs a 10ms bang to drive all objects;
globalsync - resets all objects to zero or start;
audio~ - dac~ catcher~ for all throws~, output level, mute;
Sound Objects
By default sound objects start playing at the bpm of the first argument
basspump - args - bpm note distortion duration
wood - args - bpm note duration
tremsaw - args - bpm note vibrato distortion duration
tremsine - args - bpm note vibrato noise duration
noisy - args - bpm note vcfq duration
kauplus - args - bpm note string-resonation duration
Effect Objects
sqr - args - 16 required(0 or 1) bpm (starts playing by default)
overides sound objects autoplay
2 optional args for cursor offset and pitch if font different
has 16 outlets to send 0 or 1
echo-delay-bpm - args - bpm feedback(0 to 100) level(0 to 100)
echo-delay-ms - args - millisecs feedback(0 to 100) level(0 to 100)
pan-level - args - pan (-100 to 100) level (0 to 100)
autopan - args - width (0 to 100) frequency (* 0.01) level (0 to 100)
fade - args - millisecs to fade-in pecentage of level to drop to (0 to 100) millisecs to fade-out
filter - args - highpass (midi note to frequency) lowpass (midi note to frequency)
(0 to 135 equates to approx 8Hz to 19912Hz)
start-delay-secs - args - seconds (delays the autostart of the connected object)
start-delay-bpm - args - bpm (delays the autostart of the connected object)
stop-delay-secs - args - seconds (outputs a one at the end of the delay which can connect to a globalsync)
stop-delay-bpm - args - bpm (delays the autostart of the connected object)
isolator - sits between two sqr's and sends a signal to start/stop the receiving sqr
seqnotes - four pairs of note & velocity that receive sqr ones to fire a connected sound object
Notes
Can crash Pd when making lots of edits to arguments, particularly while playing, so save often
There is a [declare -path objects] hiding behind the audio~ object
Fixed missing note and velo message for tremsaw
Two more arguscore patches can be open at the same time providing only one patch contains the globaltimer and audio~ objects (see arguscore-2.pd and arguscore-2-b.pd)
new objects
kauplus, autopan, fade, filter, stop-delay-secs, stop-delay-bpm;
ArguScore
ArguScore
A creation argument only object driven system for instant music making
Objects so far:
Required:
globaltimer - outputs a 10ms bang to drive all objects
globalsync - resets all objects to zero or start
audio~ - dac~ catcher~ for all throws~, output level, mute
Sound Objects
By default sound objects start playing at the bpm of the first argument
basspump - args - bpm note distortion duration
wood - args - bpm note duration
tremsaw - args - bpm note vibrato distortion duration
tremsine - args - bpm note vibrato noise duration
noisy - args - bpm note vcfq duration
Effect Objects
sqr - args - 16 required(0 or 1) bpm (starts playing by default), overides sound objects autoplay, 2 optional args for cursor offset and pitch if font different has 16 outlets to send 0 or 1
echo-delay-bpm args - bpm feedback(0 to 100) level(0 to 100)
echo-delay-ms - args - millisecs feedback(0 to 100) level(0 to 100)
pan-level - args - pan (-100 to 100) level (0 to 100);
start-delay-secs - args - seconds (delays the autostart of the connected object)
start-delay-bpm - args - bpm (delays the autostart of the connected object)
isolator - sits between two sqr's and sends a signal to start/stop the receiving sqr;
seqnotes - four pairs of note & velocity that receive sqr ones to fire a connected sound object
Cheers
Balwyn
arguscore.zip
Abstraction & iteration ?
@weightless That's clever and interesting..... a bedtime chew required.
I would rely on the incoming data. Checking for consistency of a data set of 3 components seems pointless when [route] can be used to send the required (filtered) data to the correct abstraction.
Each data set is arriving as a list...... so cohesive, stuck together... whatever....... no opportunity for error.
So check x....... if else for which [route] can be used
Then check y........ same
Then check z........ same
If the message has passed then send to wherever determined by (presumably) the values of x, or y, or z, or a combination of all 3.
Each abstraction receives only messages intended for it's operation.
A [monomer.abs] wants to know " am I on or off" so it's arguments should be x and y (it's unique coordinates..... the button that controls it).....and whatever else is necessary, and the data it wants is z. I think. If another button also controls it's operation then those coordinates can be added to it's arguments....
So each abstraction receives only the button data it expects.
faust-to-pd external collection (of three sets of examples) I built won't load...
My friends, while this was a worm-hole that I Am glad I went down, I must let it go for my own peace of mind.
I am posting below the shell script I used to convert the faust files, but it is just too far away from what i Really want to do to continue.
Peace, good cheer to you, and may I get back on to making music again.
-svanya
#! /bin/bash
for dsp in `find '/root/00-MYSTUFF/zz_archive/01_tabled/compilefaust/pd-faust-0.4/examples' -name "*.dsp"`
do
FILE="$dsp"
extension="${dsp##*.}"
FILEBASE=$(basename "$FILE" .$extension)
base=`dirname "$dsp"`
echo "$dsp"
echo "$FILEBASE"
echo "$base"
# compile the Faust source and generate the xml file
faust -a puredata.cpp -xml "$dsp" -o "$FILEBASE".cpp
# compile the C++ module to a Pd plugin
g++ -shared -Dmydsp="$FILEBASE" "$FILEBASE".cpp -o "./pdfaust_built/$FILEBASE"~.pd_linux
# generate the Pd patch from the xml file
faust2pd "$dsp".xml --output-file "./pdfaust_built/$FILEBASE~-help.pd"
rm "$FILEBASE".cpp
done
Right-click to view pd files online (via (mozilla's) Web Developer Extension, pd-fileutils, and a shell script)
I stumbled on pd-fileutils and what it can do:
So I put together a linux (tho I'm sure you can make a .bat windows version, too) shell script that will (if added as a "Tool" to the Web Developer Extension (mozilla add-in and probably others too) you can:
View a raw pd webpage, ex. on GitHub (have not tested on others, and in some instances when a link points to a pd file my browser thinks its a binary )
Go to Web Developer Extension > Tools > pd_viewer;
and
See the file in all its real PureData glory.
Two images below and an attached .zip of the needed pd2svg (js + css folders) and the shell script, "pd-fileutils_viewer".
Standard Rule re: downloaded shell scripts:
ALWAYS look inside the script before ever running it on your computer to be sure it does not have anything that would mess up your system.
In this case, what it does is:
Copy the needed files to /tmp, read the online path to the raw file, wget the file to /tmp, take the (base)filename name, echo a header with all the pd-fileutils html stuff, cat in (and sed replace the quotes and apostrophes with their entities) the pd file as a string, then echo the html page footer, and send it to your default browser.
To do this you will need to add the Web Developer Extension, tho I am pretty sure any other add-in/feature that lets you run an app on a page will work too;
extract the contents of the zip below to a location of your choice,
then add the "pd-fileutils_viewer" as a program to view those pages, i.e. as a "tool".
Viola! Pd file ready for viewing!
If you see any wrinkles in this either or ways to improve it let me know and I will see about incorportating or you can do it yourself and share the updated version.
But for now at least: The WWW is in our pd oyster.
Peace, goodwill, and happy music making,
-svanya
note: depending on how much work the pd-fileutils is asked to do, i.e. how complex the patch is it might take a moment to render the svg.
The images below hopefully will guide you thru how to set it up. Basically, add the mozilla Web Developer Extension, then under Tools, point it to where ever you saved the shell (with its folder) script.
Ciao for now
.
Dehumaniser App made using lidpd
Krotos Ltd recently released an iOS version of our Dehumaniser software. The audio side of the app was made using Libpd, and we hope developed will be interested to see how the final app turned out.
Here is some more info:
The desktop version of Dehumaniser is an industry-standard vocal processor, recently used in the blockbuster Avengers: Age of Ultron and numerous other AAA Games titles and movies. Squeezing this pro-audio processing into an iOS app, Dehumaniser is as powerful as it is fun. In ‘Record’ mode you can record your processed voice, replay it or share it via social media or email. ‘Live’ mode processes your voice in real-time, transforming every word, growl or noise you make into a monstrous sound. ‘Echo’ mode takes your speech and echoes it a second later, great for scary duets or pranks! In ‘Camera’ mode you can record a video with your new monstrous voice and share it with family and friends. Dehumanise yourself with four specially designed creatures (the hideous Daemon, terrifying Goblin, gruesome Orc and mysterious Dark Elf)!
Watch a video demo of the app here:
Dehumaniser Lite is a free introduction to Dehumaniser, with limited functionality.
Dehumaniser is available for £1.49 from the App Store, with full functionality.
Check it out here on the App Store:
https://itunes.apple.com/us/app/dehumaniser/id1013186304?mt=8
Please visit http://app.dehumaniser.com/ for videos and more information
thanks
Matt/Krotos Team