wavetable-synth with phasor and tabread4 / no clicking
@willblackhurst If you look at the help file for [tabread4~] you will see that correct interpolation requires guard points added to the array so that interpolation is performed correctly as [phasor~] wraps around the end of the array.
Your patch doesn't glitch between the array copies, but it does as [phasor~] wraps at the end of the 3rd copy, or where you chop into the array adjusting the clip length percentage.
@lacuna made a handy patch to add guard points automatically.... https://forum.pdpatchrepo.info/topic/14301/add-delete-guard-points-of-an-array-for-4-point-interpolation-of-tabread4-ect
I suppose that if you want to adjust the playback length then you would need to copy a percentage of the array to a new array, and then add the guard points.
David.
How to use the bezier option in an array?
Arrays have an option to generate a bezier curve. In the attached patch, seven points are put into an array and displayed as a bezier curve. It looks nice, but does it have any function? When you read the array, you just get the points you put into it, not the points on the bezier curve. Is there a way to use the bezier curve as a wavetable or envelope, instead of the original seven points?
bezier.pd
Buffer delay loop
@DesignDefault Welcome to the Forum...!
Sorry, this will be a lot for a newbie.
You will see in the video @ricky has linked to that the [phasor~] object controls the speed at which the array is being read.
So you will need to increase the number that it receives at its left inlet in order to increase the speed.
It is an audio rate inlet, so you will need [sig~] to convert a control rate 1 to a signal rate 1.
1 will play at normal speed, 2 at double that speed etc.
Unfortunately you will need to "catch" a moment in the [phasor~] loop using [edge~] and then increment that value to [sig~] by whatever increase you want each time that [edge~] outputs a bang.
Catching the exact moment that it loops can be awkward and you might well need to add or subtract a value from the output of [phasor~] before sending it into [edge~]
A more reliable method would be to use a [metro] to increase the [sig~] with the metro rate set by the value from [timer].
Also, before playback (it only needs to be done once for the array after it has been filled) extra data points should be added.
That will stop clicks as [phasor~] wraps back to the beginning of the array.
https://forum.pdpatchrepo.info/topic/14301/add-delete-guard-points-of-an-array-for-4-point-interpolation-of-tabread4-ect
That will add 3 data points to the array, allowing [tabread4~] to correctly interpolate the samples at wrap around.
For that to work properly you should then add 3.... [+ 3] to the total number of samples after the [* 44.1]
Also, if you are running Pd at 48000Hz the [* 44.1] should be changed to [* 48] for the initial playback speed to be correct.
David.
Get the range of an array
Hello, I want to send an array (1) from my main patch, to another array (2) that is within an abstraction, replacing the contents of array 2 in the process.
I want the size and the range of array 1 to also overwrite those properties of array 2, so that I can drop an array of any size and range into the master patch.
I have so far managed to overwrite the size of array 2 using [array size array-1], which allows you to get and change the size of an array, but I cannot find the equivalent for the range property. The [array] object has a couple of arguments, 'min' and 'max' that I thought might help, but they get the min and max values from the data in the array, not the actual min and max range from the array properties.
Does anyone know if there is a way to get min and max range properties from an array, and then set those properties to another?
Plot points by importing coordinates from an external text file
Impressive examples for struct patches:
https://forum.pdpatchrepo.info/topic/10756/vanilla-struct-multislider-with-jump-on-click-and-drag
@Balwyn
https://forum.pdpatchrepo.info/topic/14009/hide-array-name/14
https://forum.pdpatchrepo.info/topic/14037/plot-graph-a-way-to-display-waveforms
Here is a workshop on data structures from some years ago (things might have changed in the meantime, but I don't know). Unfortunately the workshop-patches are not online, but you might ask João in the Pd-mailinglist.
https://media.ccc.de/v/lac2018-26-understanding_and_being_creative_with_pure_data_s_data_structures#t=1633
I am interested in how to pipe data from Pd to a fully equipped plotting-software?
https://stackoverflow.com/questions/17543386/pipe-plot-data-to-gnuplot-script
https://stackoverflow.com/questions/33457750/gnuplot-plotting-using-piped-input
@katjav https://www.katjaas.nl/plot/plot.html
(all of this is on my undone-list)
Partial array read with soundfiler?
I was hoping to build a variable-speed sound file streamer abstraction -- like readsf~ but with a rate inlet (particularly for correcting a mismatch between the file's sample rate and the DSP sample rate).
I was hoping to do it like this:
- Allocate an array with x frames.
- Upon "cue," load x/2 frames at the beginning of the array.
- When playback takes off from frame 0, load the next x/2 frames into the second half of the array.
- When playback crosses the halfway point, load the 3rd x/2 chunk into the beginning of the array.
- At this point, then, a phasor can just read forward through the array, and loop back to the beginning. At every half-transition, load data into the half of the array that isn't being played.
I quickly run into gaps in soundfiler's interface.
- "-maxsize" resizes the target array -- there appears to be no way to load partially into an array.
- There also doesn't seem to be any way to read starting at index 'a' in an array. "-skip" will skip frames from the file, but there isn't a flag for where to start putting data into the array. (Compare SC, with parameters
fileStartFrame
,numFrames
andbufStartFrame
for the buffer read message.)
This was to distribute a multichannel fixed-media work. I was thinking Pd because the download size is small. But I think I'm going to have to take this back to SuperCollider because there's a VDiskIn built-in -- can just use it, not spend time hacking it.
In any case... are there any workarounds for those two limitations? (I guess I would need two arrays -- I was hoping to avoid that because switching the table name sample-synchronously also sounds a little bit tricky.)
hjh
how do YOU make a "light" waveform display?
@Load074 Over the past few years I've also been trying out various approaches along the lines of what you're looking for, and actually tried something rather similar to your idea: pulling only one sample per x samples of the source array and sending to a smaller display array. And indeed, it doesn't work because those values are just scattered snapshots of the signal & will be discontinuous with the neighboring display samples. I realized that some kind of averaging would be needed, started to work on it, then got sidetracked & never followed through...
But, I ended up finding two pre-baked solutions:
rh_wavedisplay from netpd
pp.waveform from AudioLab
I can't quite wrap my head around how rh_wavedisplay works from looking inside the abstraction, but the result looks nice. From the help patch:
This abstraction finds the minima and maxima for each section of the source table that covers one pixel of the display array. The result is a good looking waveform that does not suffer from aliasing.
I also like that it allows for only a section of the source array to be used for display (which is important for how my performance patch uses arrays). In practice it still causes audio dropouts when updating large source arrays, unfortunately.
pp.waveform uses data structures, which is why the result looks so different visually. I don't understand data structures enough to play around with this or try to adapt it for my uses, but I would be definitely curious about whether it's any more efficient than those other graphical array manipulation methods.
I also wonder if there's simply no method that will prevent audio dropouts without some kind of array manipulation that can run on a different thread. I've been looking into the shmem library to see if it's possible to outsource the array processing to another Pd instance (similar to the Pd~ approach that @alexandros suggested), haven't gotten very far so I still don't know if there will be a bottleneck when dumping a huge array to memory.
can an array object be moved with a metronome, like shift left & then right?
@esaruoho So you don't really want to move it....... you are still looking for a way to have a constant update (while it is actually updating).
Some messages will update the [array] as @oid says..... and there are many......... https://forum.pdpatchrepo.info/topic/10720/change-appearance-of-an-array-by-sending-a-message
But there is only one message that will do so without changing the data or the appearance.....
[;
arrayname rename arrayname(
....... renaming the array with the same name will cause a redraw.
I am a bit loathe to point you in these directions as it will create more fun.....
When an array is updated Pd will send a ping message..... that could be used to update again, but maybe a small delay would be advisable (feedback overflow)..... https://forum.pdpatchrepo.info/topic/11501/get-array-values-when-they-are-updated
For [array define] a copy can be created for display...... could also be done with a [metro]...... https://forum.pdpatchrepo.info/topic/12072/display-an-array-define-array-constantly
But too fast updating will cause dropouts.
David.
PlugData GraphOnParent not showing the controls in parent patch
Graph-on-parent is fine in PlugData. (Editorial comment: PlugData is a much-needed effort to move Pd's UI away from three-decades-old standards... assuming that it's wrong just because it's new IMO contributes to stasis, which is not healthy for the platform.)
The problem is in the structure of your patch.
sfplayer.pd is not a graph-on-parent patch. I can see this by opening it in regular Pd, and right clicking on the empty space --> Properties. The graph-on-parent property is not selected at the top level. So there is no reason for either Pd or PlugData to display it as graph-on-parent, when it isn't.
Inside that patch, you have a graph-on-parent subpatch. This is misleading you into thinking that you have done graph-on-parent, when you haven't. (But then, the GUIs are not in the subpatch either!)
Now, I do see an unfortunate limitation in PlugData: I don't see right away how to get to the graph-on-parent property. I expected right-click empty space --> Properties to show the canvas properties, but it doesn't. AFAICS then, to create a graph-on-parent abstraction, it looks like you will have to use normal Pd first.
Here is sfplayer with graph-on-parent defined at the top level.
hjh
Copy larger array (1mb) to smaller array (64kb) with visual definable startpoint?
@whale-av said:
@esaruoho The chance that you will always catch the start point is not great.
I would suggest a pre-roll...... so press the toggle before the sound is played and then you will not miss it.
unfortunately this is simply not possible. i work with a friend and they play whatever at any point in time and it's up to me to pick up the pieces and get tons of happy accidents. but surely metro 2000 is not precise enough, maybe i should change it to metro 1000? or is it a case of by the time an array visually updates, it is already recording more to the array?
i found that with the 1mb array, it does not visually update until the whole array has been recorded, so you don't see "content appearing in the array during the record".
i'm not at all sure now how to take a specific segment of an array and copy it to another array, because it seems that [array sum startpoint + specificlength + arrayname]
isn't what i'm looking for. or am i mistaken? i couldn't seem to find an example from the help. EDIT: well it helps to be using [array get]
instead of getting confused with [array sum]
documentation which is something else altogether
You can use a slider for finding the start point,
i'm not 100% how that would visually look like though, i mean, is it possible to visually show that "this is where the startpoint is at? should i have two arrays, with one being controlled by the slider, and one with the audio content?
my array is X size 600 and Y size 90 - so pretty huge and wide. i guess i should make a 0 to 1048580 slider and hope for the best?
and use [lop~] to "scrub" which should make that easier..... https://forum.pdpatchrepo.info/topic/11850/explanation-for-lop-object-in-this-patch-requested
thanks, i'll have to study this, since it seems very interesting.