Closed artm closed 12 years ago
another variant: open an external editor
I've switched samples to standard wav (format: float32-mono-44.1kHz) see #36
Old samples are still loaded, new ones will be wavs. (Actually I expected that old files will be converted automatically because I don't mark them fresh, but something went wrong. I will probably fix this while working on the rest of the issues of this milestone).
Audacity can open our samples now, but saving back to original wav file involves too many user actions (menu File > Export, OK in the export dialog, find data directory, make sure output format is WAV).
Audacity only supports 16 bit PCM format, but WTS tool can open it no problem.
It may be a good idea to leave the choice of an external editor to the particular workshop organization and provide some tips.
Here is a list of free audio editors, although not all of them are suitable for wav sample editing (and not all of them work on both windows and mac). May be someone could compile a similar list of open source, freeware and cheap softwares that could be used to edit the WTS samples? The advantage is - if the instructors already know some wav editor, they could just use that.
the last one on the list - wavesurfer - is quite simple and its save action (apple+s on a mac, ctrl+s on a pc) saves back to the file that was open in the original format without asking any extra data. I have to investigate what plugins it supports (the original effects list is very limited).
I will do some research on the wavesurfer today.
A software tool for the manipulation of audio recordings.
" WaveSurfer is an Open Source tool for sound visualization and manipulation. It has been designed to suit both novice and advanced users. WaveSurfer has a simple and logical user interface that provides functionality in an intuitive way and which can be adapted to different tasks. It can be used as a stand-alone tool for a wide range of tasks in speech research and education. Typical applications are speech/sound analysis and sound annotation/transcription. WaveSurfer can also serve as a platform for more advanced/specialized applications. This is accomplished either through extending the WaveSurfer application with new custom plug-ins or by embedding WaveSurfer visualization components in other applications."
First impression, looks beautiful
Customizable - users can create their own configurations. Localization support. Extensible - new functionality can be added through a plugin architecture Embeddable - WaveSurfer can be used as a widget in custom applications Scriptable - hosts a built-in script interpreter
There are no plug-ins available
Plug-in supports AU Wavesurfer provides basic audio editing function, such as excision, copying, pasting, zero-crossing adjustment, and effects such as fading, normalization, echo, inversion, reversal, replacement with silence, and DC-removal.
Till now will be continued
Something to think about: The sample editor we need is a basic environment for VST or AU plug ins. The programs I've find till now are more complex. I will try to make a MSP environment where you can load fee ware plug ins. Is that worth a try?
Like I said - as long as a program can open WAV files that Watch That Sound tool creates and save them back to the same WAV with the same settings it should be OK. Next Monday I'll build a version that saves to WAV and release on the site. It will be available via an update on a mac.
I liked WaveSurfer, it supports customizations, so we could hide features we don't like. I just have to investigate if it supports external sound plugins like VST / AU.
Building a prototype sample editor in Max is OK, but how would you open a particular sample in it automatically?
MSP: If you have installed a plug in a patch it will stay there. The weak point is probably the plugin installing on every user computer. This weekend I will try to make a patch with a plug in and we will see what happens when We build it as an application for export.
I understand what you want to do with the plugin, but how will it open the wav?
with an application like Audacity or WaveSurfer I can right-click on a wav in Finder / Explorer and choose "Open with > Audacity". That means that I can also open a wav with such application from within WTS-tool. But is this possible with an MSP patch?
this is important: the filenames are confusing, we would want to be able to select a sample in WTS gui and open it in an external application.
Her I found some infas what a MSP?Max builld application does; Mac Platform Information for Standalone Applications Max builds universal binary standalone applications on the Mac. The standalone is an application package, which is also a folder that looks like a file in the Finder. Double-clicking on the file's icon launches the application. YourApplication.app [ note: the .app is not shown in the Finder ]
I guess the last sentence means it will not appears in the "Open with "
yes, that will open the patch you exported. That will not open a wav file.
I've tested WaveSurfer further, it has the same problem - it can't open files from finder, which means we can't open samples in it programmatically on OSX.
I also looked tested more of Audacity, there are some preferences that make exporting to original file a bit easier. Also, the latest version of Audacity remembers the folder and filename of the open wav file and export dialog starts with them. Just pressing Enter then selects to write to the original file. The only annoyance left is that Audacity then says "there is already a file with that name, overwrite?".
Also it is possible to change the key bindings im Audacity properties, so that Apple+S (Crtl+S on windows) calls "Export..." and not "Save".
The latest idea is to see how much work it is to build a custom version of audacity.
The simplest is to fork audacity's code repository, build it with alternative filename (e.g. AudacityWTS or something) and make sure it is selected as the default program for opening WAV files in the OS. The customizations:
Audacity build instructions mention that it requires wxwidgets 2.8.12, homebrew officially only provides 2.8.11. I will have to build my own or upgrade the homebrew recipe.
Further, homebrew recipe is 32-bit only, not sure if that's a problem for audacity.
The homebrew wxwidgets recipe was updated to 2.8.12, so I won't have to roll my own. I will have to build a 32-bit version of audacity if using it though.
The homebrew version of wxwidgets has no static libraries, which audacity wants. There is a topic on audacity forums describing how to build a compatible version of wxwidgets and audacity itself. I'll give it a try.
There is also a page on audacity wiki dedicated to developing on a mac.
building static debug version of the wxwidgets succeeds, using a modified version of the build script from audacity forum. Now audacity's build system complains about the Mac OS SDK 10.4. I've switched it to 10.5 (Leopard) which I have. Also switched the architecture to 32/64 bit intel. Only release targets were adjusting architecture, debug targets must be using default (build machine's native?).
apparently wxwidgets 2.8.12 aren't compatible with 64-bit architecture. So I will need to restrict audacity's build architecture to 32-bit.
I still have some problems building audacity, I asked about them on their forum. I'll try to disable the features that don't build now (we don't need them anyway).
I'm now trying to build audacity from within xcode. Since I'm not very familiar with Xcode, it is usually harder for me to reproduce builds then when using scripts. But at least I can fine-tune the build from the official build environment. I've found and fixed the problem with embedded libFlac build. The remaining problem is that Xcode now tries to link against incompatible versions of the libraries:
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libvorbis.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libogg.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libsndfile.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libportaudio.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Those are my normal 64bit libraries, why would Xcode want to use them when it just built the audacity-compatible 32-bit versions somewhere?
the culprit:
/Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk
"-L/Users/artm/src/WTS/audacity-wts/mac/build/Debug Static"
"-L/Users/artm/src/WTS/audacity-wts/mac/build/Debug Static"
"-F/Users/artm/src/WTS/audacity-wts/mac/build/Debug Static" -filelist
"/Users/artm/src/WTS/audacity-wts/mac/build/Audacity.build/Debug
Static/Audacity.build/Objects-normal/i386/Audacity.LinkFileList"
-mmacosx-version-min=10.5 -keep_private_externs -L/Users/artm/src/WTS/wxMac/lib
/Users/artm/src/WTS/wxMac/lib/libwx_macud_xrc-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwx_macud_qa-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwx_macud_html-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwx_macud_adv-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwx_macud_core-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwx_base_carbonud_xml-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwx_base_carbonud_net-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwx_base_carbonud-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwxregexud-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwxexpatd-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwxtiffd-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwxjpegd-2.8.a
/Users/artm/src/WTS/wxMac/lib/libwxpngd-2.8.a -framework OpenGL -framework
QuickTime -framework IOKit -framework Carbon -framework Cocoa -framework System
-framework WebKit -framework CoreAudio -framework CoreMIDI -framework AudioUnit
-framework AudioToolbox -lz -lpthread -liconv -lFLAC++ -lFLAC -lvorbis
-lportsmf -lid3tag -lmad -lnyquist -logg -lportmixer -lresample -lsndfile
-lsoundtouch -lFLAC++ -lFLAC -lportaudio -ltwolame -lvamp -lscorealign
-llibsbsms -lportmidi -prebind -o
"/Users/artm/src/WTS/audacity-wts/mac/build/Debug
Static/Audacity.app/Contents/MacOS/Audacity
it seems to prefer libraries in /Developer/SDKs/MacOSX10.5.sdk
over the ones in directories given by -L
. I'll have to figure out how to change its preferences.
Partial solution:
-Z
to "Other Linker Flags". This linker option removes standard library search paths from consideration./Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks
to "Framework Search Paths" so that it finds OpenGL (which is apparently referenced by some audacity's dependency). This ensures that /usr/local/lib
is not searched. Next problem:
Undefined symbols:
"_FLAC__ogg_encoder_aspect_set_defaults", referenced from:
_set_defaults_ in libFLAC.a(stream_encoder.o)
(...)
"_simple_ogg_page__get_at", referenced from:
_update_ogg_metadata_ in libFLAC.a(stream_encoder.o)
(...)
ld: symbol(s) not found
collect2: ld returned 1 exit status
(there are more undefined symbols there, but they all are about libFLAC / ogg.
I've solved the latter problem as well. Analysis: libFLAC wasn't building ogg support, which probably explains why ogg includes directory wasn't configured for libFLAC (I added it earlier to get the subproject to build). Since I can't find how to disable FLAC / ogg support at the moment, I just added flac<->ogg modules to the build system and everything builds and links and runs now.
Conclusion so far: we can build Audacity from latest sources (it even sais that the version is "2.0.0", while the last release was "1.3.4").
Next question: how easy is it to disable some functionality (like extra formats support) and modify another (like it asking to overwrite modified wav-file).
Today I'm simplifying "Export" function of Audacity. The checklist:
It still asks to save the project when closing the file.
Also could be useful to hide the window on save so control goes back to the WTS tool (needs confirmation and field testing).
apparently there is a special mode in audacity called "CleanSpeech" which has similar functionality to what we want:
From Other features:
CleanSpeech mode provides a simplified interface for some standard adjustments typically made on speech recordings. You can access these features in the Interface Preferences.
From the code comments:
CleanSpeechMode tries hard to ignore project files and just work with .Wav, so does an export on a save.
but turning it on is hidden in current version of Audacity (from Changes in Audacity 1.3.14):
CleanSpeech Mode removed from Interface Preferences (it still runs if it was enabled in a previous Audacity but can only be turned off there).
I'll have a look if I can reenable it back.
Ok, I had a look on CleanSpeech and it's not exactly what we want and according to the forum:
CleanSpeach has been removed by the developers as it causes far too many problems
The customized audacity does what I wanted - Apple+S exports wav under its original name, quitting doesn't ask to save exported project. Later I can disable more functionality irrelevant for the workshops, but for now this is OK.
Current approach is to use external editor - e.g. audacity. To keep that part simpler we'll attempt to build a custom version of Audacity with advanced features removed or carefully hidden.