Automatic sample length adjustment

Hi there,
I want to build a huge sample library which is created sort-of-automatically. Files will get saved after each zero crossing, whatever the speed of the audio input will be, so the recorded sample length can vary a lot (big modulation width of oscillators).
Now I’ld like to have these all set to the same sample length, though the inbuild time stretcher is set to keep the pitching percentage the same but not the sample length. So I’ll have to reset that for each and every sample and I’m not looking forward to having to do this as it’s going to be ten-thousands of samples within a minute…

So the question is:
Is there a way to modify this plugin, so you can select whether it keeps it’s pitchshifting-preset or that it keeps it’s sample-length preset?
(using audacity 2.1.2)

Sorry but there are so many holes in your description that I can’t find a meaningful question.

How are you doing that?
So most of these files will be just single cycles of the waveform and some may be less than one complete cycle?
I assume that you’re dealing with mono sounds? If not, then what do you do if there are no zero crossing points common to both/all channels?
What’s the purpose of this?
How far have you got so far?

What do you mean by “speed” of the audio?

Are you referring to the “sample rate” or the “length of the sounds”?

Which inbuilt time stretcher? Audacity has “Change Speed”, “Change Tempo”, “Change Pitch” and “Sliding Time Scale / Pitch Shift”.

I meant “change speed” (the others have no controls to set the sample-length, which should be set to 1024)

Try running this code in the Nyquist Prompt effect (

;control ln "Required length in samples" int-text "" 1024 1 nil
(force-srate (* ln (/ *sound-srate* len)) *track*)

oh ehm, I just found out that I can better use .wav files for the axoloti then the .raw files that were spoken about in the axoloti forum to make my wavetable synthesizer…
So I’m kinda heading in another road and making a spectral synthesizer and an accompanying wave recorder, so I can create an ongoing sequence of changing waveforms, all with the same sample-length from the start (main “phase” oscillator just plays at one rate and doesn’t change, only the used partials and their volume/phase change). This way I can make an automated recording of loads of possible combinations of harmonics. The longer I let it run, the more samples I have… Could it get more simpler to build wavetables which are also possible to understand how to morph them comprehensible? (I know it sounds like an overstatement “understand” and “comprehensible”, but I mean to say that you’ll be able to see it’s a system and also see how to move through that system…)
But still good to have this code for other files I would like to convert!