conditionally mixing signals
Howdy.
I have a very simple mixer in my app that mixes two signals at a time and takes the sum and mixes with another signal and then once again for a fourth signal.
This approach worked well before for just two signals but now with four signals to combine it seems like there are some audio quality issues when some of the voices are nil.
I'm no pd expert and I'm stumped on how to do this better.
should I toss this approach or is there a way to preserve audio fidelity when either or both of Voice 2 and Voice 3 have no signal.
It looks like I need a moses~ to conditionally bypass a mixing stage but I have no idea how to pull this off. If anyone can point me to an example that would be awesome.
I can only use vanilla objects.
Thanks!
Low audio latency in windows 7
Hi all, I'm struggling a bit on audio latency in pd (windows), so I wanted to have a clearer picture.
Apparently other applications seems to perform quite well (Reaktor), but in pd I'm experiencing serious problems.
I did a simple test, the result is here:
This is the test setup:
- pd .042.5 extended
- pd patch: 7.stuff/tools/latency.pd, measurement quite precise (Miller says ~1.5 ms)
- audio board: Cakewalk Sonar VS-100 (roland), USB 2.
- ASIO4ALL driver (portaudio)
- line out (1) cable jack connected to line in 1 (mic)
- windows 7 (64 bits)
Pretty instructive, at least for myself. I put a Scope~ object to visually see the output pulse fed back into input of the audio board:
the "sharp" pulse is the one generated by the patch, the "blurred" one that follows is the one fed back into the audio board.
The distance between the two is the "latency" of the system.
In summary, these are the major results I found:
- lowest true (measured) usable latency ~ 30 ms, corresponding to "delay (msec)" set to ~ 8 ms
- lowest true (unusable) latency ~ 20 ms, audio "destructed" "delay (msec)" set to ~ 3 ms
- Original HW driver is totally unuseful, only ASIO4ALL seems working ok (why? anyone has an idea?)
- I probably used very bad cables (see the bad pulse shape following the one created by the latency patch)
- changing the ASIO4ALL buffer size didn't change anything in terms of latency (why?)
Note: the only way I was able to lower down the "delay (msec)" values to few msec was using ASIO4ALL driver.
I'd like to hear your experience (I read about Domien playing "delayed") and if anyone was able to succeed to lower
the latency in win to unnoticeable values (~10 ms or even less).
Alberto
PD from Max, missing Umenu
Lurked for a while, first post now.
I've been using Max/MSP pretty heavily since last December, and I've fallen in love with the visual coding paradigm. For a variety of reasons PD appeals to me more than Max (though I did get used to the bells and whistles). I've replaced all my hardware effects (loopers, stompboxes, synths, sequencers) with max patches, and I'd be comfortable enough making the same over again in PD, but I'm having trouble translating a few objects that I relied on heavily in Max.
Umenu is a big one, the ability to receive numbers and output corresponding text comes in handy with scripting lots of objects, and routing sends and receives. It's ease of populating, rewriting, and deleting of entries makes many complex tasks easily manageable. It also functions as a great label when I hid things away. I suspect there's an equivalent method, but nothing leaps out. Should I be looking at some sort of coll type object? Struct?
In the DSP realm, I'm a little worried not to see Rate~ or some analog of it. I use phasor~ to control my loops, and Rate~ works magic on polymetric sequences. I could probably rig up a similar system scaling and wrapping a signal, but straight up Rate would be best.
In order to be able to slot effects in and out of different parts of the signal chain, I've been using combinations of bpatchers and polys, with scripting to switch between different stompbox abstractions. I found the graph on parent option, but it doesn't seem (at least not obviously) that I can use scripting on it to call up different subpatches. Please correct me if I'm wrong.
I think those three might just cover it (at least for the time being). I've found the externals pulled from the max library to be an amazing resource, and between overlapping objects, manuals, and the answers on this forum most of what I need to know is readily available. If those objects lack analogs in PD I may just bite the bullet and get into java/c/python...at the moment I have no experience with text based programming, but I'm just looking for an excuse, really.
I'll be hitting the manuals cover to cover as best I can in the morning, but I'd be glad to have my patches running sooner all the same.
All help is much appreciated.
Aa
DJ/VJ scratching system
First my story: (you can skip down to END OF STORY if you want)
Ever since I saw Mike Relm go to town with a DVDJ, I've wanted a system where I could scratch and cue video. However, I haven't wanted to spend the $2500 for a DVDJ. As I was researching, I found a number of different systems. I am not a DJ by trade, so to get a system like Traktor or Serrato with their video modules plus turntables plus hardware plus a DJ mixer, soon everything gets really expensive. But in looking around, I found the Ms.Pinky system and after a little bit, I found a USB turntable on Woot for $60. So I bought it. It was marketed as a DJ turntable, but I knew that it wasn't really serious since it had a belt drive, but it came with a slip-pad and the USB connection meant that I wouldn't need a preamp. And so I spend the $100 on the Ms.Pinky vinyl plus software license (now only $80). This worked decently, but I had a lot of trouble really getting it totally on point. The relative mode worked well, but sometimes would skip if I scratched too vigorously. The absolute mode I couldn't get to work at all. After reading a little more, I came to the conclusion that my signal from vinyl to computer just wasn't strong enough, so I would need maybe a new needle or maybe a different turntable and I didn't really want to spend the money experimenting. I think that the Ms. Pinky system is probably a very good system with the right equipment, but I don't do this professionally, so I don't want to spend the loot on a system.
Earlier, before I bought Ms.Pinky (about two years ago), I had also looked around for a cheap MIDI USB DJ controller and not found one. Well, about a month ago, I saw the ION Discover DJ controller was on sale at Bed, Bath & Beyond for $50. They sold out before I could get one, but Vann's was selling it for $70, so I decided that that was good enough and bought one. I had planned to try to use it with Ms. Pinky since you can hook up MIDI controllers to it. But it turns out that you can hook up MIDI controllers to every control except the turntable, so that was a no go. If I had Max/MSP/Jitter, I could have changed that, but that's also way expensive. So, how should I scratch? My controller came with DJ'ing software and there's also some freeware, like Mixxx, but none of this has video support. So I look around and find Pure Data and GEM.
And I see lots of questions about scratching, how to do it. And there are even some tutorials and small patches out there, but as I look at them, none of them are quite what I'm looking for. The YouTube tutorial is really problematic because it's no good at all for scratching a song. It can create a scratching sound for a small sample, but it's taking the turntable's speed and using that as the position in the sample. If you did that with a longer song, it wouldn't even sound like a scratch. And then there are some which do work right, but none of them keep track of where you are in the playback. So, whenever you start scratching, you're starting from the beginning of the song or the middle.
So, I looked at all this and I said, "Hey, I can do this. I've got my spring break coming up. Looking at how easy PD looks and how much other good (if imperfect) work other people have done, I bet that I could build a good system for audio and video scratching within a week." And, I have.
END OF STORY
So that's what I'm presenting to you, my free audio and video scratching system in Pure Data (Pd-extended, really). I use the name DJ Lease Def, so it's the Lease Def DJ system. It's not quite perfect because it loads its samples into tables using soundfiler which means that it has a huge delay when you load a new file during which the whole thing goes silent. I am unhappy about this, but unsure how to fix it. Otherwise, it's pretty nifty. Anyway, rather than be one big patch, it relies on a system of patches which work with each other. Each of the different parts will come in several versions and you can choose which one you want to use and load up the different parts and they should work together correctly. Right now, for most of the parts there's only one version, but I'll be adding others later.
There's a more detailed instruction manual in the .zip file, but the summary is that you load:
the engine (only one version right now): loads the files, does the actual signal processing and playback
one control patch (three versions to choose from currently, two GUI versions and a MIDI version specific to the Ion Discover DJ): is used to do most of the controlling of the engine other than loading files such as scratching, fading, adjusting volume, etc.
zero or one cueing patch (one version, optional): manages the controls for jumping around to different points in songs
zero or one net patch (one version: video playback): does some sort of add-on. Will probably most commonly be used for video. The net patches have to run in a separate instance of Pd-extended and they listen for signals from the engine via local UDP packets. This is set-up this way because when the audio and video tried to run in the same instance, I would get periodic little pops, clicks, and other unsmoothnesses. The audio part renders 1000 times per second for maximum fidelity, but the video part only renders like 30 or 60 times per second. Pure Data is not quite smooth enough to handle this in a clever real-time multithreading manner to ensure that they both always get their time slices. But you put them in separate processes, it all works fine.
So, anyway, it's real scratching beginning exactly where you were in playing the song and when you stop scratching it picks up just where you left off, you can set and jump to cue points, and it does video which will follow right along with both the scratching and cuing. So I'm pretty proud of it. The downsides are that you have to separate the audio and video files, that the audio has to be uncompressed aiff or wav (and that loading a new file pauses everything for like 10 seconds), that for really smooth video when you're scratching or playing backwards you have to encode it with a codec with no inter-frame encoding such as MJPEG, which results in bigger video files (but the playback scratches perfectly as a result).
So anyway, check it out, let me know what you think. If you have any questions or feedback please share. If anyone wants to build control patches for other MIDI hardware, please do and share them with me. I'd be glad to include them in the download. The different patches communicate using send and receive with a standard set of symbols. I've included documentation about what the expected symbols and values are. Also, if anyone wants me to write patches for some piece of hardware that you have, if you can give me one, I'll be glad to do it.
Keith Irwin (DJ Lease Def)
A collection of GLSL effects?
hey az
i get these errors...it doesnt want to link
error: [glsl_fragment]: shader not loaded
linking: link 9.80909e-45 7.00649e-45
linking: link 9.80909e-45 1.12104e-44
[glsl_program]: Info_log:
[glsl_program]: linking with uncompiled shader
[glsl_program]: Link failed!
[glsl_vertex]: Vertex_shader Hardware Info
[glsl_vertex]: ============================
[glsl_vertex]: MAX_VERTEX_ATTRIBS: 16
[glsl_vertex]: MAX_VERTEX_UNIFORM_COMPONENTS_ARB: 4096
[glsl_vertex]: MAX_VARYING_FLOATS: 64
[glsl_vertex]: MAX_COMBINED_TEXTURE_IMAGE_UNITS: 32
[glsl_vertex]: MAX_VERTEX_TEXTURE_IMAGE_UNITS: 16
[glsl_vertex]: MAX_TEXTURE_IMAGE_UNITS: 16
[glsl_vertex]: MAX_TEXTURE_COORDS: 8
Artists using Pure Data
Here is my experience...
im learning pd before i buy max/msp , since pd is a lot like max but free and there is a whole lot more documentation on PD than max, and the people who developed PD are the same people developing MAX (from what ive read) i figured id learn PD before buying MAX.
This has a lot to do with me buying Reaktor 5 before i learned programming and hated myself for years for that and ended up using the library and almost never opened reaktor after that.
After about 3 or 4 months of annoying reading on PD im on my way to building my first FM synthesis drum machine so yay! i dont feel so stupid now and studying on PD is making me understand Reaktor 5 so im guessing itll help me with max/msp as well.
so take it from someone who made an idiotic choice on purchasing software about 2 years ago based on who is using it, being a fan of richard devine and datachi and electroacoustic music.
Software wont make you sound great only studying hard will.
PD is a great place to start and im guessing itll be a great place to stay...
hope this helps.
Controlling old plotter with PD \[comport\]
Hi.
I recently did the same thing in Max, I don't know exactly how pd deals with special characters, but here are some pointers.
-
To read in the plotfile, I used Max's filein, which gives you ascii directly. I believe mrpeach/binfile does the same for pd?
-
"," ";" etc are problematic in Max, and probably in pd too. to output "PA 120,200;" I used atoi ("asci to int in" max) only for the numbers, and inserted the , ; etc via an append / prepend chain with the corresponding ascii values, i.e. [append 59 13] to put ";" + CR at the end etc.
-
occasionally one might need to use backslash as an escape char in Max, don't know about pd
-
depending on the plotter, you might need to tell it to go into xon/xoff mode, this is some escape sequence, I "manually" translated to ascii and used it as a list in Max.
if its a hp plotter, most docs are available at hpmuseum.net (go for programming manuals), for other brands I hope it came with a printed one ...
good luck.
Artists using Pure Data
@snowball: I should probably clarify what I mean about gui and functionality. When I said there are few instances when the gui is very important to the functionality, I was referring to the fancier gui elements. I actually do believe in many cases the gui is important to the functionality. It is important when it gives you the proper visual feedback to help the user understand what's going on. In most cases, sliders, knob, number boxes, etc. present you with all you need. You don't always need interactive waveform displays or filter curves; and you aren't likely to need adjustable rounded corners, elaborate color schemes, gradients, and segmented patch cords. Now, to be honest, I am kind of a sucker for cool guis, and spent time doing "hacks" with what Pd provides to make them do things they weren't intended to do. But I have always gotten what I needed.
To give you an example of something that I felt needed a nice gui, here is a video presentation of my final project in college:
The idea was to use a Photoshop-based interface that most of us are in some way familiar with and do sound design with it. I did this in Max because I didn't think GEM had what I needed to do it (I've just recently looked at GridFlow, however, and I think it may have the missing pieces I was after). pd123's comment about Jitter similarly reflects my experience with this project. While it has the nice objects I wanted to use, it also had some irritating bugs that were hard to pin down. As a result, this project was, and still is, unfinished.
When it comes to "more advanced" things like [poly~] and [pfft~], this is one of the big differences between Max and Pd-vanilla. Max offers quite a bit more higher level objects, which make it easier for new users as they don't have to try and patch those things ([freqshift~], [gizmo~], and [stutter~] are a few others that come to mind). BUT, Pd offers what you need to patch most, if not all, of those yourself using the objects it does have. And, Pd-extended includes many externals and abstractions that clone Max objects. [nqpoly4], for example, is a [poly~] clone made with Pd objects. I haven't done much FFT in Pd, but as far as I can tell, [pfft~] is essentially like putting Pd's FFT objects in a subpatch and adjusting the blocksize with [block~]. I don't believe Max lets you adjust the blocksize per subpatch, so [pfft~] is a workaround for that.
Don't get me wrong, I don't think these high level objects are a bad idea. I use Pd-extended, after all .
Artists using Pure Data
I'm not really sure what you mean by "less professional." If you're saying it might be less suited for professional use, I would have to disagree. I have actually found Pd-extended to be more stable than Max 5. The differences in sound quality are generally negligible, if at all noticeable. And there are few things that one can do that the other can't (and they *both* have their advantages over the other). They are both great pieces of software, and you can probably get them both to do what you need them to do. Max is a commercial product, but that doesn't necessarily make it better suited for professional use. It just makes it commercial software.
The only thing that I've found that Max hands-down does better than Pd is the gui. But, really, it's not that big of a deal, because the gui offerings in Pd give you what you need to function. Most of the stuff in Max is eye candy that you end up wasting a lot of time working on. There are very few instances where the gui is actually very important to the functionality of the patch.
Max also has ReWire capabilities (one of the advantages of being commercial), but they are so buggy and the implementation is so crappy that it is hardly usable. David Zicarelli himself even said, in so many words, that ReWire sucks.
As far as famous artists go, keep in mind that Max has a longer history than Pd and so has has a bit of a foothold in this area. And, more importantly, it is a commercial product. You're likely to find a list of famous people using just about any commercially successful product because the advertising department knows it will get people to buy it. They find out if an artist has used it, even if only for a small part of one track, and then the go around saying, "Hey, Aphex Twin uses Max. You should buy it if you want to be like him."
As someone who has both programs, I can say this: Max/MSP/Jitter is not $800 better than Pd-extended. It's not even $250 better (which is the student discount price). And if you really must go for Max, the transition from Pd is not hard at all. I would at least say play with Pd for a while and decide if it's a paradigm that you really enjoy. If you find that you need the extra goodies that Max has and Pd doesn't, then download the demo and see if it's worth it.
Mouse position to frequency
Hello there!
I'm trying to create a theremin-like patch in pd which should be controlled with mouse. Y axis replaces the volume antenna and X axis replaces the pitch antenna. The first idea is to have four octaves range with equal distances (equal number of pixels) between each octave. For example:
mouse = 0 ... 110 Hz
mouse = 400 ... 220 Hz
mouse = 800 ... 440 Hz
mouse = 1200 ... 880 Hz
mouse = 1600 ... 1760 Hz
I'm stuck with scaling the x axis values, probably because I'm not good in mathematics. Any advice, link, or help will be well appreciated.
Thank you!
sinewave.