Did anyone see an Audacity plugin or feature that can take an audio file of e.g. 48000 samples long, and re-sort its samples by picking, e.g., every 52800th sample as it keeps cycling through it?
If the picking number (the 52800 in the above illustration) is related to the source's BPM x sampling frequency, the result might be musical.
Re-sorting the samples of an audio file?
Forum rules
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
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
Re: Re-sorting the samples of an audio file?
Does that make sense? How do you pick the 52800th sample if there are only 48000 samples?mrdelurk wrote:e.g. 48000 samples long, and re-sort its samples by picking, e.g., every 52800th sample as it keeps cycling through it?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Re-sorting the samples of an audio file?
You keep cycling (looping) through the file, counting 48001 at the next loop start.
It could be visualized as if the file looped endlessly for days and you extracted a single sample at repeating time intervals. Which might be larger than a single loop's length.
It could be visualized as if the file looped endlessly for days and you extracted a single sample at repeating time intervals. Which might be larger than a single loop's length.
Re: Re-sorting the samples of an audio file?
So essentially you are picking the 4800th sample? (48000 + 4800 = 52800)mrdelurk wrote:You keep cycling (looping) through the file, counting 48001 at the next loop start.
That will give you sample numbers:
4800
9600
14400
19200
24000
28800
33600
38400
43200
48000
52800
then back to 4800...
Assuming that your sample rate is 48000 Hz, all that will give you is a high pitched tone comprising of frequencies 4800 Hz, 9600 Hz, 14400 Hz, 19200 Hz and 24000 Hz.
If your sample rate is not 48000 Hz, you will get the same harmonic pitches based on a fundamental 1/10th of the sample rate.
This Nyquist code will give you one complete cycle (10 samples when selecting every 52800th sample from 48000 samples).
You can use the "Repeat" effect (http://manual.audacityteam.org/o/man/repeat.html) to make the result long enough to play.
The code can be run in the Nyquist Prompt effect (http://manual.audacityteam.org/o/man/ny ... rompt.html) on a mono track.
Code: Select all
(setq ln 48000) ;number of samples to work with
(setq count 52800) ;the nth sample
(if (< len ln)
"Error.nSelection too short."
(progn
(setq n (rem count ln))
(let* ((samples (snd-samples s ln))
(samplelist (list (aref samples 0))))
(do ((i n (rem (+ i count) ln)))
((= i 0))
(push (aref samples (1- i)) samplelist))
(setf out (make-array (length samplelist)))
(dotimes (i (length samplelist))
(setf (aref out i)(nth i samplelist)))
(snd-from-array 0 *sound-srate* out))))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)