Hi
I looked at it, and found a possible cause for the problem.
Partikkel reads mono sound sources, and you have loaded a stereo file. This might seem innocent, but it can sometimes cause problems.
What follows is a lengthy explanation of what happens. You do not need to read it all, but I thought it could be interesting. A solution follows at the end.
When you use gen 01 to load a file, you will normally usually read all channels (as you have done). This works well if you then play the file with a stereo audio playback method. However, the samples in a stereo file are stored in interleaved manner: The first value of the left channel, then the first value of the right channel, then the second value of the left, and the second value of the right. When you play back the table with a stereo playback method (like loscil for example), it will read it interleaved and put all the left channel values to the left audio output and all the right channel values to the right audio output, so it is played back correctly. Now, when you try to play this table of audio data with a mono playback method (like partikkel, or a simple table playback for example), then it will play all the samples in the order they are stored, …in effect switching between left and right at audio rate. If there is relatively little difference between the two channels, you will simply hear the original sound at half the speed (pitch one octave down) and you might not notice any artifacts (you will get almost like a sample and hold type of thing, we could say it is somewhat similar to downsampling by a factor of two). BUT, if the left and right channel are very different, like in your file, the artifacts are more pronounced. We get a lot of discontinuities in the waveform then it flips between the two channels, … so we also get a lot of extra high frequencies (in the worst case square-wave-like distortion at the Nyquist frequency). With untransposed playback, it might not be too obvious, but it will be there. When you transpose the signal, these effects will start to be more prominent, and when you do pitch sweeps from one transposition to another they will sometimes come out very clearly - like in your example.
So, solution 1:
modify the line
gifile ftgen 0, 0, 0, 1, “N_01_220Hz.wav”, 0, 0, 0
so that it only reads the left channel of the file
gifile ftgen 0, 0, 0, 1, “N_01_220Hz.wav”, 0, 0, 1
or only the right channel
gifile ftgen 0, 0, 0, 1, “N_01_220Hz.wav”, 0, 0, 2
Then your csd should sound fine. It will be one octave higher than what you had in your example. It makes sense to use the same sr as what you had in your source audio file, otherwise you will also get transposition due to the sr mismatch.
Solution 2:
Mix the two channels of your file to make a mono version, and load it as you have done
gifile ftgen 0, 0, 0, 1, “mono_version.wav”, 0, 0, 0
Solution 3 (to keep your interesting stereo beating effects:
Load the left and right channels into separate tables
gileft ftgen 0, 0, 0, 1, “N_01_220Hz.wav”, 0, 0, 1
giright ftgen 0, 0, 0, 1, “N_01_220Hz.wav”, 0, 0, 2
and then use two instances of partikkel to play back the audio, one using gileft and one using giright as the source waveform. Then you would want to use the same random values for both partikkel instances, so they would both transpose the source audio in the same way.
This third option is much more work of course. You would also need to consider how you handle the stereo output from each of the partikkel instances (partikkel will read mono audio but produce stereo output due to the channel masking etc). It is all doable if you decide that you need it.
Don’t hesitate to ask for clarification if anything is unclear. It was a good riddle to solve, and I did not immediately spot the cause of the problem
all best
Øyvind