-
jstoner
I have an OSC device that you could think of like a slider--when you touch it along a line, it produces a float between 0 and 1, corresponding to the proportional distance along that line.
It's easy to feed its output into osc~ and make a sine wave audio--sounds like a slide whistle. How do I use it to index a play position in an audio file, thus enabling scratching?
-
jstoner
I have a patch I am distributing with some other software. The patch uses some .ogg files. I want to package it all in a directory together, so users can copy from an archive (.dmg on the mac) to a directory, and run the patch easily.
So my patch needs to be able to find my ogg files. [open ./file.ogg( doesn't work--the . is relative to the local directory where pd is invoked if you do it from the command line, not the directory where the patch is. I don't want to ask users to use the command line.
[~/dir/file.ogg( doesn't seem to work either: oggread doesn't seem to be able to translate ~ into /Users/username.
I'm using v 0.40. I 'm running Mac OSX 10.5.5.
So how would I do this? I need to make it simple for end users.
-
jstoner
I'm trying to create a subpatch where I pass in a filename as a parameter. I want to send in a 'loadbang' signal, and then a message 'open $1' to an oggread~ object. I've tried 'symbol,' I've tried a few things. 'makefilename' doesn't seem to do what I want. Any ideas?
-
jstoner
I have a widget that basically works as a slider. It generates streams of OSC data, which I'm receiving with a PD patch. You could think of it as a slider combined with a switch, so you can control an alpha-value (ranging from 0-1) by sliding along the surface, but it also (to a separate OSC address) sends a 1 when you put your finger on, and a 0 when you take it off. That way you can make the slider output only active when you touch it, or not, as you see fit.
Problem: how do I combine these inputs into a continuous signal? When I just feed them into a && or a * they seem to want a bang input, too.
-
jstoner
I want to package some .ogg files with a patch that will be bundled in a tarball with some other stuff. So referring to them in the patch by way of 'open /Users/jstoner/file.ogg' isn't gonna work.
So I need to use relative paths. So I
cd /Users/jstoner/.../pd
/Applications/Pd-extended.app/Contents/MacOS/Pd-extended --open oscserv.pd(this is on my Mac, OSX 10.5.4) thinking this would be good function to do in a bash script. It starts, but it doesn't open my patch. When I open the patch manually, it does find my oggs by relative path, so I got that going for me. But I'd like to make this easy for users.
So is -open just broken? or is there something else I'm missing?
-
jstoner
OK, I've got it... I had two problems:
there's an interval of time--a bite of the sample (50 milliseconds in the attached patch). It needs to be the same length as the time fed to vline~. Duh.
Also, modulo can return a negative number. -17 % 5 = -2. That doesn't work for computing the index into the sample.
This scratches nicely. It's set up with the length of the slider set to the same interval of time as one turn on a 33 1/3 record. Playing with th bite size is interesting--too low and scratching is just annoying. Didn't really play with values over a fifth of a second.
I'm sure there are more efficient ways to implement this. I'd be curious to hear about them from pd gurus.
-
jstoner
Ok, turning my attention back to this...
Still not getting a good sound out of this patch. when I switch to scratch, and I move the slider right I get a buzzing sound, and when I slide left I get silence, with intermittent popping. I recently saw this:
which looks similar to what I'm trying to do here.
Any ideas? I've attached a version of this patch that you can interact with without an OSC input. Just pick a sample and slide the slider.
-
jstoner
Ok.... got this far.
The attached patch loads and plays a loop. It has a toggle that starts/stops the loop. it has an OSC-based switch between playing and scratching.
The playing works fine. The scratching doesn't sound good--close but too fragmented, like it's playing bits and pieces of the sample, not in a smooth way. If anyone knows a way to make this sound better, I'd appreciate your wisdom.
-
jstoner
OK figured that out, I think. Next up, stopping the phasor~ and incrementing from the change value output. Any ideas would be much appreciated.
-
jstoner
OK... found [pipe]. Which doesn't exactly do what I think I need. Pipe makes a delayed stream of numbers. My first thought was, stream the output of pipe and the raw numbers to [-] and get the differences. The trouble is, I'm measuring overlapping intervals, which will move the scratch farther than I think I want.
I think I want to measure the 'slider's' motion incrementally. Like at intervals, measure how far it's moved in that interval and return that value. I think there's a metro and a pipe in that patch, but I can't quite figure out how to pull a value out of a stream at intervals. Any ideas?