Change sample rate and preserve loops
Moderators: MattKingUSA, khz
- d.healey
- Established Member
- Posts: 610
- Joined: Fri Sep 22, 2017 8:33 pm
- Has thanked: 274 times
- Been thanked: 100 times
Change sample rate and preserve loops
Anyone know a piece of free software that can batch convert wave files to a different sample rate while preserving loop points? I thought SoX or ffmpeg would be able to but the loop points always get lost.
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
Re: Change sample rate and preserve loops
SoundConverter, maybe? I'm not sure it'd preserve the loop markers though: https://soundconverter.org/
But here's an alternative idea off the top of my head:
1. Import all these loops into a DAW that will understand these loop markers (Each loop on their own mixer track).
2. Set the sample rate of the DAW to what you want.
3. Import the project as stems rather than a single mix.
That should work.
But here's an alternative idea off the top of my head:
1. Import all these loops into a DAW that will understand these loop markers (Each loop on their own mixer track).
2. Set the sample rate of the DAW to what you want.
3. Import the project as stems rather than a single mix.
That should work.
- d.healey
- Established Member
- Posts: 610
- Joined: Fri Sep 22, 2017 8:33 pm
- Has thanked: 274 times
- Been thanked: 100 times
Re: Change sample rate and preserve loops
I just tried soundconverter, it keeps cue markers but not loops unfortunately, also it won't let me export at 24bit, only offers 8/16/32 - weird.
Can you recommend a free DAW that can do that?
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
Re: Change sample rate and preserve loops
No idea haha..
I use FL Studio via Wine and that can do it. If you don't mind temporarily installing it just for the job then you could use the demo version which should let you do it. I think the only limitation is that it won't let you save projects but it's not like that'll matter here.
- d.healey
- Established Member
- Posts: 610
- Joined: Fri Sep 22, 2017 8:33 pm
- Has thanked: 274 times
- Been thanked: 100 times
Re: Change sample rate and preserve loops
I need a more permanent and non-proprietary solution.Death wrote: ↑Thu Jan 28, 2021 10:48 pm I use FL Studio via Wine and that can do it. If you don't mind temporarily installing it just for the job then you could use the demo version which should let you do it. I think the only limitation is that it won't let you save projects but it's not like that'll matter here.
I don't think Audacity would be suitable. I'll potentially be converting hundreds of files and I don't think Audacity has an interface that is particularly suited to working on such large batches of files. If I remember correctly importing the files would create a new track for each one and that would be quite horrible to manage. Although I guess if it's just for sample rate conversion, an in/out job, then it may be doable if it can handle a large number of files without crashing (I'll play around with it).
I was recently introduced to Signet - https://github.com/SamWindell/Signet/ - and this has rate conversion, the developer tells me that it will preserve loop points too. I haven't been able to get it to build yet on my system but I'm working on it, hopefully this will be the solution.
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
- Loki Harfagr
- Established Member
- Posts: 268
- Joined: Thu Aug 02, 2018 1:28 pm
- Has thanked: 151 times
- Been thanked: 53 times
Re: Change sample rate and preserve loops
@d.healey
problem is that the Wav format per se doesn't "hold" or "manage" loops nor metadata though it can accept to have some attached thus I suppose your "wav files with loop markers" are held in some metadata which were added at some time by some sound editor or akin?
anyway, since you're only asking for change sample rate if your loop markers are held in a time format unit and not a frame unit you still can manage to first extract the letadata from the source wav file, soxi might well do it, keep it in a temp file then use sox to change the rate of the taget file and then reattch the saved metadata file to the target, that final step may be done with various tools depending on the format of the metadata you used.
Note: untested since I don't have any wav file with metadata or loop points or at least I've never tried to check nor to use them and just happened to know by your post that they existed
problem is that the Wav format per se doesn't "hold" or "manage" loops nor metadata though it can accept to have some attached thus I suppose your "wav files with loop markers" are held in some metadata which were added at some time by some sound editor or akin?
anyway, since you're only asking for change sample rate if your loop markers are held in a time format unit and not a frame unit you still can manage to first extract the letadata from the source wav file, soxi might well do it, keep it in a temp file then use sox to change the rate of the taget file and then reattch the saved metadata file to the target, that final step may be done with various tools depending on the format of the metadata you used.
Note: untested since I don't have any wav file with metadata or loop points or at least I've never tried to check nor to use them and just happened to know by your post that they existed
- d.healey
- Established Member
- Posts: 610
- Joined: Fri Sep 22, 2017 8:33 pm
- Has thanked: 274 times
- Been thanked: 100 times
Re: Change sample rate and preserve loops
I can't remember the details but I believed they are stored in the cue-chunk.Loki Harfagr wrote: ↑Fri Jan 29, 2021 3:04 pm @d.healey
problem is that the Wav format per se doesn't "hold" or "manage" loops nor metadata though it can accept to have some attached thus I suppose your "wav files with loop markers" are held in some metadata which were added at some time by some sound editor or akin?
anyway, since you're only asking for change sample rate if your loop markers are held in a time format unit and not a frame unit you still can manage to first extract the letadata from the source wav file, soxi might well do it, keep it in a temp file then use sox to change the rate of the taget file and then reattch the saved metadata file to the target, that final step may be done with various tools depending on the format of the metadata you used.
Note: untested since I don't have any wav file with metadata or loop points or at least I've never tried to check nor to use them and just happened to know by your post that they existed
I don't think your method would work, at least not without some modification. Changing the sample rate changes the position of the start and end of the loop within the file.
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
Re: Change sample rate and preserve loops
Cheers mate. I was looking for something similar as well.Death wrote: ↑Thu Jan 28, 2021 11:30 am SoundConverter, maybe? I'm not sure it'd preserve the loop markers though play casino for real money and casino casinoslogin.com/wintika-casino.html login wintika.
But here's an alternative idea off the top of my head:
1. Import all these loops into a DAW that will understand these loop markers (Each loop on their own mixer track).
2. Set the sample rate of the DAW to what you want.
3. Import the project as stems rather than a single mix.
That should work.
Last edited by kafka on Tue Feb 09, 2021 12:17 pm, edited 2 times in total.
-
- Established Member
- Posts: 2047
- Joined: Tue Feb 16, 2016 6:56 am
- Location: Kangasala, Finland
- Has thanked: 369 times
- Been thanked: 208 times
- Contact:
Re: Change sample rate and preserve loops
In wav file loop points are in smpl chunk, and locations are stored in byte offset. So change in sample rate or number of bits/sample mean need to recalculate.Loki Harfagr wrote: ↑Fri Jan 29, 2021 3:04 pm problem is that the Wav format per se doesn't "hold" or "manage" loops nor metadata though it can accept to have some attached thus I suppose your "wav files with loop markers" are held in some metadata which were added at some time by some sound editor or akin?
anyway, since you're only asking for change sample rate if your loop markers are held in a time format unit and not a frame unit you still can manage to first extract the letadata from the source wav file, soxi might well do it, keep it in a temp file then use sox to change the rate of the taget file and then reattch the saved metadata file to the target, that final step may be done with various tools depending on the format of the metadata you used.
https://sites.google.com/site/musicgapi ... ormat#smpl
Linux veteran & Novice musician
Latest track: https://www.youtube.com/watch?v=ycVrgGtrBmM
- d.healey
- Established Member
- Posts: 610
- Joined: Fri Sep 22, 2017 8:33 pm
- Has thanked: 274 times
- Been thanked: 100 times
Re: Change sample rate and preserve loops
Signet is the way to go - https://github.com/SamWindell/Signet/
The developer got it building on GNU/Linux and I just tested sample rate conversion and it does preserve the loop points.
The developer got it building on GNU/Linux and I just tested sample rate conversion and it does preserve the loop points.
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
Re: Change sample rate and preserve loops
Thanks, this is very helpful.d.healey wrote: ↑Thu Feb 04, 2021 2:24 pm Signet is the way to go - https://github.com/SamWindell/Signet/
The developer got it building on GNU/Linux and I just tested sample rate conversion and it does preserve the loop points.
I mainly work on this page. In my free time I try to write music.