no click tabread4~
dumb questions
I didn't say that.
I thought the guard points was there to make a fast crossfade between the end and the start of the loop... is this right?
The "4" in [tabread4~] [tabosc4~] ect. stands for four-point interpolation. It inter-sample interpolates. This is useful when you read an array at different sampling-rate than the patch/system's sampling-rate. This happens if you change the read-speed or of the array or if it has different samplerate. By interpolating between samples you get a value anytime, even between samples.
The interpolation algorithm requires 4 points, and to work as intended, it requires an array-size in the power of 2 plus 3 samples have to be added at the edges of the array.
You can read about this in more detail in the array-guard helpfile and further links mentioned there.
There is also [tabread~] that does not inter-sample interpolate.
I thought you could add some extra samples to the length of the table and it would happen automatically
Take an array in the size of power of two (256 for example) and use array-guard to add the guardpoints.
But I don't think that the click is about inter-sample-interpolation-artifacts.
Check out the patch I uploaded in my last post.
crossfade between the end and the start of the loop
Yes, this would be another common way to get rid of the click.
Also, you can read Perlin directly, without array, check Perlin helpfile.
Delay Time Changes Artifacts
@c_c I think you will always have artefacts as the delay read point changes.
Even if you have 2 delays and swap (flip-flop) between them you will hear the change.
But if you crossfade between the 2 delays maybe your ears/brain will be deceived.
You will need to find a sweet spot for the length of the crossfade dependant on the range of the timing changes.
David.
List crossfade
Hello
I have searched on the forum and couldn't find anything
I have an additive synth with each partial tuned to overtones
I want to be able to crossfade between all these partials, but im not sure how
Is there a way to crossfade using a list of the partial index or another way?
Thank you for any help 
Strategies to create an volume ramp to eliminate clicks and pops when playing a soundfile
@nicnut I agree with @alexandros that 200 ms is too long and think you could even try something shorter than 20 ms.
Here's another strategy: make 2 voices that accept play/stop commands and then toggle between them, e.g.
This sends the stop command to one voice and the play command to the other, so that the voices effectively crossfade. The voices should fade up on start and fade out on stop, and if a stopped voice receives a stop command, it should keep quiet. This scheme will still pop if you bang twice within the crossfade period, but you could prevent that using a lock-out timer.
"crossfader" style slider for selecting and blending waveforms/oscillators
Would really appreciate some help. I want to build a synth where each tone generator/oscillator module has waveform selectors in the form of 6 toggles and a horizontal slider with 6 values, ranging from (left to right) my saw(ramp down), square, rev. saw(ramp up), triangle, sine, and noise~. I have other things I would like to modify like making the oscillators polyphonic, pulse width, modulating crossfader and other params, etc. this crossfader seems to be a unique and difficult task for a noob like myself.
img of patch attached, i welcome any other thoughts as well. obviously i know only one osc is connected to dac~ in my img.

Many thanks
maths regarding conversion from metro speed to pitch
Another approach is to design the implementation around the requirement.
You want to be able to produce a specific frequency. So... make frequency the input parameter, rather than metro time interval.
You want to step through array values, with an equal amount of time for each. That suggests a linear ramp, with a given frequency... i.e., phasor~.
phasor~ always goes 0.0 - 1.0. With 12 points, the array indices go 0.0 - 11 -- but here, note that if you say 0.0 - 11.0, then index 0 covers a span of 1, but index 11 covers a span of 0! That doesn't sound right. Instead, define the span for each index as i <= x < (i+1) -- inclusive at the bottom, exclusive at the top. Now the entire range is 0 <= x < 12... leading to the idea of multiplying the phasor by 12 (number of points).
The array indexing should truncate away any fractional part: if (phasor * 12) = 3.546, it should just read 3. Fortunately, this is the normal behavior of tabread~ (not tabread4~).
So we can get a sample-and-hold waveform this way. (The third array is just showing the floor-ed indices, to demonstrate that tabread~ really is truncating rather than rounding.)

All that's left is to add linear interpolation. A standard way to do linear interpolation is:
x = crossfade factor (0.0 - 1.0)
a = value when x = 0
b = value when x = 1
xfade = (b-a) * x + a (this is a reduction of (a * (1-x)) + (b * x)).
If i is the index, then a = array "at" i, and b = array "at" i+1 -- but here, b needs to be modulo-wrapped back around, because i+1 could be 12-point-something. Pd vanilla doesn't have [%~] at signal rate, but [expr~] has fmod().
So we can index the two values, subtract, multiply by the crossfade factor (which is phasor * 12 --> wrap~), then add the "array[i]" value back in.

Now you can do whatever frequency you want, without the awkward conversion. Doesn't matter what that online tutorial said, IMO this fits the stated requirement better.
hjh
How to loop/reset an audio file to the beginning
@KMETE Requoting myself: "To crossfade properly, it needs to subtract 100 ms from the file's total duration."
Let's say you have 10 seconds of audio.
You want to loop it, with a 100 ms crossfade.
If you just use "all" then it will do this:
- Start at 0 and play to 10 sec.
- Loop back to 0.
- At this point, for a cross fade, the step 2 audio fades in, and the step 1 audio fades out. But step 1 has already run out of audio.
So at that point, you don't get a cross fade. You get an immediate jump to silence (maybe with a click), and then a fade in.
It "seems to work" in that there is no error, nothing crashes, no major audio glitches. But it isn't crossfade looping.
The solution here changes it to:
- Start at 0 and play to 9.9 sec.
- Loop back to 0.
- At this point, the step 2 audio fades in, and the step 1 audio fades out over the range 9.9 - 10 sec = clean crossfade.
But if you're happy without a proper crossfade, then by all means, do what you feel is best.
At this point, with apologies, I need to withdraw from the thread. I've already spent much more time on it than I expected, and the follow-up questions are becoming a bit like... not the best use of time. Like, I'm getting ready to shoot a YouTube tutorial on Pd external sync, and instead of working on those materials, I was explaining crossfading here. I think I need to strike a better balance.
hjh
How to loop/reset an audio file to the beginning
@KMETE said:
why did you add 100 at the sf-play2~ object right after the array name au ? to start the file from the 100ms time and not from 0ms? why is that?
The sfplay2~ help patch explains:
Arguments:;
1 Table name (should match a soundfiler2 instance) - recommended to use [monofile] or [stereofile];
2 Envelope A/R time, default is 10 ms
The second argument (the 100) is the envelope attack-release time, NOT the playback start time.
In sf-varispeed2~ it's a little different -- when looping, it's the crossfade time.
I just realized, there is one mistake in both of my patches. I'm specifying a loop crossfade = 100 ms. To crossfade properly, it needs to subtract 100 ms from the file's total duration.
So, where you see "all" in those patches, substitute like this:

(In your abstraction, you have "stereofile audio$0 $1" which is fine -- but you'd need "getvalue audio$0dur" then.
Should be the same for the varispeed version too.
hjh
How to loop/reset an audio file to the beginning
Sound file usage is one of those things in Pd that really triggers me. All the pieces are there, but... sound files should be easy. They aren't easy.
For the sake of my students, a year or two ago I made a set of abstractions that do make sound files easy. (A couple of them use cyclone btw, so you would have to install that.)
https://github.com/jamshark70/hjh-abs
Using these abstractions, I can re-trigger a sound file easily in two ways.
-
On the left, feed the "bang at end" back to trigger another "all" message. (The [spigot] is to make sure it really stops when you stop it.)
- The loop will be quantized to the audio block size.
-
On the right, enable crossfade looping in the player and just let it run.
- The loopx message specifies the number of ms at the end to use for the cross fade, so the loop will be file_duration - loopx ms.
IMO the crossfade is better, to avoid clicks at the loop point.

(Note the comment at the top about stereo.)
Admittedly, this doesn't directly answer the original question about how to repeat the file using the design in that screenshot. But, if I'm honest, my answer is that I wouldn't do it the vanilla way, because I think the baseline vanilla objects don't provide a usable programming interface. If part of the problem that you're running into is that the object interfaces aren't usable, one solution is to use a different interface.
hjh
Wet-Dry Mix In Amplitude Modulation
Wet-Dry AM.pd
Hey everyone,
I'm experimenting with trying to get a clean fade between the dry carrier sound and the wet modulated sound when using AM but am running into a couple problems.
- When I make the modulating signal into a unipolar waveform, I can get a clean transition between the dry sound and modulated tremolo sound, but at faster modulation speeds the carrier can be heard with the other 2 frequency bands
- When I use the bipolar waveform, the transition between the dry signal and the tremolo signal is sloppy and the rate begins to sound like it doubles
I'm wondering why the carrier sound is present when modulating at high speeds with the unipolar waveform but not with the bipolar waveform? And I'm also curious why the tremolo speed feels like it doubles in its rate when crossfading with the bipolar waveform?
Ideally, I would like to have the best of both worlds in the patch where it crossfades cleanly into a full tremolo, but also where the carrier signal doesn't exist when the modulation is fully wet. Not sure if videos work here, but I'll try and post one.[link text](Amplitude Modulation.mp4 link url)

