Cut-and-paste shenanigans
Hi there,
I've been trying to incorporate a Karplus-Strong patch into a larger, modular synthesizer patch. The original one works fine. But, when I paste it into my new environment, it doesn't work. The audio signal just goes haywire, into the millions! I tried fiddling with different aspects of the patch, until I noticed something interesting:
When I took the original working patch, selected all, cut, and pasted it exactly in place, it went haywire! When I checked the original patch to the cut-and-pasted patch in a text editor, they showed to be identical, line for line. Yet one works and one doesn't work!
Can someone explain?
Thanks!
#N canvas 257 182 679 589 12;
#X obj 376 141 noise~;
#X obj 376 231 *~;
#X obj 214 -53 inlet;
#X obj 214 4 tabread pitches;
#X obj 214 479 outlet~;
#X obj 214 52 *;
#X obj 232 28 r transpose;
#X obj 214 188 pow -1;
#X obj 214 165 / 1000;
#X obj 214 -21 unpack f f;
#X msg 435 207 1;
#X msg 473 207 0;
#X obj 376 263 delwrite~ \$0-buffer 1000;
#X obj 435 119 t b f;
#X obj 214 431 *~;
#X obj 467 148 / 127;
#X obj 403 81 sel 0;
#X obj 473 178 del 8;
#X obj 398 -27 block~ 16;
#X obj 403 331 pack 0 0;
#X msg 403 358 \$1 \$2;
#X msg 483 358 \$1 \$2;
#X obj 483 331 pack 0 0;
#X obj 403 386 vline~;
#X obj 214 138 *;
#X msg 214 109 1;
#X obj 130 -11 * 0.001;
#X obj 130 14 + 1;
#X obj 130 67 line;
#X obj 130 -42 r padx;
#X msg 130 37 \$1 \, 1 50;
#X obj 214 236 vd~ \$0-buffer;
#X obj 536 301 r attack;
#X obj 456 301 r release;
#N canvas 1004 293 523 595 pitchdamping 0;
#X obj 78 146 inlet;
#X obj 78 479 outlet;
#X obj 78 265 log;
#X obj 78 290 / 2.30259;
#X obj 78 451 min 0.9999;
#X obj 78 420 expr 1 - pow(10 \, $f1);
#X floatatom 200 317 5 0 0 0 - - -;
#X obj 78 315 - 3;
#X obj 78 345 * -0.85;
#X obj 78 392 -;
#X obj 272 328 * -1;
#X obj 272 353 + 3;
#X obj 272 147 inlet;
#X floatatom 179 510 5 0 0 0 - - -;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 6 0;
#X connect 3 0 7 0;
#X connect 4 0 1 0;
#X connect 4 0 13 0;
#X connect 5 0 4 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 5 0;
#X connect 10 0 11 0;
#X connect 11 0 9 1;
#X connect 12 0 10 0;
#X restore 260 362 pd pitchdamping;
#N canvas 484 241 448 487 FIR 0;
#X obj 170 151 z~;
#X obj 188 126 / 2;
#X obj 250 149 z~;
#X obj 90 204 *~ 0.3333;
#X obj 90 25 inlet~;
#X obj 90 420 outlet~;
#X obj 170 204 *~ 0.3333;
#X obj 250 204 *~ 0.3333;
#X obj 90 325 expr~ $v1 + $v2 + $v3;
#X obj 283 28 inlet;
#X connect 0 0 6 0;
#X connect 1 0 0 1;
#X connect 2 0 7 0;
#X connect 3 0 8 0;
#X connect 4 0 3 0;
#X connect 4 0 0 0;
#X connect 4 0 2 0;
#X connect 6 0 8 1;
#X connect 7 0 8 2;
#X connect 8 0 5 0;
#X connect 9 0 1 0;
#X connect 9 0 2 1;
#X restore 214 304 pd FIR;
#N canvas 563 611 642 618 interpolator 0;
#X obj 232 74 -;
#X obj 80 76 -;
#X obj 99 -1 -;
#X obj 232 96 /;
#X obj 80 97 /;
#X obj 213 128 *;
#X obj 3 73 -;
#X obj 213 150 +;
#X obj 43 128 *;
#X obj 43 150 +;
#X obj 99 -23 r anchorfreq2;
#X obj 184 -23 r anchorfreq1;
#X obj 232 31 r stringdamp2;
#X obj 350 32 r stringdamp1;
#X obj 80 44 r soften2;
#X obj 147 44 r soften1;
#X obj 213 236 outlet;
#X obj 43 234 outlet;
#X obj 147 67 t b f;
#X obj 350 57 t b f;
#X obj 43 191 limit 0 8 0;
#X obj 213 189 limit 0 1 0;
#X obj 7 5 inlet;
#X floatatom 302 227 5 0 0 0 - - -;
#X connect 0 0 3 0;
#X connect 1 0 4 0;
#X connect 2 0 3 1;
#X connect 2 0 4 1;
#X connect 3 0 5 1;
#X connect 4 0 8 1;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 6 0 8 0;
#X connect 7 0 21 0;
#X connect 8 0 9 0;
#X connect 9 0 20 0;
#X connect 10 0 2 0;
#X connect 10 0 6 1;
#X connect 11 0 2 1;
#X connect 12 0 0 0;
#X connect 12 0 7 1;
#X connect 12 0 21 1;
#X connect 13 0 19 0;
#X connect 13 0 21 2;
#X connect 14 0 1 0;
#X connect 14 0 9 1;
#X connect 14 0 20 1;
#X connect 15 0 18 0;
#X connect 15 0 20 2;
#X connect 18 0 1 0;
#X connect 18 1 1 1;
#X connect 19 0 0 0;
#X connect 19 1 0 1;
#X connect 20 0 17 0;
#X connect 21 0 16 0;
#X connect 21 0 23 0;
#X connect 22 0 6 0;
#X restore 253 269 pd interpolator;
#X obj 273 67 s freq;
#X obj 214 84 t b f f;
#X obj 214 396 *~;
#X obj 137 343 lop~ 4000;
#X obj 58 189 PRINT;
#X connect 0 0 1 0;
#X connect 1 0 12 0;
#X connect 2 0 9 0;
#X connect 3 0 5 0;
#X connect 5 0 34 0;
#X connect 5 0 37 0;
#X connect 5 0 38 0;
#X connect 6 0 5 1;
#X connect 7 0 31 0;
#X connect 8 0 7 0;
#X connect 9 0 3 0;
#X connect 9 1 16 0;
#X connect 10 0 1 1;
#X connect 11 0 1 1;
#X connect 13 0 10 0;
#X connect 13 0 17 0;
#X connect 13 1 15 0;
#X connect 14 0 4 0;
#X connect 15 0 22 0;
#X connect 16 0 19 0;
#X connect 16 1 13 0;
#X connect 17 0 11 0;
#X connect 19 0 20 0;
#X connect 20 0 23 0;
#X connect 21 0 23 0;
#X connect 22 0 21 0;
#X connect 23 0 14 1;
#X connect 24 0 8 0;
#X connect 24 0 41 0;
#X connect 25 0 24 0;
#X connect 26 0 27 0;
#X connect 27 0 30 0;
#X connect 28 0 24 0;
#X connect 29 0 26 0;
#X connect 30 0 28 0;
#X connect 31 0 35 0;
#X connect 32 0 22 1;
#X connect 33 0 19 1;
#X connect 34 0 39 1;
#X connect 35 0 40 0;
#X connect 36 0 35 1;
#X connect 36 1 34 1;
#X connect 38 0 25 0;
#X connect 38 1 24 1;
#X connect 38 2 36 0;
#X connect 39 0 12 0;
#X connect 39 0 14 0;
#X connect 40 0 39 0;
Array settings 'break' Pd gui and control.
Maybe that's it. I'm not too well-versed in reading the verbose error messages.
Here is the patch. I can't say for certain, but it seems to be the "y max" numbox that causes the problem.
#N canvas 0 22 450 300 10;
#N canvas 426 51 662 508 \$0ampenv 0;
#N canvas 651 72 450 278 (subpatch) 0;
#X array \$0array 99 float 1;
#A 0 0.971429 0.971429 0.785714 0.785714 0.790476 0.795238 0.8 0.802857
0.805714 0.808571 0.892857 0.892857 0.892857 0.892857 0.892857 0.892857
0.892857 0.886905 0.880952 0.875 0.869048 0.863096 0.857143 0.844643
0.832143 0.819644 0.807144 0.791072 0.775001 0.75893 0.849995 0.842852
0.828567 0.814281 0.79821 0.782139 0.766068 0.749996 0.728568 0.70714
0.685711 0.666069 0.646426 0.626783 0.607141 0.589998 0.572855 0.555713
0.53857 0.521427 0.50357 0.485713 0.467856 0.449999 0.435714 0.421428
0.407143 0.4 0.364292 0.350007 0.328578 0.314293 0.278579 0.264293
0.25715 0.250008 0.242865 0.235722 0.228579 0.221436 0.214294 0.207151
0.200008 0.192865 0.17858 0.171437 0.164294 0.160723 0.157151 0.150009
0.135723 0.12858 0.107152 0.0928664 0.0785808 0.0571525 0.0571525 0.0428669
0.0357241 0.0357241 0.0357241 0.0285813 0.0357241 0.071438 0.0857236
0 0 0 0;
#X coords 0 1 98 0 200 140 2 0 0;
#X restore 102 121 graph;
#X floatatom 388 265 5 0 0 0 - - -, f 5;
#X obj 388 294 tabread \$0array;
#X msg 372 108 resize \$1;
#X obj 372 130 s \$0array;
#X floatatom 372 80 5 0 0 0 - - -, f 5;
#X obj 372 -13 loadbang;
#X msg 372 49 99;
#X msg 452 190 bounds \$1 \$2 \$3 \$4;
#X floatatom 452 88 5 0 0 2 x_min - -, f 5;
#X floatatom 492 88 5 0 0 2 x_max - -, f 5;
#X floatatom 532 88 5 0 0 2 y_min - -, f 5;
#X floatatom 572 88 5 0 0 2 y_max - -, f 5;
#X obj 452 157 pack f f f f, f 20;
#X obj 452 212 s \$0array;
#X msg 451 16 0;
#X msg 481 16 98;
#X msg 511 16 1;
#X msg 541 16 0;
#X obj 388 338 outlet;
#X floatatom 307 131 5 0 0 2 xmin - -, f 5;
#X floatatom 307 161 5 0 0 2 xmax - -, f 5;
#X floatatom 307 191 5 0 0 2 ymin - -, f 5;
#X floatatom 307 221 5 0 0 2 ymax - -, f 5;
#X floatatom 388 316 5 0 0 0 - - -, f 5;
#X obj 588 17 bang;
#X connect 1 0 2 0;
#X connect 2 0 24 0;
#X connect 3 0 4 0;
#X connect 5 0 3 0;
#X connect 6 0 7 0;
#X connect 6 0 15 0;
#X connect 6 0 16 0;
#X connect 6 0 17 0;
#X connect 6 0 18 0;
#X connect 7 0 5 0;
#X connect 8 0 14 0;
#X connect 9 0 13 0;
#X connect 10 0 13 2;
#X connect 10 0 25 0;
#X connect 11 0 13 1;
#X connect 11 0 25 0;
#X connect 12 0 13 3;
#X connect 12 0 25 0;
#X connect 13 0 8 0;
#X connect 15 0 9 0;
#X connect 16 0 10 0;
#X connect 17 0 11 0;
#X connect 18 0 12 0;
#X connect 20 0 9 0;
#X connect 21 0 10 0;
#X connect 22 0 11 0;
#X connect 23 0 12 0;
#X connect 24 0 19 0;
#X connect 25 0 9 0;
#X coords 0 -1 1 1 260 175 2 100 100;
#X restore 31 32 pd \$0ampenv;
Purr Data 2.5.0
@jancsika failed buid...here's attached the super long log in .txt and .sh formatspurr-data-w64-build-log.txt purr-data-w64-build-log.sh
but basically the last lines are critical (i guess other stuff is related to external libraries troubles with win64 platform...is GEN ready for win64 i.e.?)
make[2]: *** [Makefile:106: /c/purr-data/purr-data/externals/creb/modules/dynwav~.o] Error 1
make[2]: Leaving directory '/c/purr-data/purr-data/externals'
make[1]: *** [Makefile:209: externals_install] Error 2
make[1]: Leaving directory '/c/purr-data/purr-data/packages'
make: *** [Makefile:69: prebuilt_install] Error 2
copying pd-l2ork-specific externals...
done with l2ork addons.
mv: cannot stat 'packages/win32_inno/Output/Purr*.exe': No such file or directory
./tar_em_up.sh: 397: command failed with exit code 1, exiting now.
./tar_em_up.sh: 397: mv packages/win32_inno/Output/Purr*.exe .
Build a MIDI controller with the Arduino, Firmata and Pure Data
Time to start contributing some knowledge back to the wonderful world that is the internet; today, a step by step nice and easy tutorial on getting started to building your own MIDI controllers with the arduino.
When researching for my ableton controller project, I didn’t find much out there about using firmata on an arduino to send data to software. The standard approach just seemed to be create the code in the arduino language, upload it to your board and hack one of those MIDI to USB cables as a bodge job way of getting the MIDI out of the arduino.
So why firmata and pure data? Well the whole idea of firmata is that you flash it to your arduino, and it throws out serial about whats going on with the arduino inputs and outputs, then you decide how the software treats the readings coming in and going out.
Theory out the way, lets build some controllers. You’ll need a few things…
HARDWARE:
An arduino and something to wire into it (for this i’ll be using a pot)
A USB cable for your arduino
SOFTWARE:
Arduino – http://arduino.cc/en/Main/Software
Pure Data – http://puredata.info/downloads
Firmata – http://at.or.at/hans/pd/objects.html#pduino
Something to patch your new controller into; like Reason or Ableton Live
- SETTING UP FIRMATA AND PURE DATA
Install Pure Data and create a folder to store all your patches somewhere. Unzip Firmata and add the files ‘arduino.pd’, ‘arduino-test.pd’ and ‘arduino-help.pd’ to your new Pure Data folder. The ‘arduino.pd’ file is the object that we use in PD for opening up communication with your arduino and routing it to PD. Done? Awesome, your software is almost set up.
- FLASHING FIRMATA TO YOUR ARDUINO
Install the latest version of arduino and open it up. Connect your arduino with the USB cable to your laptop (i’m using a macbook for this by the way). In the example patches, open up “Standard Firmata”, select your board (im using an arduino mega), and your serial port (look for tty.usbserial for use with a USB cable). Then compile and hit the upload button and your arduino is now ready to use firmata and communicate with Pure Data!
- WIRING UP A POT
Potentiometers are cool, and theres a great arduino tutorial of how to wire one up here: http://www.arduino.cc/en/Tutorial/Potentiometer
Basically, all you need to know is that there are three pins; your two outer pins govern voltage flow across the pot, meaning one has to be 5V and the other has to be ground. It doesn’t matter which, but your 5v pin is going to be where your pot reads maximum, so convention dictates this should be the right hand pin. The center pin needs to be connected to an analog in on the arduino and will read the value of the pot as it sweeps from ground (0v) to 5v.
All wired up? Plug it into your laptop and open Pure Data, we’re ready to get things talking.
- SETTING UP OUR PATCH
Open the example “arduino-test.pd” Pure Data patch you copied over earlier. It should look like this one…
The test patch has everything we need to open a connection and enable pins. Firstly, lets delete a bunch of stuff and make our window a bit bigger. Hit Command + E to enter edit mode in Pure Data.
Ok a quick explaination; the key component here is the ‘arduino’ object. This is being drawn from the file you copied in earlier, and is what communicated with your arduino. Here we can do everything to control the arduino from opening a connection, to receiving data.
The large grid allows us to set the mode of each pin on the arduino. Remember pins 0 and 1 are reserved for Rx and Tx. I’m using analog pin 4 for this demo, so I’ve set my pin mode for pin 4 to ‘analog’.
Now we can plug our arduino in and get a reading from the potentiometer.
- ARDUINO INTO PURE DATA
With your arduino plugged in, hit command and E to bring us out of edit mode. In our patch, click on ‘Devices’ above the arduino object and open up the pure data terminal. (That other thing that loads with PD that has all the scary code in)
The “Devices” message connected to the arduino object pings your computer to find what devices are connected and on what serial ports. Since we’re using a USB cable to connect our arduino, we’re looking for something with ‘usbserial’ in it, in this case; port 2.
Select the relevent port in the green box at the top (remember the first box is ‘0’, second is ‘1’ and so forth) and hit ‘Open’ to establish a connection. Check the terminal to see if the connection was sucessful.
Now lets check we’re getting something in. Create a number box (Command + 3) and connect it to the relevent pin on the ‘Route analog’ box at the bottom. In this case, pin 4.
One more thing; if you’re not getting any readings in, you’ll need to click on ‘pd old analog/digital controls’ and enable your pins here too. What I tend to do in my patches is just not include the large grid but make my own ‘old pd’ controls custom to what i’m enabling/disabling to save space.
Here’s what the ‘old analog/digital controls’ subpatch looks like (pin 4 enabled)…
Come out of edit mode and check that you’ve got readings. If so congratulations! If not, troubleshoot, start with making sure your usb connection is opened, make sure all the correct pins are enabled (remember you’re counting from 0 not 1 on most of these buttons in PD, it’s just the way computers work).
- SCALING READINGS TO MIDI
So we’ve got a reading and chances are it’s to 3 decimal places between 0 to 1. No problem, create a new object (Command + 1) and type “autoscale 0 127”. This allows us to scale the input to a min and max value, in this case 0 to 127 of MIDI. Next, lets get things looking nice, create a new object and type “knob”. Connect this AFTER the autoscale object. (the knob is default set to read inputs from 0 to 127. Then create another number to display the scaled MIDI data coming out, and finally a new object and type “ctlout 1”.
It should look something like this…
The second box should be outputing values from 0 – 127 now, and the knob giving a visual representation of your potentiometer.
Now lets patch it into ableton…
- PURE DATA TO ABLETON LIVE
Firstly, you’ll need to set up your macs IAC driver if you’ve not done this. Basically you’ll need to go into Audio/MIDI preferences and enable your IAC driver. Then create a new input and output. One for input to DAW and one for output from DAW. Google around for a tutorial on this, its really simple, a 30 second job.
After you’ve set up your IAC driver, go back to PD and go to preferences > MIDI Settings, and connect your IAC driver.
Open ableton and go to its MIDI preferences. Create a device listing for your IAC driver and enable its ins and outs into ableton like so…
And thats it! Create an instrument and try to assign something! I’ve got it controlling the brightness of a bass sound here.
Shout out for Facu who requested this tutorial. Hopefully it’ll help some of you looking to get into this stuff and start building things but with no idea where to start.
Purr Data rc5
Purr Data release candidate 5!
- small fixes to OSX app bundle name and build instructions
- fixed OSX app bundle name
- fixed GUI errors with some GUI objects on GOP
- use cat icon for patches
- fixed a [grid] crasher with binding symbol leak
- fixed [grid] line drawing bug and GOP xlet display
- added dialog and scale handle for [grid]
- ported moonlib/knob
- get rid of some extraneous debugging messages
- allow to install Purr Data alongside Pd-l2ork
- Scope~ code cleanup
- fixes for arm build
- added some OSX app bundle dependencies for [fluid~] and others
- fix saving preferences under OSX
- added startup paths and libs to preferences dialog
- use "Purr Data" in OSX menu app
- help browser fixes
- fixed MIDI preference saving on OSX and Windows
- added a "Recent Files" menu to the "File" menu
- get consistent behavior for present working directory when opening/saving files
- fix Volume name for OSX dmg installer
- try to standardize a deterministic package name when compiling Purr Data
- add a Pd-l2ork-specific version number
- add command line open args to "Recent Files" list
- fixed crasher with ds "canvas" field
- allow saving the zoom level per canvas
please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries:
Purr Data rc4
Edit: Windows binary is now up
Purr Data release candidate 4!
- fixed race when opening pd file in OSX
- partial fix for midi prefs not getting saved under Windows
- fixed #194: saving a loaded abstraction gives errors
- fixed for #201: new subcanvas position isn't saved with patch
- sync the ALSA sequencer port state with the GUI
- reset ALSA MIDI device handles and event buffers when closing
- got rid of more debugging output
- go ahead and allow curly braces in Pd messages
- replace the Pd-extended output~ abstraction with Alexandre Porres' improved version
- report userful value for "dsp-status" method of [pdinfo] by ignorning suspend/resume
- fixed display of dollar signs in properties dialogs
- fixed loading of lyonpotpourri and disis libraries
please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries:
Purr Data rc3
Purr Data release candidate 3!
- fixed race with [dsp-state(--[pdinfo]
- fixed preference saving on Windows 10
- small fix to the prepend.pd abstraction for cyclone to take variable number
- fixed receive symbol in number box
- fixed help menu links
- fixed vu scale font size
- fixed [table] default array display
- improved canvas find
- fixed problem with resizing [cnv] label
- fixed scalar bbox calculation for [plot] et al
- fixed stray errors with ds fields
- fixed openpanel/savepanel GUI errors
please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries:
Purr Data rc2
Purr Data release candidate 2!
- add delread4~ alias for vd~
- load Gem dependencies properly under Windows
- add help menu item for list of internal classes
- various help patch cleanups and fixes
- change zoom/fit keyboard shortcuts so they work on all platforms
- localize the canvas right-click menu
- small fixes to prefs menu and edit menu
- fix bug with color updates for iemguis
- zoom correctly on OSX 10.8
please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries:
OSX 64-bit Caught in a Trap Edition (10.8)
[Edit: typo in the name of the Elvis tune]
Purr Data rc1
Purr Data release candidate 1!
- fix for iemgui colors not getting properly updated
- allow opening a file at OSX startup
- fix weird behavior when dragging files onto a Pd patch
- remove more debugging statements
- fix slider display error
- fix "Select All" on OSX
- fix allowed characters in atom box dialog
- forward console key events to Pd
- change [draw group] to [draw g]
- add fit width/height/optimal zoom shortcuts
- fix consistency bug with [draw]
- put "Window" menu in the customary position next to "Help" menu
- fix clipboard operations for patch snippets
- some translation fixes
- some Pd-l2ork fixes backported
- improvements for opening files in the same instance
please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries:
Purr Data Beta 4
Purr Data Beta 4!
This is the GUI port of Pd-l2ork from tcl/tk to nw.js. Canvas zooming, svg-based data structure drawings, GUI theming, and more...
- automatic translations based on system local (plus German translations)
- added ds tutorial for field parameters
- fixes for automatic multi-connection behavior
- fixes for preset_hub/node
- fix for resizing [cnv] with mouse
- fixes for OSX Makefile
- add feature to open files in the running instance
- port unauthorized/grid
- various other bugfixes
This is a beta release, so please report lots of bugs to
https://git.purrdata.net/jwilkes/purr-data/issues
Binaries: