Variable delay patch - need help
Hi,
The attached patch dsdelay is supposed to be a variable delay line with a moving write point. vd~ uses a moving read point which is acceptable for most applications but not what I am working on. I have implemented my moving write point delay line in MATLAB and it works reasonably well. However I am experiencing issues with PD implementation.
The patch uses a table to store the delay line values and is supposed to use a circular delay line method (i.e. the read/write points shift with time instead of the actual elements of the delay line). The intention is that the read point shifts along the delay line by one sample per sample, and the write point does the same whilst the delay is not being altered. The write point uses a simple two point extrapolation to allow writing at fractional table indices.
I'm having two problems:
1. I can't find a satisfactory method of wrapping signal values in an arbitrary range. I want to be able wrap a signal value between 0 and 44100 for example, but using
|
[/~ 44100]
|
[wrap~]
|
[*~ 44100]
|
gives rise to rounding errors which create artifacts in the output. This is why in the current state, the output is intermittent rather than continuous.
2. For some reason the 2 point extrapolation seems to be not working correctly. I'm getting a ring modulation type effect on the output. In MATLAB the addition of the two point extrapolation helped to minimise artifacts when the delay time was being altered. Altering the delay time gives rise to horrible artifacts at the moment though.
Any pointers on how to get this working properly would be greatly appreciated.
Thanks
Ben
Help with edit more sample
If you're talking about the sound editor I posted recently, look inside [pd codey-code] for [pd file] and [pd copy].
That should get you on your way.
Basically you need to read from one array and write the values to another array.
So if have your 8 channel sample player + editor, and want to edit and save sample1 then edit sample4, it would go like this.
1.Check how many values sample1 array has.
2.Resize editor array to match sample1 array.
3.Read the values from sample1 array, and write them into editor array.
4.Edit sample.
5.Check how long edit array is, after editing.
6.Resize sample1 array to match editor array.
7.Read values into sample1 from editor.
8.Check how many values sample4 array has.
9.Resize editor array to match sample4 array.
10.Read the values from sample4 array, and write them into editor array.
11.Edit sample.
12 .............etc.
Hope that makes it clear.
Good Luck!
Bezier Curves
Hi.
Does anyone have experience working with bezier curves? I'm having a little trouble getting my head around the formulas.
What I'd like to do is to define half a saturation curve with the visual output of an array in bezier curve mode.
So I have an array with five points in it. The first point is locked to 0,0, the last point locked to 1,1. the three intermediate points are editable by a selector and a slider.
Visually in the graph, the result is a nice-looking bezier curve. Of course, there's only five points here. So I need a way to upsample those five points in a bezier fashion. The result would be an array with many points in it that match the curve of the original visual bezier.
I'll attach a sloppy patch to illustrate, if anyone can steer me in the right direction that would be swell, but no hard feelings if you're not feeling it.
thanks kindly folks.
Pd sound editor 0.0.1
I just came across this old post when doing a search for "normalize" and found it to be pretty fun to mess with (in addition to it being a great tool for editing audio files.)
I was looping sounds and then taking the out-point and sliding it back and forth. However, I did notice that if the in-point and the out-point get too close to each other (with the loop switched on) then Pd freezes up on me and I need to quit and re-open. This kinda makes sense to me because the loop probably gets too short and there may be some sort of overflow.
So I figured out how to make it so that when one point gets too close to the other (like within 0.01) it makes the other point jump back to either the beginning or the end depending on which one you are manipulating. I did this using [<] and [>] and then sending a bang.
This solved the problem of it freezing up for the most part, but I haven't been able to figure something else out... hence, my question (and I should post the modified patch here to show you but I am at work, so maybe I can post it tonight when I get home.)
Anyway, let's say I open a 3-second soundfile and start it looping. I move the slider over to change the out-point to be 1.5 seconds. Then I start dragging my in-point over to the right. How do I set it up so that when it gets to be within 0.5 seconds away from the out-point then the outpoint will slide over to the right as I continue to slide the in-point and maintain that 0.5 second window. So basically, I want to take the value from the top slider and as soon as it gets to a 0.5 second difference from the bottom slider, then the bottom slider will start moving to the right as well. If I slide the top over to 2 seconds, then the bottom slider will move over to 2.5 seconds, maintaining the 0.5 second loop window.
I don't know if that explanation will be easy to understand, but that's what I am trying to figure out. I guess it would be a matter of taking the value of the top slider and then just adding 0.5 to it and sending that to the bottom slider, but I only want it to do that once the top gets within that 0.5 difference. Oh yeah, and I also want it to go both ways, meaning if I drag the out-point over to the left it will move the in-point to maintain the same 0.5 second window.
Let's see, any other complications to throw into the mix? I think that's all. Any ideas on how to make this work?
Rumble Box
Hi toxonic
It doesnt work for me
equ: filter unstable -> resetting
equ: filter unstable -> resetting
equ: filter unstable -> resetting
equ: filter unstable -> resetting
equ: filter unstable -> resetting
equ: filter unstable -> resetting
equ: filter unstable -> resetting
equ: filter unstable -> resetting
expr divide by zero detected
error: : no such array
... you might be able to track this down from the Find menu.
error: : no such array
error: : no such array
error: : no such array
error: : no such array
error: : no such array
error: : no such array
error: : no such array
error: : no such array
error: : no such array
error: : no such array
error: : no such array
error: : no such array
error: : no such array
Toroid array
This may seem strange, but, I need an idea on how to read a one dimensional array as one which is 3-d and toroid (doughnut like).
This starts with my "Game of life" patch in the #pixel forum, which I now realize is flawed.
I have a table, say 32 points, which I 'fold' to represent an array which is 8X4. Now, I can read the array as a three dimensional one with some pretty simple counters. The process of Conway's game requires me to find the sum of all neighboring cells, or points, which have boolean values. So, if I am interested in updating the status of cell whose location in the grid is 1-0, I [tabread] the table at point 8. The problem is in reading the states of the adjacent cells. If i want to read the cell 'to the right' of point 8 (n) I just increase the [tabread] index by one, giving me point 9 (n+1). Same goes for above and below, except I subtract or add the length of the row: (n-8) or (n+8) respectively. *BUT* If I need to point BEFORE cell eight, I have to wrap the counter to give me the point at the 'right end' of the row. This goes the same for cells 'above' and 'below' those in the 'top' and 'bottom' rows, and to the 'right' and 'left' of cells in the finite columns.
So I think I need some fancy math using [wrap] to spit out a list of eight positions in the array, corresponding to the eight 'neighbors' of the cell whose fate I am trying to decide. Does this make sense? Is this a good opportunity to learn PERL or PYTHON?
--Nestor(tired)
Saving diferent data
sorry for asking stupid questions! I found out how to write and save arrays to a txt-file. But after 2 days of doing research in the web and the pd tutorials I couldn't find any solution for my issue.
I understood that arrays are for saving the curve of a sound. I still don't understand how to fill the array with flexibly data.
Let me explain how I would like to use the array.
array[int index][0] - integer with value of velocity
array[int index][1] - integer with value of frequency
array[int index][2] - string with filename
with:
array[0][] - song1.wav
array[1][] - song2.wav
later on I want to do a "nearest neighbor search" on the array. to play a suitable song.
Please help me! You'd help me a lot.
Michael
Mousing arrays = frustrating
Good call on the parallel DS and array. That'll allow me to continue using tabread4~.
I spent all of yesterday trying to shoehorn my DS into a graph-on-parent window, but it insisted on being huge in the subpatch, regardless of how I changed the canvas properties. Also, I'm having trouble orienting the DS, coordinate-wise. I want to constrain the DS array to a certain vertical range, and I want to create a graph with time-by-value measurements. It seemed that I could just drag the DS anywhere in the subpatch and give each point infinite arbitrary values. Too sloppy for me.
Given that I can designate the initial coordinates of my DS array using plot, I should be able to create a second DS that's simply a two-line graph, relative to the DS array, right? Then, if I subtracted the horizontal axis' y value from the y value of the array, I could forget about the placement of the whole DS arrangement and focus on the sound.
So I pirated my struct and templates from the plot helpfile, and I have no idea how to create a DS from scratch. How do I create my two-line graph, and how do I get it to coexist with my DS array?
As for envgen, I might find it more useful if I could designate a fixed number of points and mouseover edit the envelope as a whole. Do you know of any object that behaves this way? And how difficult would it be to create such an external?
Darrell
Arrays being double-spaced?
Hi all,
I'm having a strange problem with arrays. I'm using [tabread] to read from an array, and every read from an odd-numbered index is returning 0. It's a bit like the array data is "double-spaced", i.e. I have to double the index to get the index I actually want.
For example, if I store {1, 2, 3, 4, 5, 6, 7}, I get back {1, 0, 2, 0, 3, 0, 4}. The array graph looks normal, and examining the array as a list looks fine as well.
On saving and reloading the patch, however, the array graph changes, showing every second value as 0 and the array contents are spread out. The list view also has a 0 at all the odd-numbered indexes. What's worse, [tabread]ing the array contents reveals that it's now quadruple-spaced, i.e. {1, 0, 0, 0, 2, 0, 0}!
I used Pd recently on Windows XP and Mac OS X and don't remember arrays behaving like this. I'm using Pd 0.40.2, compiled from source, on Gentoo GNU/Linux, kernel 2.6.19-gentoo-r5 for AMD64. I was using 0.39 when I first noticed the problem and grabbed the latest source. Could it perhaps be a 64-bit thing?
Thanks for any help you can offer,
screwtop