While cleaning up my laptop’s hard drive I found an update to the audio editor I posted here last year. Not radically different, but maybe useful to someone.
Its new feature is the loop function. Toggle the loop button and playback loops between the start marker (S) and the end marker (E). Just like you’d expect.
Next to this single new feature there’s a new waveform display that I really like.
In the old version the waveform shape was rendered by drawing vertical lines next to each other for each pixel from left to right. The new version draws a much nicer vector shape that is less processor intensive as well.
The Flash app
Download the ActionScript source code and files for this project here.
What happens is that for each pixel the maximum and minimum sample value is polled. Those values are stored in two arrays. Then the array of maximums is used to draw the top half of the waveform and the array of minimums for the bottom half. Together the two halves form a filled shape.
Like in the earlier waveform display the render method changes when zoomed in. If the zoom level is high enough (when one pixel represents less than forty samples) the filled shape is replaced by a single line. I find a single line easier for close inspection of an audio signal and most audio editors work like this.
The mouse interaction remains the same as well: Click on the waveform and drag up or down to zoom and left or right to move, and even both at the same time! I still like this behaviour a lot. First saw it in Steinberg WaveLab.
A note: This waveform display works well for audio files of a minute or less in length. The longer the file the less precise the waveform gets. This is because a fixed number of samples is polled for each pixel. If the file is long one pixel represents a lot of audio, and if it’s polled at too large intervals the polling results get less and less precise. I didn’t increase the number of polls because I found that slows down the screen redraws too much.
The audio in this example is Untitled Locked Groove #3 by Snd which appeared on their Systems Medley / Planets 7” from 2000 on City Centre Offices. I listen to their records a lot. Good programming music as well. :-)
@Pneti: Thanks very much!
The project was made in FDT but shouldn’t be too difficult to get to compile in Flash Builder: Start a new Actionscript project, Put all Actionscript files in the source folder, link the libraries and create a run or debug configuration. There’s lots of information online about setting up projects in Flash Builder / FDT / Eclipse (they all work mostly the same). Also, it might help to open the included launch file in a text editor. It contains most settings for the project. I hope it will work for you.
This is awesome piece of work. I loved it. I am a new bee to this world of actionscript. I am struggling to set up the downloaded source in flash builder in order to understand some pieces of code you have written. Could you please help me in setting up the ide so that I can debug throught your source. Once again, gr8 work and Thanks.
Regards,
Pnethi
I certainly don’t want to be more of a pest than I am by posting. . . I set the document class (to com.hisschemoller.App to match the folder structure), and added the one SWC (assets.swc) to the library path, and now the only error I get when I try to preview in Flash is: …\audio_editor_v1_1\flash\classes\com\hisschemoller\utils\audio\processors\IAudioInstrument.as, Line 25 1046: Type was not found or was not a compile-time constant: SampleVO.
I don’t want to bother you, but I am certainly interested in getting a working version running out of Flash (CS3, CS4, or CS5). Thank you for your assistance thus far, and any help you may have for me in the future.
@Bryan: Yes there might be more. I made this project in FDT, not the Adobe Flash IDE. As far as I know it should be possible to compile the SWF from Flash if you set com.hisschemoller.sequencer.App as the document class and add the SWC files in the libs folder to the library path. But it’s such a long time ago that I worked on a project in Flash that I might be missing something. Have you tried these things already? And compile for Flash player 10 of course.
Is there more I need to know?
I have downloaded both 1.0 and 1.1 zip files. . . open them in CS5 on the PC, and try to Preview / Publish. . .
@Miriam: Thanks! I sent you an email.
@Loop: Thanks, sent you an email too.
@Oskar: And thanks to you as well! Feel free to recommend me to the Nobel committee :-)
Wow. Just wow.
I just wanted to let you know that I think this is brilliant and that I am definitely subscribing to your RSS feed. The fact that you share your source makes me want to give you a nobel price.
Hi, like the look of this.
Would you get in touch about making me a player. possibly using jquery / flash / whatever you think might be best. I can give you the details in an email.
Hi Wouter, thank you for sharing your great work!
Lately I ended up on your page while searching for a simple way to create a single line waveform out of an audio track. I downloaded your source code and “messed” around with it – without much success. Since I am still new to AS3 I couldn’t figure out your system so far. Thus … I would greatly appreciate your help in how to extract the code I need out of your source (in case you’ve got any nerve for that kind of request at all – if so, I could send you the code I’ve got so far)
Cheers, Miriam