[L2Ork-dev] Purr Data & Audio Sample Rate

Albert Graef aggraef at gmail.com
Thu Oct 15 02:16:42 EDT 2020


On Thu, Oct 15, 2020 at 2:51 AM Linux ROUEN Normandie <linux.rouen at free.fr>
wrote:

> Thanks for your clear explanation and the nice recall of our funny
> early-life! I still have my 33 LP & 45 rpm discs collection but I have lost
> my player. ;-)
>

You can still buy those, they seem to be popular these days again, and many
come with a built-in USB audio interface. :)

Well, so I was too demanding regarding the capabilities of such Audio
> objects.
>

VLC has it easier, because it just does linear playback, and in such a case
you can, e.g., use libsamplerate to convert the sample rate on the fly. In
real time audio programs like Pd, you'd generally want to avoid such costly
operations. With soundfiler+tabread4~, you can compensate for the SR
discrepancy by adjusting the playback speed, but oggread~ has no provisions
for that (probably because it's playing back the file directly from disk,
which makes adjusting playback speed much more complicated).

So, I do need to spend some time to find out how I can easily implement
> such mechanism within my Purr Data projects by e.g. reading the relevant
> part of the Audio file header and then decide what to do either with/around
> the given Audio player object and/or Purr Data settings. I'm continuing to
> learn each day.
>

You could use the Vorbis oggdec and oggenc utilities to re-encode your ogg
files off-line in the sample rates that you need. Generally having 44.1 and
48 kHz versions of each file should be good enough, although some
audiophiles will claim that 192 kHz "sounds much better" -- which is a bit
like dowsing, never seems to work in double blind experiments. ;-)

Albert

What a wonderful community!
>
> Best, Joseph
> - - - - - - - - - -
>
> Le 15/10/2020 à 01:14, Albert Graef a écrit :
>
> Hi Joseph,
>
> Well, if you read something into a Pd array at sample rate SR1, and then
> play that sample data back later (through Jack or otherwise) at sample rate
> SR2, then it will play back with a speedup/slowdown factor of SR2/SR1, and
> pitch will shift by the same factor. The audio interface doesn't care where
> those numbers come from. It will happily play 48000 samples of your
> 44.1kHz-sampled data in 1 sec, which will speed it up by a factor of
> 48000/44100 = 108.8% and make it sound about 1.5 semitones higher.
>
> At least that's what happens if the object decoding the ogg file doesn't
> convert to the target sample rate on the fly. I'm not sure whether oggread~
> does this.
>
> Joseph, I'm sure you also still remember those glorious days when we
> enjoyed playing back those black "LP" discs at 45 rpm. It's the same
> effect, only in digital. ;-)
>
> HTH,
> Albert
>
>
> On Wed, Oct 14, 2020 at 10:48 PM Linux ROUEN Normandie <
> linux.rouen at free.fr> wrote:
>
>> Hello to the Audio specialists,
>>
>> I'm struggling since a while with an annoying Audio issue under Purr
>> Data using e.g. [oggwrite~] / [oggread~] with their default settings.
>>
>> Under GNU/Linux for Audio I'm using JACK2 with QJackCtl or Ubuntu Studio
>> Control and JACK back-end = ALSA.
>> I record from an Audio source (synth, micro, line) with [oggwrite~] and
>> then play it back with [oggread~].
>>
>> As long as I'm using everywhere (Pd, Jack) the same Sample Rate, either
>> 44100 or 48000, it's all fine - no issue at all.
>> But if the Play SR changes (voluntary or not in Pd & Jack) vs the Record
>> SR, then when playing my Audio song back is running either faster or
>> slower!
>>
>> I thought that the Audio SR had nothing to do with the playback speed
>> but only, among other things, with the sound quality.
>>
>> What is wrong in my thinking? Any ideas?
>>
>> Thank you. Best,
>> Joseph Gastelais
>>
>> _______________________________________________
>> L2Ork-dev mailing list
>> L2Ork-dev at disis.music.vt.edu
>> https://disis.music.vt.edu/listinfo/l2ork-dev
>
>
>
> --
> Dr. Albert Gr"af
> Computer Music Research Group, JGU Mainz, Germany
> Email: aggraef at gmail.com, web: https://agraef.github.io/
>
> _______________________________________________
> L2Ork-dev mailing listL2Ork-dev at disis.music.vt.eduhttps://disis.music.vt.edu/listinfo/l2ork-dev
>
>
> _______________________________________________
> L2Ork-dev mailing list
> L2Ork-dev at disis.music.vt.edu
> https://disis.music.vt.edu/listinfo/l2ork-dev



-- 
Dr. Albert Gr"af
Computer Music Research Group, JGU Mainz, Germany
Email: aggraef at gmail.com, web: https://agraef.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://disis.music.vt.edu/pipermail/l2ork-dev/attachments/20201015/5913f27a/attachment.html>


More information about the L2Ork-dev mailing list