Automatic sample length adjustment

Audio software developers forum.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

Automatic sample length adjustment

Permanent link to this post Posted by SirSickSik » Mon Apr 04, 2016 11:51 am

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)
SirSickSik
 
Posts: 3
Joined: Mon Apr 04, 2016 11:42 am
Operating System: Windows 7

Re: Automatic sample length adjustment

Permanent link to this post Posted by steve » Mon Apr 04, 2016 12:18 pm

Sorry but there are so many holes in your description that I can't find a meaningful question.
SirSickSik wrote:Files will get saved after each zero crossing,

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?
...

SirSickSik wrote:whatever the speed of the audio input will be

What do you mean by "speed" of the audio?

SirSickSik wrote:I'ld like to have these all set to the same sample length,

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

SirSickSik wrote:he inbuild time stretcher

Which inbuilt time stretcher? Audacity has "Change Speed", "Change Tempo", "Change Pitch" and "Sliding Time Scale / Pitch Shift".
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45022
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Automatic sample length adjustment

Permanent link to this post Posted by SirSickSik » Tue Apr 05, 2016 11:57 pm

steve wrote:Sorry but there are so many holes in your description that I can't find a meaningful question.
SirSickSik wrote:Files will get saved after each zero crossing,

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?
...

I'm using synthedit to record a spectral oscillator that I've build, at each zero-crossing from negative to positive, the recorded audio is saved by the recording module, while another recording module is being selected to record the next cycle. It has been recording thousands of waves within a minute, giving each their own name (using index numers as names).

SirSickSik wrote:whatever the speed of the audio input will be

What do you mean by "speed" of the audio?

Sorry, that was quite misleading indeed... I meant "whatever the rate of one cycle". So it might be very slow at 20hz (high resolution recordings) or very fast at 16khz (creating down-sampled recordings).

SirSickSik wrote:I'ld like to have these all set to the same sample length,

Are you referring to the "sample rate" or the "length of the sounds"?
I meant to say that I want all the recordings to be converted to 1024 samples.

SirSickSik wrote:he inbuild time stretcher

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)
SirSickSik
 
Posts: 3
Joined: Mon Apr 04, 2016 11:42 am
Operating System: Windows 7

Re: Automatic sample length adjustment

Permanent link to this post Posted by steve » Wed Apr 06, 2016 1:07 pm

Try running this code in the Nyquist Prompt effect (http://manual.audacityteam.org/o/man/ny ... rompt.html):
Code: Select all
;control ln "Required length in samples" int-text "" 1024 1 nil
(force-srate (* ln (/ *sound-srate* len)) *track*)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45022
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Automatic sample length adjustment

Permanent link to this post Posted by SirSickSik » Wed Apr 06, 2016 10:57 pm

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!
SirSickSik
 
Posts: 3
Joined: Mon Apr 04, 2016 11:42 am
Operating System: Windows 7


Return to General Audio Programming



Who is online

Users browsing this forum: No registered users and 3 guests