Page 2 of 2
Re: Read, Add, Edit and Write Loop and Que markers to Wav
Posted: Wed May 04, 2011 5:04 pm
by larpal
With this approach, the key issue is to update the libsndfile like I've done locally so that it handles the cue points. Then it's actually only required to adjust the import pcm and export pcm source files in Audacity so that there's a check for if a .wav file have loops and/or cues in it and from them create a labeltrack (which really only requires a few lines of code). For the export one just check if there's any labels and transform sections into loops and single markers into cues (also only a few lines necessary to add). Audacity already have very nice handling of the labels themselves with the ability to sync it to a wav track and snap it to samples which allows for very exact adjustments.
I'll try to create a test build in a few days to see if I can get it to work. If it's successful then one should perhaps wait until the original author of libsndfile approves of the changes before suggesting the small changes to the Audacity devs. But if I'm successful in getting it to build I can post the steps necessary for others that are interested in having this feature in a free and open source audio editor even before it's officially approved!
Kind regards
Re: Read, Add, Edit and Write Loop and Que markers to Wav
Posted: Sat May 07, 2011 12:55 pm
by larpal
Another update. I've managed to implement this idea! But since I'm not experienced as a programmer, everyone should be warned about the possibility of errors in the code I've added. All my changes should be reviewed by someone competent. Please try it out, but it's on your own risk...
I've done all development on a Ubuntu 11.04 (32 bit) computer. I compiled the wxWidgets myself, but I only managed to get Audacity to compile if I used the unicode version of wx. The version of wx that's in the repositiories should work also.
The steps to create a loop/cue aware Audacity build are:
- Get the source code for Audacity (with subversion)
- Install all dependencies and tools for building Audacity
- Exchange some files in libsndfile folder (AudacityFolder/lib-src/libsndfile/src) that I've modified so that cue markers can be handled with libsndfile
- Exchange the AudacityFolder/src/export/ExportPCM.cpp to my version
- Exchange the AudacityFolder/src/import/ImportPCM.cpp to my version
- Configure Audacity to use local libsndfile (I used a line like ./configure --prefix=/home/lars/audacity --with-libsndfile=local --with-libsamplerate --with-libid3=no --with-ffmpeg=no but you can modify it to suit your needs)
- execute make and make install (since I used the prefix in the configure I don't have to use sudo make install and since this is a highly experimental build...)
The files in the attached archive changedSRC.tar.bz2 should to into libsndfile/src, and the textfiles should loose the .txt suffix and go into respective folder as indicated above.
When I use this feature I always sync/lock the tracks and set the snap to samples in Audacity.
Again, be warned that you try this on your own risk! It works for me and it would be great to hear what others think. What's nice is that one can handle up to 15 loops in one wav and up to 10 cue markers (due to current limitations in libsndfile). This is still much better than many other audio editors. Wavosaur for instance can only have one loop. Audacity is a really fantastic piece of software!
Kind regards
Re: Read, Add, Edit and Write Loop and Que markers to Wav
Posted: Wed May 18, 2011 8:44 pm
by larpal
Another update.
I've got some really good news! I've been in contact with the author of libsndfile (Erik de Castro Lopo) and he said that the cue feature will stand a very good chance of being included in a new libsndfile release! Actually, it's likely that not only wavs will have cue support but also aiff files and their number can easily be increased.
If this feature eventually will make it's way into Audacity (which I really hope it does!) it's possible that it could be activated/deactivated by user choice and not forced upon like my hackish implementation presented above. Anyway, this would really stand out as a remarkable feature in an open source audio editor!
Kind regards
Lars P
Re: Read, Add, Edit and Write Loop and Cue markers to Wav
Posted: Tue May 14, 2013 7:37 am
by Gale Andrews
larpal wrote:I've been in contact with the author of libsndfile (Erik de Castro Lopo) and he said that the cue feature will stand a very good chance of being included in a new libsndfile release! Actually, it's likely that not only wavs will have cue support but also aiff files and their number can easily be increased.
I usually don't like to add to two years old posts but I thought I'd better update this thread in that as far as I can tell, sndfile-convert in libsdfile 1.0.25 (current latest version) discards the cue chunk at the end of a WAV file (and accordingly, so does Audacity when it exports).
However sndfile-info appears to see and understand the cues.
Has anyone recently (or ever) tried out Lars' changes?
Gale
Re: Read, Add, Edit and Write Loop and Cue markers to Wav
Posted: Thu Jul 04, 2013 7:31 pm
by CeesvdW
Hi.
I'm a newbie at this forum here and on the subject of sampling etc.
I found this forum discussion via Google in my search to tools (like Audacity) for making Hauptwerk samples.
Has there been any progress in this subject (Editing loops etc.) since May 2011??
Re: Read, Add, Edit and Write Loop and Cue markers to Wav
Posted: Fri Jul 05, 2013 9:25 am
by Gale Andrews
CeesvdW wrote:Has there been any progress in this subject (Editing loops etc.) since May 2011??
No progress, that is why I asked recently. Did you compile the patch and try it?
Gale
Re: Read, Add, Edit and Write Loop and Cue markers to Wav
Posted: Fri Jul 05, 2013 10:15 am
by CeesvdW
Gale Andrews wrote:Did you compile the patch and try it?Gale
I guess that you mean a patch of Audacity which I should compile. Where/how to do that? Sorry I'm still a Newbie st this moment.
Re: Read, Add, Edit and Write Loop and Cue markers to Wav
Posted: Fri Jul 05, 2013 10:59 am
by Gale Andrews
CeesvdW wrote:Gale Andrews wrote:Did you compile the patch and try it?Gale
I guess that you mean a patch of Audacity which I should compile. Where/how to do that? Sorry I'm still a Newbie st this moment.
We all have to start somewhere.
It is not really a patch yet (a "patch" would be a file listing differences between the current code and the new code), but the instructions and the changed files are
above. You would download the current Audacity source, replace the files indicated, then recompile Audacity.
This may no longer work now, because other code has changed.
If you are on Debian or Ubuntu (Linux systems) it's quite easy to compile Audacity - see
http://wiki.audacityteam.org/wiki/Compi ... ers#simple .
It's not exactly hard on Windows or Mac, but definitely time-consuming to set the build environment up, and more so if you have never done it before.
Gale