• KeithIrwin

    I've done a bunch of searching on this topic without any luck, so I won't be surprised if the answer is "No", but is there any way to load a new audio file into a table without causing a pause in the music output and without waiting an amount of time equal to the length of the audio file?

    So far the options I've found for loading a sound file into a table are:

    soundfiler: fast, but runs in the foreground thus interrupting anything else which is going on

    readsf~ + tabwrite~: reads the file in the background, writes to the table piece by piece in the foreground, takes time equal to the length of the sound file (that is, a 3 minute song takes 3 minutes to load)

    readanysf~ + tabwrite~: ditto, but with better file type support

    Are there any options I'm missing that would do better?

    posted in technical issues read more
  • KeithIrwin

    So, I built a project which uses pix_mix, and I couldn't help but notice that the help example doesn't work. Specifically, pix_mix only updates when the left image is updated (unless it works differently on different platforms). So it works fine for movies, but if you have static images and you adjust the mixer input, it doesn't change anything. In the help example, this is exactly what happens. You load two images and then play with the slider and then nothing happens.

    In most objects, you could deal with this by just banging the hot input, but banging pix_mix's input just results in an error message that it doesn't know what to do with a bang. In my patch, I've worked around this by storing the left image in a pix_buf and banging the pix_buf, but it doesn't quite seem ideal.

    posted in pixel# read more
  • KeithIrwin

    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)

    http://www.pdpatchrepo.info/hurleur/leasedefdj.zip

    posted in patch~ read more
  • KeithIrwin

    I've been working on building a DJ system and I couldn't find a controllable crossfader abstraction. I found a number of ways to fade from one signal to another over time, but none that could be hooked up to a MIDI or OSC control for easy back-and-forth realtime fading. So I built one.

    It's a constant-power crossfade available in stereo and mono varieties (although obviously you can hook multiple crossfaders up to the same control if you need more channels than that). The control input is on a 0 to 1 scale, not a 0 to 127 scale, so be sure and adjust accordingly. It takes a "depth" input, which is roughly analogous to the "sharpness" control on adjustable crossfaders. The default depth is 1, which gives a smooth fade suitable for beat-matching and similar applications. People doing scratching may want to use a depth of 2, 3, 4 or maybe even 5 to get a quicker fade in at the edges and a fatter middle area where both tracks can be heard. This is useful for techniques like transform scratching and variations thereon where it's nice to get a large volume response with little movement.

    I'll make help patches for them at some point, but if you read the comments, they explain things pretty well.

    http://www.pdpatchrepo.info/hurleur/stereocrossfader.pd

    posted in abstract~ read more
  • KeithIrwin

    I've been working on building a DJ system and I couldn't find a controllable crossfader abstraction. I found a number of ways to fade from one signal to another over time, but none that could be hooked up to a MIDI or OSC control for easy back-and-forth realtime fading. So I built one.

    It's a constant-power crossfade available in stereo and mono varieties (although obviously you can hook multiple crossfaders up to the same control if you need more channels than that). The control input is on a 0 to 1 scale, not a 0 to 127 scale, so be sure and adjust accordingly. It takes a "depth" input, which is roughly analogous to the "sharpness" control on adjustable crossfaders. The default depth is 1, which gives a smooth fade suitable for beat-matching and similar applications. People doing scratching may want to use a depth of 2, 3, 4 or maybe even 5 to get a quicker fade in at the edges and a fatter middle area where both tracks can be heard. This is useful for techniques like transform scratching and variations thereon where it's nice to get a large volume response with little movement.

    I'll make help patches for them at some point, but if you read the comments, they explain things pretty well.

    http://www.pdpatchrepo.info/hurleur/stereocrossfader.pd

    posted in abstract~ read more
  • KeithIrwin

    For saving the patches from that website on a Mac, the easiest thing to do is to hold down control and click on them and choose Download Linked File As... (if using Safari or Save As... if using Firefox). If you've already saved it as a .txt file, you can simply locate it in the Finder, click on it, press return, and then change the extension to .pd. All .pd files have #X objects in them, so I'm not sure what problem you're talking about in terms of it not liking the X. Make sure, though, that if you're using TextEdit to save them that you don't save them as .rtf. If you renamed a .rtf to .pd, it will definitely not work.

    As for your problem with the midi out, if the Midi test is working, then I think you may be having with generating the correct notes and velocities. Have you tried printing them out to be sure that you're creating them correctly?

    posted in technical issues read more
  • KeithIrwin

    If you make a notein object without specifying the channel, then it receives all notes and outputs the number, velocity, and channel through its three outlets. So that will work fine (although can result in problems if multiple MIDI devices are using the same numbers), but users are still going to need to use the MIDI menu in the Pure Data preferences to tell it what devices to connect to in the first place.

    posted in technical issues read more
  • KeithIrwin

    I've built a general-purpose scratching patch which can be paired up with controller patches which are specific to a particular controller. If anyone would like to build one for the DJ hero controller, it should be pretty straight-forward. You won't have to implement the scratching part, that's already there. You'll just have to match the controls to appropriate messages in Pure Data. Anyway, it's here: http://puredata.hurleur.com/sujet-5355-scratching-system if anyone wants to take a stab at it.

    posted in technical issues read more
  • KeithIrwin

    I used some of this work as the basis for my scratching system. I've posted it in a thread here: http://puredata.hurleur.com/sujet-5355-scratching-system if you're curious.

    posted in technical issues read more
  • KeithIrwin

    I could be wrong, but I think that this is going to vary depending on the manufacturer of the MIDI DJ controller. I don't think that there is a standard way of doing this. I have an ION Discover DJ controller and its values do seem to directly represent rotational velocity (so, on my controller, 20 does seem to be twice the turning speed of 10) except that it never gives 0, just always 1 or -1 (127) depending on which way it was last spinning. Which MIDI DJ controller are you using?

    posted in technical issues read more
  • KeithIrwin

    I have no idea if you're still working on this or not as it's several months later, but I figured I'd offer a little help, in case you're still interested in working on it. Last things first:
    the change command will only pull in values when they change.

    To get to the first question, what you need to do is to, in some way, keep track of where you're playing and use this to play the next bit. A good piece of sample code which does this is in this thread: http://puredata.hurleur.com/sujet-2566-scratching-samples (which you may also find interesting from a scratching perspective). Specifically, you want the very last file named "scratcher.pd" which was attached (and not his earlier attempt). It's a good way to play audio files, and I used it when I was figuring out my own DJ'ing patch (which I'll be releasing in a day or two once I've added a few more bells and whistles). I'm not giving you my patch as an example just because it gets kind of big and complex and I worry that you might just get lost in it. But if you want to see it, like I said, it'll be available in a few days.

    posted in technical issues read more
  • KeithIrwin

    Hey, I just wanted to pop in and say "Thanks" to pd123 because the information in this thread and especially the sample large-file loader have been really helpful to me. I'm working on my own DJ'ing patch which I'll be releasing soon. I'd worked out most of the problems, but now it'll also be long-song enabled, which is really cool. So, thanks!

    posted in technical issues read more
Internal error.

Oops! Looks like something went wrong!