Tuesday, December 25, 2007

Not The Best Christmas Present

Like many people around the world, yesterday was spent with family and friends gift giving and much to much eating (the fried rice and turkey was fantastic).

Last night though I received an unexpected gift, from windows - a corrupted hard disk. Oh what a joyous event, a little drive that could was now a little drive that couldn't. Well by little I actually mean 500Gig. So after a few attempts at booting windows, Last Known Good, Safe Mode, Safe Mode Command Prompt etc, I then attempted a restore and low and behold the windows recovery option couldn't recognize the installation. Enough to drive your sanity to the limits.

I attempted to use a Recovery CD - Linux based and while I could use one tool to see the files in the drive still - or at least a listing, that was about it. GParted realised the disk was corrupt and instead recommended chdsk be run before trying to use GParted again. So cutting an unexciting story short, 16hours latter and chkdsk is still running. It's found a whole heap of problems and is still cracking along, slowly.

But here is the real lesson in the story (not the usual back up your stuff one) - avoid hibernate / sleep / standby in windows. Before the crash I had been copying files between two local drives, it had then gone in to standby - when I returned to the PC it was reporting a CRC error in the copy. My first though was a stuffed disk but since watching chkdsk I am thinking again - most of the corruption relates to files which were being copied, the point where windows was crashing relating to the disks or acpi. At the moment it's still a hunch but this MS knowledge base article isn't very reassuring Hard disk may become corrupted when entering standby or hibernation or when writing a memory dump

Any way heres hoping for a happy ending. I think I have at least another 8 hours of disk checking before I'll know the results. After that I'll be avoiding sleep / hibernation and standby, but thats just me.

Hope your technology this Christmas works better for you than it has me ;-)

Saturday, December 22, 2007

Open Source Audio on Windows with OpenAl.Net and Tao.OpenAl

I for some reason have a passion for Open Source Audio on Windows. I've got no idea why I don't just cross over and use Linux and its already fantastic collection of Audio programs (Hydrogen - an advanced drum machine, Rosegarden - Composition tool with MIDI support, Ardour - professional audio editing, multi-track audio mixing etc.) but for some reason I just enjoy C# and the IDE so I'm not moving, at least for the time being ;-)

Any way to get going with Open Source audio libraries in the .Net world there are a few good choices - so far I've used SDL.Net and OpenAl.Net (With Tao.OpenAl - it's a dependency for OpenAl.Net and Tao.SDL - it's a dependency for SDL.Net) and have had really good results.

Currently OpenSebJ - vScaleNotes, the high quality audio, fully sampled, virtual instrument tool, utalises SDL.Net for all of the sample playback and it will soon be using OpenAl.Net for all of the stream to disk recording.

I'm starting down the path of migrating OpenSebJ to Open Source only dependencies, currently OpenSebJ still requires the Managed DirectX libraries to function and as I've spoke of previously, accessibility is a serious issue here - that and the fact that Microsoft aren't further developing the MDX libraries. So a serious port is needed here, hopefully my object encapsulation is going to make this fairly easy ;-) Although I know some functions won't be supported going forward.

The fun part about using these libraries is making sure that you can package all of the dependencies in a single installer and make it really easy for people to use, rather than requiring a separate installation - some times though, the documentation can be a little lacking. So here's a little documentation for those looking for the requirements:

OpenAl.Net
OpenAl.Net requires the Tao.OpenAl framework; the Tao.OpenAl framework does the leg work interop'ing with the OpenAl DLL's.

To use OpenAl.Net in your project:
  1. Add a dependency linking to OpenAl.Net
  2. OpenAl.Net has a dependency to Tao.OpenAL but if you load Tao.OpenAl into your project make sure it is linked properly
  3. Make sure the OpenAl DLL's are accessible, for instance in the output directory. You need alut.dll , OpenAL32.dll & wrap_oal.dll - if you don't have all 3, like if you only have alut.dll you will get an error message from the compiler saying that it can't find alut.dll - you need the other ones even though the compiler error message is wrong - I hate that, any way that's why I'm writing this ;-)
  4. So in your directory with your program you should have alut.dll , OpenAL32.dll , wrap_oal.dll , OpenALDotNet.dll , Tao.OpenAl.dll , AdvanceMath.dll , csogg.dll , csvorbis.dll

SDL.Net

Similar to OpenAL.Net SDL.Net needs Tao.SDL to do the leg work with the underlying SDL DLL's. SDL.Net is fairly similar to setup but doesn't have audio recording support.

To use it in your project:
  1. Add a reference to SDL.Net
  2. SDL.Net has a dependency to Tao.SDL but if you load Tao.SDL into your project make sure it is linked properly
  3. Make sure the SDL DLL's are available - you need a copy of SDL.dll , SDL_gfx.dll , SDL_mixer.dll - just throw them in the output directory if you don't care about locations ;-)
  4. Now in the output directory you should have SDL.dll , SDL_gfx.dll , SDL_mixer.dll, SdlDotNet.dll & Tao.Sdl.dll

The really cool thing is that all of these files can be bundled in the installer. Keep a copy of the original sources, as per the GPL and make sure they are included or accessible. Too easy, well once you know the score any way.

Happy Open Source Audio Programing ;-)

64 Bit Windows with C# Express .Net and 32 Bit DLL's

An architecture change is always welcome and the 64 Bit world presents new and options for memory management and the like but there is certainly a price to pay for this shift. So far my personal experience with the 64 bit world has been one of mixed emotions, many hours of things not working, spending time researching on the net and looking for obtuse answers that sort of solve our problems.

The latest one is trying to develop using C# Express 2008 on Windows XP 64 Bit Edition and then using interoperability with a 32 Bit DLL - OpenAl. For some reason the compiler doesn't realise that the 32 Bit DLL is just that, 32 Bits. By default any .Net application developed will target the platform called "Any CPU" as opposed to a specific architecture. This is cool if your not using native DLL's but is a bit of a pain when you do. You will know that you are getting this problem when you start seeing System.BadImageFormatException popping up. It means that your application is trying to cross the Bit boundary - apparently our gracious OS is a separatist?

Any way there seems to be a saving grace, you can do development on a 64 Bit OS and set C# Express to specifically target your application to x86, it's just not obvious. Targeting x86 will mean that your application will still run on a 64 Bit OS but will use WoW (Windows on Windows, which is a compatibility layer to backwards support 32 Bit applications) so you won't get the native use of those 64 Bit Int's but you will be able to use your 32 Bit DLL's.

To setup your application to do this you need to
  1. G in to the menu option Tools>Options and the in the dialog box tick the box in the bottom right corner to "Show all settings"
  2. Once the settings expand go to "Projects and Settings" expand it and click on "General"
  3. Check the option which is called "Show advanced build configurations", then close the dialog box
  4. Now if you right click on the solution explorer, chose properties
  5. Goto "Configuration Properties", now you should be able to see the platform drop down. This will probably have only "Any CPU" selected; if so click on "Configuration Manager"
  6. Chose the option "New" under the "Active Solution Platform" drop down box
  7. Chose the new platform of x86 and copy your settings from "Any CPU"
  8. Then just make sure that your projects in your solution refer to x86 as the platform rather that "Any CPU"
Done.

Saturday, November 03, 2007

Frameworks & Accessibility

There's something relaxing about a well formed framework, whether it be a clean simple design, a stylish approach to a new problem being solved, the thought process that went in to its production or the functionality it delivers - what ever the case is something attractive and strangely sensual about good design.

Having a strong and simple foundation is important when introducing new people to a team, or a product to an audience and taking this in to account at the start of a project helps present options for future growth.

I've been spending some time building a new framework for OpenSebJ; to be used in both the Mixing and vScaleNotes products. I wanted something that would provide a new forging ground and one that could be easily modified and built upon over time, there were some great lessons learned from the OpenSebJ releases so far and a key one is accessibility.

It relates to User Interface Design, Application Prerequisites and well formed Frameworks. If the UI is to hard to come to grips with then its not an accessible product for people. If the Application Prerequisites are too much then you immediately reduce your potential install base; unless you can bundle it all in and package it up in the installer - this can be a bit of an issue if your trying to mix incompatible licenses. These issues prevent people accessing and using the product, a similar risk is also present for additional developers. It's important to cultivate the development community and as such it's a great idea to have the lowest barrier to entry for future changes and modifications, which can be facilitated through a well formed accessible framework.

Theres also something strangely relaxing about building them..

Saturday, October 13, 2007

Delegates in C#

So you instantiate a person and have a baby class, lets call it aBaby. Now your instance aBaby will occasionally (or regularly) need its diaper changed, so on intervals you check to see if it's dirty but wouldn't it be better for the baby to actually tell you that its nappy needs to be changed?

In an introduction to object oriented programing you would have learned how to create an instance of a class, call its methods and have data returned from the methods. But having the instance send data back to the class that created the instance on intervals or events is a little more tricky. If you see this scenario or design pattern then you need something like Delegates in C#, sure you could probably use a static class and throw data in to a variable that every other class can access - but wheres the class in that, not to mention the disastrous love you experience when you start running multiple threads.

Any way check out the video in the link - brilliant and simple introduction in to the delegates concept and one I'll be putting in place shortly.

Cheers,
Sebastian

Thursday, September 06, 2007

vScaleNotes Finaly Released

Sporting a full complement of Grand Piano Audio Samples, this high fidelity release brings the orchestra sound to a PC near you. Although Alpha and highly unpolished or finished this release lives the Open Source mantra of release early - even if it misses the release often bit - the important thing is that its out there and ready for your composing pleaser and kind words of encouragement (or give me some stick if you so please). Any way it mostly works, Sharp keys haven't been mapped to the keyboard and you can't change the layout yet but the piano is playing.
Feedback please.

-Sebastian

Interview on Laptop Rockers

Laptop Rockers helped celebrate the OpenSebJ download success, breaking 110K downloads, in an interview this week. Covering such topics as my nick names to choices in licensing and sporting a very fashionable photo this is worth a read if your looking in to a little more insight or background in to OpenSebJ - The Open Source, GPL, Audio Music Mixing program and the drivers behind its writing and release.

-Sebastian

Crystal Castles

If you have not had this pleasurable assault reach your ears yet, then I regret to inform you that you may have been missing out on the coolest new 8 bit sound in years. Alice and her practicing may have brought her an eye that she could show in the most depressing circumstances yet these two bring the sound that I have been yearning for all of these years. Crystal Castles, - Ethin and Alice, are an amazing line up and I can only hope that they thrash out in the land of OZ some time soon and release a CD without a limited number available. Perhaps some one could convince them to do a mix with OpenSebJ? Please.

-Sebastian

Wednesday, July 18, 2007

> 100K Downloads

OpenSebJ has now surpassed 100,000 downloads. It's a little moment in the projects history and a momentous occasion for all involved.

Thanks to every one who has contributed to the project, through code, example compositions, feature suggestions, requests, comments, criticisms and moral support. It has been a fantastic journey thus far and we look forward to the continuing experience.

The OpenSebJ team.

Saturday, May 05, 2007

Shout out to other Windows Open Source Audio Projects

OpenSebJ is powering on; with an ever increasing rate of downloads - over 10,000 last month - bringing the total so far to 79,693 (I would have written this latter in the week when it passed 80,000 but I couldn't wait :-)

I have been looking around at the other Open Source audio programs yesterday and then couldn't re-find them all easily this morning; so let me share with you some of the tools I have found and know of so far (All Free Open Source Software (FOSS) with a working Windows Port):

[Obviously my opinions of these programs are just, my opinions]

Audacity: http://audacity.sourceforge.net
The best FOSS wave/sample editor. If you want to change any pre-recorded audio this is the tool to use. It has heaps of downloadable effects, can convert, read and write in almost any format (wav, ogg, snd, mp3, etc) and is easy to use.

VioLet Composer: http://sourceforge.net/projects/buzz-like
It's like Buzz but FOSS. Allowing for programmable plug-ins; with the ability to daisy chain events together, mix channels and all bundled in with a Tracker style sequencer. If your looking for a creative outlet for synthesis

Denemo - (A front end to Lilypond) : http://sourceforge.net/projects/denemo/
Lilypond is a score printing tool but Denemo is much more than just that. It allows for scores to be composed completely from scratch in the traditional sense - these scores are exportable out in the MIDI format; although I wasn't able to get the windows port playing the score I composed directly (but I didn't spend any time trying to get it working either ;-) as the MIDI export worked flawlessly. If you want a musical score editor & composer; start right here.

Canorous: https://canorus.berlios.de/wiki/index.php/Main_Page
Another score editing tool. Its interface is clean and playing the notes entered on the score works as expected. I did have a few issues (a couple of crashes) while trying to get this going but this is defiantly another tool to keep an eye on.

BestPractice (Time stretching tool): http://www.xs4all.nl/~mp2004/bp/
The biggest honor to bestow is that the tool does what it says it will and this one does. To boot, it also includes a Kareoke option, Semitone adjustment, etc. Nice little tool. It doesn't contain a way of capturing the audio output, so use Audactiy and capture it through the sound card instead.

If you know of more that should be here; drop me a line and let me know about them.

Cheers,
Sebastian

Friday, March 23, 2007

OpenSebJ - vScaleNotes - Capability Demonstration

OpenSebJ is continuing on the up & up - with over 65,000 downloads under the belt; advanced audio and video mixing capabilities, a new track editor for even stronger pre-production composition coupled with continued and extending support for real time sample mixing; all touched up and packaged within a new Professional interface. OpenSebJ is positioned as a real contender for all your music mixing, audio composition and real time audio performance needs.

Continuing in this vein OpenSebJ is branching out in to a new, uncharted frontier, fully sampled virtual instruments; this new branch of capability is packaged together and called OpenSebJ - vScaleNotes. It features a range of new capabilities at the center of it's core, one of the most prominent is the Additive Sample Technology.

The new Additive Sample Technology is powered by an advanced SDL.net audio engine; which bridges many gaps, previously only available to highly complicated customised solutions. The Open Source nature of the SDL project allows these features to be capitalized on and brought to the complete populous, rather than the select few - who were prepared to pay the high price tag for the privilege.

Standard and simpler sample based audio engines can only make use of a binary based approach to playing audio; the sample is either playing or it's not. If the sample is to be re-triggered the sound is first stopped and then played again; this can lead to highly audible and distracting clicks and pops in the resulting composition. This removes the flow and reality from the produced sound and is an undesirable situation. See an example of this in the following; Figure 1.


Figure 1; The section within the red boundary highlights the flat point in the audio, as a result of the sample being replayed.


The Additive Sample Technology difference; is that when the same sample is re-triggered, it is done so in a new instance - a new channel is allocated and the sample is played. This removes the possibility of flat lines in the audio as a result of re-triggering a note or a key. See the following example, Figure 2, for a comparative view.


Figure 2; The highlighted section within the black boundary shows that when an audio sample is re-triggered it is done in an additive fashion rather than a strict binary, on or off nature. Due to this OpenSebJ - vScaleNotes, sounds extremely realistic and reminiscently of the original instrument.

vScaleNotes is a collection of Fully Sampled Virtual Instruments based on a full set of real instrument samples to reproduce the harmonics and intricacies of the original instrument; without the need for the original instrument or the understanding of the techniques required to correctly play the associated notes. The technique component may not be as critical to play a single note on a piano but it is certainly a contributing factor for string and wind based instruments.

Sample based virtual instruments also provide possibilities for combinations of notes to be played, which normally aren't capable of being played on a single real instrument (probably possible for multiple instrument harmonics etc.)

vScaleNotes makes extensive use of the previously developed OpenSebJ technology base & draws upon the vast experience of the OpenSebJ team; to deliver a real time, high quality performance grade system based upon solid foundations and a proven technology subsystem.

The samples used for vScaleNotes have been sourced from the University of Iowa's Electronic Music Studios, without their generous contribution of high quality musical instrument samples to the public domain, vScaleNotes would only be a shell of capability. These high quality samples total over 3 Gigabytes in size; the proportion of which will be available in vScaleNotes. To make the most effective use of these samples vScaleNotes will redistribute these in the high quality, audiophile approved, Ogg Vorbis format.

OpenSebJ - vScaleNotes is currently in pre-Alpha testing and as such a downloadable version is not currently available; however alpha & beta testers are being sought. All interested parties should fill out the contact form, stating reasons for interest and any relevant past experience.

Even though it is currently in a pre-Alpha state, OpenSebJ - vScaleNotes, still has full support for a Virtual Piano complement; listen to a sample of a live recording, demonstrating the quality and features available in OpenSebJ - vScaleNotes.

Audio Capability Demonstration:
OpenSebJ - vScaleNotes - Piano.mp3

Notes played in the following order C2 - C6, D6 - D2, E2 - E6, F6 - F2, G2 -G6, A6 - A2, B2 - B6

Regards,
The OpenSebJ Team