Learn PD (Pure Data) and Csound

Started by Elantric, May 31, 2013, 10:02:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


PD (Pure Data)




Csound + iOS: Coming Spectral App Looks Amazing, How to Build Your Own Apps

by Peter Kirn

And they say computer technology for music is "disposable." Csound has a direct lineage to the very first digital audio synthesis ever to run on computers, counting decades of history. It remains an elegant way to make any instrument, event, or musical creation you can imagine, all with a free tool. And now, a Csound file can be baked right into an app for iOS, if you so desire.

Whether or not you're ready to tinker with code, that means more musical goodies for your sonic amusement. And the next in line is something called csSpectral. Boulanger Labs has been hard at work on this one, and it looks like it will yield some insane sonic frontiers.


    The new Csound-based iOS app by Boulanger Labs, csSpectral. Deepak Gopinath (Lead iOS Developer) is using csSpectral to play back a simple beat and transforms the rhythms into a unique percussion track that morphs beyond glitch. This aspect of the app is well-suited for many applications ranging from advanced sound design for film to a mashup of your favorite track.

In other words, it makes crazy noises. Or, in marketing speak, it's well suited to serenading a future mate, providing a futuristic science fiction atmosphere to your next meal, for playing to babies in their cradles to turn them superintelligent and get them into the best afterschool programs later on, or as a means to entering higher states of astral awareness.

Another video below.

If you're ready to make your own app powered by Csound, we've got good news for you: there's a free tutorial to get you started. Download the PDF and, provided you've got the Apple SDKs configured for building apps, you're all set to turn your Csound files into apps:

Csound for iOS API: A Beginner's Guide 1.0 [PDF download, University of York]
Authors: Timothy Neate, Nicholas Arner & Abigail Richardson

One note: I see they make reference to the need to use "dealloc." Checked with Nicholas on this, and it seems the Csound API doesn't yet support Automatic Reference Counting (ARC), so dealloc is needed. (You can actually remove the dealloc statements from the libpd examples, as it does support ARC, just so you know. It's a small detail in the real world, though.)

Otherwise, you'll see an approach very similar to what we've discussed in the free and open source libpd library:


I'll be writing soon about the experience of using that. Actually, I rather look forward to toying around with Csound again, since Csound files can be used everywhere from Max for Live to iOS – and on completely free systems like netbooks and Raspberry Pi and Linux.

So, iOS developers have not one but two popular free and open source libraries well-suited to creating apps you can then distribute on the App Store. I think that's utterly fantastic news. Rather than saying this is free software for the sake of it, it means the sonic creations you build can last. If you decide tomorrow you want to build a stomp box with an embedded Linux audio engine inside using your granular effect, you can – and you can sell an app on Apple's store to fund the hardware run. Not too shabby.

Ah, but what about learning Csound? Glad you asked. Aside from having arguably the best absolute begineer guide to Pd, the volunteer-run flossmanuals comes through with a free tome on Csound.


Or, you can just sit back and let the sonic goodness wash over you, secure in the knowledge that these creations won't go away tomorrow just because the world moves on to some new hardware.

Now, get ready to grab your violin and play along, because here's more reason to be excited about csSpectral:

    Sneak peek of the new Csound-based iOS app by Boulanger Labs, csSpectral. Check out this demo of Takahiko Tsuchiya (Lead Sound Designer) playing violin and Paul Batchelor (SpectralEQ Designer) playing Upright Bass. Their instruments are being processed by Christopher Konopka (Sound/Layout Designer) using csSpectral for real-time acoustic processing and spectral mutation.

I'm still eager for the full Csound Touch to make its debut, but I'm sure it will be worth the wait. And lots of other sonic toys are coming, too:


FWIW - here are Links to other threads where PD (Pure Data) is mentioned

Tutorials and Demos / Learn PD (Pure Data) and Csound

Tablets & SmartPhones for Music / Pure Data engine for embedded devices

Tutorials and Demos / Re: Progress report Tonefreqhz Arduino pedal and Pure Data

Tablets & SmartPhones for Music / Android Gets Patchable Audio Everything: Free Patchfield Architecture

DIY Hardware / Crowd-funded OWL - the Stompbox That Can Become Whatever You Like

Tablets & SmartPhones for Music / Jack for IOS

DIY Hardware / Re: Septar Kit

Hi-Tech Guitar Gear / Re: Bus powered Audio Interfaces with 6 inputs Any Suggestions

Tablets & SmartPhones for Music / Re: Audiobus for IPAD - app-to-app audio streaming for iOS

General Discussion / Re: Melodyne Studio + Fanout Box as Audio to MIDI Studio Tool

Roland GR-55 Discussion / Re: Exp/Pitchbend Pedal Direction?


Free Patching Tool Pd (Pure Data) 0.46 Released: Native OSC, Jack

Pd: Ugly. Hugely useful. Free.
The open-source, free graphical patching environment can do everything from simple MIDI tasks to building synths and effects to advanced multimedia. And because it's free software, it's also been adapted to run places other tools can't – it's been used in commercial iOS apps with millions of downloads (via libpd), and will run happily on a Raspberry Pi or even a hacked e-reader or ancient iPod.
Contrary to popular belief, it's also getting a healthy stream of updates. And while those usually don't merit specific mention, 0.46 is very cool. (It's the "vanilla" version, so perfectly suited to work with libpd for iOS, Android, and game development, among other things.)
New in this release:
Native OSC (Open Sound Control) support. oscformat, oscparse objects now does OSC over UDP. (TCP, USB, etc. still require the slip encoder/decoder by mrpeach.)
Built-in support for Jack (inter-app audio, etc.) on OS X.
No more manually setting up devices: "Audio and MIDI devices saved by name so that when they get switched around Pd has a better chance of restoring settings correctly."
New string support: ,
Netsend/netreceive bi-directional TCP support. (Overdue – thanks!)
And of course the usual bug fixes and improvements.
Having OSC support built-in was for most of us doing run-of-the-mill stuff the last remaining obstacle to using Pd across mobile and desktop, so that's really nice. And now is a good time to say, don't bother with puredata.info for the vanilla version. Instead, grab via Git:
git clone git://git.code.sf.net/p/pure-data/pure-data
cd pure-data
git checkout
Or just download here:
The obvious comparison to Pd is Max/MSP – the two tools share the same lineage, the same original creator (Miller Puckette), lots of concepts and object names, and even some code. But they're best thought of as very distinct tools, in increasingly different directions. Max is a much bigger program, apart from costing some money; that's what allows it to do things like let you patch with DSP code (which can now be exported), or work with Ableton Live. Pd is free and lightweight, a more canonical vision of what the Max/Pd family would be, and as a result can run in environments where Max can't. I find I enjoy working with each, and switching between the two feels really strangely different, even if familiarity with one can help with the other.
Worth revisiting this film of a Pd event in Nantes for a bit of visual stimulation regarding what Pd can do:


Watch These Videos and Make Musical iOS Apps with Pd, Free

The challenge in making tools, as in making anything else, is really the making. It's one thing for an idea to exist in your head, another to really get down to construction. And very often great engineering means testing, means building the idea and then refining it. So prototyping is everything.
That could explain the increased passion for hacking. Whereas big development efforts are a morass of meetings, or traditional prototyping could mean elaborate distractions from testing what we really works, "hacks" work to get something usable more quickly. And that means testing the usability of an idea happens faster.
libpd, an embeddable version of Pure Data, is meant to be a tool that works both in a weekend hackathon and in a shipping product. (For some shipping products CDM helped with, check out the mominstruments site – more on these this week and next, in fact!)
And this set of video tutorials by Rafael Hernandez is the best introduction I've seen yet to using them. I usually actually hate sitting through video tutorials. But these are clear, concise, and give accurate advice – and they walk you through the latest version of Xcode, which is sometimes otherwise confusing.
I have no doubt you could watch these over a half hour breakfast and build a cool app hack by the end of the day.
If you don't yet know Pd, he also has a video series on that:

There are some real gems in there, worth a browse even if you're a Pd user. Pd is a bit deeper, though, so I'm back to also liking to read and not just watch videos – see also the pd-tutorial and flossmanuals as they cover some more sophisticated techniques.
Maybe you'll get to do some of this hacking with us in person, if you're in Berlin:
This week seems to be all about hacking. Tomorrow, I join re:publica, one of Europe's premiere digital media conferences, to talk about hackathons and collaborative development. Then, this weekend, CDM and MeeBlip are supporting MIDI Hack, a weekend of music creation-focused work hosted at Ableton's headquarters. Those events are not open to the public and MIDI Hack is full, but we'll certainly bring some reports your way.
Finally, Monday, we join Matt Black, the co-founder of NinjaTune and Coldcut, for a conversation on the future of musical apps and some tools he's helping bring to the world for free that make tools more collaborative, more creative, and more connected:
Synced Up: A Conversation with Matt Black (NinjaTune, Coldcut)
Matt will be showing not one but two frameworks that use libpd for sync and creative coding / creative development, too. So if you're in Berlin and didn't get into MIDI Hack, you can still join us Monday. And, again, since only a tiny fraction of you are here in the capital of Germany, ask questions in comments here and we'll bring as much as we can online.
Wherever you are in the world, get the coffee brewing and limber up those fingers for soldering and coding. More to come.
Are you using libpd in your apps?
We need help updating the libpd showcase. It's got some great apps, but we want to add more recent work:



From the maker of Xodular comes Automatonism– a virtual modular synthesizer featuring 67 modules, dynamic preset management and advanced parameter mapping, all on an open source platform.

To showcase the instrument's expansive capabilities, a 7-track album and tutorial video series, Synth Recipes, are available on this site. Automatonism runs in Pure Data, making it compatible with all major operating systems.

Automatonism is the name of both the software and the creative output of its developer, Johan Eriksson. A PhD student at Birmingham Conservatoire, UK, Eriksson works at the intersection of composition, performance and instrument design.

His first modular project, Xodular, arrived during a new wave of interest in modular synthesis and gained notable popularity for a freeware instrument. Automatonism builds on Xodular, adding more modules and features for greater performability and expressiveness, while also encouraging players to delve into the making of generative algorithms.

Automatonism is a modular synthesiser that runs in the open source programming language Pure Data. It features a large library of 67 modules. Follow these simple steps to get started:

Install  Pure Data Vanilla on your device.
Download Automatonism_1.1.zip
Open the file "main.pd".  Read the Quick Guide and Manual, which are integrated into the software.
Start patching!
Modular synthesis is akin to musical gardening: modules can spring to life and their interconnections suggest the formation of a sonic ecosystem. The act of patching is no different to playing any other instrument: it affords the opportunity to express oneself and directly engage with other people.

It is towards that goal of performability and communication that Automatonism was created. It mimics the signal flow of a physical modular but features dynamic preset management and advanced parameter mapping tools on an open-source platform.

Most importantly, it will hopefully  encourage people to delve into the making of generative algorithms via modular synthesis. If you want to support this project and the future development of the software, you are kindly directed to the Automatonism  Bandcamp, or to book a live-performance/lecture/workshop.

Copyright ©  2017, Johan Eriksson

Automatonism  is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.




Another video from our visit to We Are Robots - future music technology conference in Lond om- we talked to Martin from Rebel Technology - they make a variety of Eurorack modules that allow you to run custom PureData and GEM code patches in hardware form. We saw the OWL module and also a new standalone instrument called Wizard - soon to be launched on Kickstarter.
Check our  Awesome MAX4Live Synth: http://bit.ly/wavejunction



Patchstorage is a friendly site packed with free visual and music patches
Peter Kirn - June 7, 2018  1 Comment     
Patching music and visuals is fun, but it helps to learn from other people. With everything from apps (Audulus) to modulars (Softube, VCV Rack) to code and free software (Pd, SuperCollider, Bela), patchstorage is like a free social network for actually making stuff.

It's funny that we needed international scandal, political catastrophe, numerous academic studies of depression, and everyone's data getting given away before figuring it out – Facebook isn't really solving all our problems. But that opens up a chance for new places to find community, learn from each other, and focus on the things we love, like making live music and visuals.

Enter Patchstorage. Choose a platform you're using – or maybe discover one you aren't. (Cabbage, for instance, is a free platform for making music software based on Csound.

Then, browse through the tools. There's an entire VJ engine for Pd extended, a Gregorian guitar synth for the Audulus app, some crazy stuff for the monome aleph hardware, and an entire emulation of a Yamaha DX-7 for SuperCollider, the free code-based environment.

If you're a newcomer, you can attempt to just load this up and make sound. And a lot of these patches are made for free environments, meaning you don't have to spend money to check them out. If you're a more advanced user, of course, poking through someone else's work can help you get outside your own process. And there are those moments of – "oh, I didn't know this did that," or "huh, that's how that works."

Pure Data and Critter & Guitari's Pd-based Organelle hardware are nicely represented.

There are also, naturally, a ton of creations for VCV Rack, the free and open source Eurorack modular emulation we've been going on about so much lately.

Oh, yeah, and — another thing. This doesn't use Facebook as its social network. Instead, chats are powered by gamer-friendly, Slack-like chat client Discord. That means a new tool to contend with when you want to talk about patches, but it does mean you get a focused environment for doing so. So you won't be juggling your ex, your boss, some spammers, and propaganda bots in the middle of an environment that's constantly sucking up data about you.

More (project in beta):




DIY + UNUSUAL MUSIC TECH SOFTWARE STORIES TECHThis free tool could change how you think about sequencers
Context, built in Pure Data, is a free and open source modular sequencer that opens up new ways of thinking about melody, rhythm, and pattern.

Sequencers: we've seen, well, a lot of them. There are easy-to-use step sequencers, but they tend to be limited to pretty simple patterns. More sophisticated options go to the other extreme, making you build up patterns from scratch or program your own tools.

The challenge is, how do you employ the simplicity of a step sequencer, but make a wider range of patterns just as accessible?

Context is one clever way of doing that. Building on modular patching of patterns – the very essence of what made Max and Pd useful in the first place – Context lets you combine bits and pieces together to create sequencers around your own ideas. And a whole lot of ideas are possible here, from making very powerful sequencers quick to build, LEGO-style, to allowing open-ended variations to satisfy the whims of more advanced musicians and patchers.

Where this gets interesting in Pd specifically is, you can built little feedback networks, creating simple loopers up to fancy generative or interactive music machines.

It's all just about sequencing, so if you're a Pd nut, you can combine this with existing patches, and if not, you can use it to sequence other hardware or software instruments.

At first I thought this would be a simple set of Pd patches or something like that, but it's really deep. There's a copious manual, which even holds new users by the hand (including with some first-time issues like the Pd font being the wrong size).

You combine patches graphically, working with structures for timing and pattern. But you can control them not only via the GUI, but also via a text-based command language, or – in the latest release – using hardware. (They've got an example set up that works directly with the Novation Launchpad.)

So live coder, live musician, finger drummer, whatever – you're covered.

There are tons of examples and tutorials, plus videos in addition to the PDF manual. (Even though I personally like reading, that gives you some extra performance examples to check out for musical inspiration!)

Once you build up a structure – as a network of modules with feedback – you can adapt Context to a lot of different work. It could drive the timing of a sample player. It could be a generative music tool. You could use it in live performance, shaping sound as you play. You might even take its timing database and timeline and apply it to something altogether different, like visuals.

But impressively, while you can get to the core of that power if you know Pd, all of this functionality is encapsulated in menus, modules, and commands that mean you can get going right away as a novice.

In fact... I really don't want to write any more, because I want to go play with this.

Here's an example of a performance all built up:

And you can go grab this software now, free (GPL v3) — ready to run on your Mac, Windows PC, Linux machine, or Raspberry Pi, etc.:





Alternative modular: pd knobs is a Pure Data-friendly knob controller
Peter Kirn - April 3, 2019

pd knobs is a knob controller for MIDI. It's built with Teensy with open source code – or you can get the pre-built version, with some pretty, apparently nice-feeling knobs. And here it is with the free software Pd + AUTOMATONISM – proof that you don't need to buy Eurorack just to go modular.

And that's relevant, actually. Laptops can be had for a few hundred bucks; this controller is reasonably inexpensive, or you could DIY it.


Add Automatonism, and you have a virtually unlimited modular of your own making. I love that Eurorack is supporting builders, but I don't think the barrier to entry for music should be a world where a single oscillator costs what a lot of people spend in a month on rent.

And, anyway, this sounds really cool. Check the demo:

From the creator, Sonoclast:

pd knobs is a 13 knob MIDI CC controller. It can control any software that recognizes MIDI CC messages, but it was obviously designed with Pure Data in mind. I created it because I wanted a knobby interface with nice feeling potentiometers that would preserve its state from session-to-session, like a hardware instrument would. MIDI output is over a USB cable.

For users of the free graphical modular Pd, there are some ready-to-use abstractions for MIDI or even audio-rate control. You can also easily remap the controllers with some simple code.



Buy from Reverb.com:



"RealTime Processing Filtering First Harmonic.
What you hear, it´s original string vibration captured with Nu PickUp, processed in Pure Data, creating one independent channel for every note, with one bandpass filter tuned in the fundamental harmonic for every note. The same process can be applied in realtime to other harmonics, and we can get one independent channel for every harmonic of every note.  Hundreds of parallel processes could transform the information without limits.