Tuesday, February 12, 2008

FLTK2: Win, Lin & Mac

Here are screenshots of my program, compiled for three popular platforms. The program makes amusing patterns, calculated by formula, which can be passed to application at run-time. Program is written in C++ with FLTK2 GUI library. Here is the link: www.fltk.org. FLTK (new version is FLTK2) is small in size, has good internal design, ported to different platforms. It also shows very good performance. Widget drawing is fast, because it's performing by means of native system API for each platform: - WinAPI/Xlib/Carbon.

Screenshots:

Linux:

Mac OS X:

Windows:



Second version of the library - FLTK2 - is in development state, actually. But, you can use it. Version for Mac is buggy yet (it's alpha) - you can see a button with corrupted size at screenshot. But, while moving from FLTK to FLTK2 I've discovered that most inconvenient features has been changed exactly like I desired =) So, FLTK2 is cool.

Sunday, February 10, 2008

All we need is Music!

So. If we need to play music in real-time, to make your own genius software synthesizer sound using your keyboard, midi-keyboard, midi-didgeridoo, theremin, or ruler with a pick-up and ltp-port connection, we can't treat this with general tools.

We need a very small delay time, i.e. low latency.

In Linux we have Jack system for this purpose. And it's amazing. You can get something like 1.33 milliseconds with common build-in sound card. And it's simple to implement.

Those who don't like Linux, will use Windows.
And at Windows we have to use Steinberg's ASIO specification.

(We can also use PortAudio, but it seems not to support Jack fully for now.)


I've tried to build a standart sample from ASIO SDK. With GCC + MinGW. It even compiles =). And runs. But then it hangs.

GCC + MS Platform SDK. Hangs.
MSVC + MS Platform SDK. Works.

What I've found out: ASIO driver can work only with programs, built by MSVC, because it uses MSVC calls specification ("thiscall" for C++). Other compilers use their own implementation, so those binaries are incompatible.

Portaudio, which supports ASIO, uses a special workaround.
It's a wrapper, which imitates MSVC thiscalls for ASIO: http://www.audiomulch.com/~rossb/code/calliasio/. It's written mostly in asm.

I'm in doubt, if this wrapper will update in time, and if it suppors x86_64 architecture. So, better we don't deal with assembler. Better compile it with MSVC.


By the way - it's well-known issue with C++ for Win. Binary interface (ABI) for C is open, so pure C libraries can be linked with any code.

Microsoft's C++ ABI is proprietary. So, you have to compile your applications with MSVC, to link useful third-party libraries.

Wednesday, January 9, 2008

Multilingual blog?: initial

So, for now blogger doesn't have any convenient feature for different languages support. This blog contains messages from http://highcat-land.blogspot.com which I decided to translate to English. If you find any grammatical mistakes in it, pls tell me. ;)