Pure Data
I've recently been working with Pure Data, a cross-platform graphical programming language for audio (as well as some video & graphical) processing. (See an earlier post about a project using Pure Data).Pure Data is an open-source project that was started in the 1990s by Miller Puckette (who continues to maintain it). It's similar & somewhat interoperable with Max/MSP (a commercial product based on Miller Puckette's earlier Max programming language). It's a bit humbling to realize that there's a such a long-time, interesting multimedia of which I was largely unaware.
Pure Data is certainly fun to play with (though I keep fearing that I'm going to make a mistake and blow out my expensive speakers). Puckette has written a "patch" (an extension) called fiddle~ that analyzes a sound's component frequencies and is exactly what I need for one of the projects I'm currently working on.
I did a bit of graphical programming using Edith (The Sims scripting language) when I was at Maxis, so the paradigm isn't completely new to me. It's interesting to so clearly see a program's control flow and I'm tempted to incorporate the language into my Multimedia 2 course at CCNY. However, I do wish Pure Data handled conditional statements more straightforwardly... I'm new to the language, so it's very possible that I'm missing something, but the following (which seems kinda hacky to me) was what I came up with for doing an if-else statement:
What I'm wanting to do is to check a sound's amplitude and if it's less than 0.04, set it to 0, otherwise set it to 0.5. The above does the job... if you know a better way, don't hesitate to post a comment!UPDATE:
I figured out a better way of doing the above operation.
">= 0.04" returns "1" if the value being evaluated is greater than 0.04 and "0" if it is less. Conveniently, I'm looking for the outcome to be 0 when false and 0.5 when true--so I can simply multiply 0.5 with the 1/0 value coming out of the >= operation.Still, I think a if-then-else would be a good addition to PD.
Labels: programming, sound
1 Comments:
Doing arithmetic on flags: reminds me of Forth. :)
Post a Comment
Links to this post:
Create a Link
<< Home