|
About Andrew Choi
MIDI Programs
MIDI File Player (External Device)
MIDI Destination Pop-Up Button
Other Programs Cocoa Sample Programs Syntax Coloring Using Flex Algorithms Jazz Chord Analysis as Optimization
|
A blog where I will write mostly about programming in Cocoa and CoreMIDI, and experiences from my ports of Emacs and XEmacs to the Mac OS.
Its been an interesting day of work: Ive translated Kagis reference ACG written in Perl into a functionally equivalent version in (ANSI) C++. Heres my comment at the beginning of the file: ACG_XXA_cppreference.cpp - translated into C++ from ACG_Package/Code_N_Scripts/Perl/ACG_XXA_reference.pl in Kagi's SDK. This CGI is an *exact* functional replacement for Kagi's original Perl script with the following exceptions: (1) a ACG:OemApprovalCode of "no" is returned instead of "yes" for an invalide ACG:UserPurchaseDate, and (2) the formatting of ACG:ResultCodeMessage is different (the leading ", " is removed) in checkForInputBufferUnderFlow and checkForInputBufferOverFlow. I believe both of these are bugs in the Perl script.It passes all 109 tests in the muster test suite of the SDK, producing exactly the same output as the Perl script except as noted above. This program is a translation of a Kagi script and not an original work. As such I do not claim its copyright. Its just a few hundred lines of code, so lets just leave it at that. If Kagi should see this and feel that I should not post it (although I cant imagine why), Ill gladly remove it :-). I need an ACG written in C++ because Ill be integrating my own active code generation algorithm into it, which will be written in C++. Itll be much easier to send a single executable file to Kagi instead of a Perl script and the external routines it calls. Using C++ (instead of say Objective-C) also allows the ACG to be hosted on platforms other than Mac OS X. Writing the C++ version is also a good way to learn about the ACG specifications. Its also interesting to note that C++, when used suitably, is a great language for implementing CGIs (and in fact any kind of scripts in general). Contrary to popular belief, C++ can be a very high-level language! My C++ version is therefore just as easy, if not easier, to read and uses about the same number of lines compared to the Perl version. If you dont believe me, read the two versions side-by-side and see for yourself!
Ive looked at some of the C/C++ libraries for implementing CGIs listed on the CGI Resource page. None of them is very useful. CGI-LIB and gDecoder are C (and not C++) libraries. GNU Cgicc did not build under OS X. It also doesnt seem to be actively maintained. The most useful examples turned out to be some NCSA sample programs. Unfortunately these are written in C. Ive converted the code
Herere some considerations that may go into using Kagi as ones e-Commerce service provider.
Ive finished reading their ACG specifications and Ill be thinking about writing one. Since an ACG is really just a CGI, Im looking at libraries for writing CGIs. Since my encryption code is in C, Ill probably be writing my CGI in C or C++. Heres a list of libraries for writing CGIs in C/C++ Im looking at.
Spent most of the day reading documentation from e-Commerce service providers. People on the Cocoa programming mailing lists seem to recommend Kagi and eSellerate. So Im mainly looking at them. I believe I now have to rethink my scheme for generating keys/registration codes since it must tie into the Kagis or eSellerates method of handling purchases. The simplest option seems to be to use registration code generation/verification algorithms they provide. But then I must trust how secure their scheme is. For a low-cost shareware (which mine will be) this probably doesnt matter very much. And I can save a lot of effort in designing and implementing my own scheme. If I want to use my own registration code generation algorithm, the only (secure) option seems to be to run my own server to handle requests from the e-Commerce service provider. Only Kagi supports this method though.
I worked on a number of small features/improvements to my program today: made the minimum bar widths proportional to the size of the font selected for chords and meter of the song, added a New Document command for creating 3/4-time untitled documents, and added two count-off bars to generated accompaniments and handled the visual feedback of the current bar during playback correctly. Heres a screen shot showing some of these new additions.
More importantly, the implementation of my automatic accompaniment generation program is essentially complete!! The only programming left is a software protection/registration scheme. I did some reading on this topic back in January. Ill spend the next few weeks to work on this. Then Ill be working on artwork, manual, tutorial, and promotional material.
|
Lists
Less-Known Facts About Emacs
Chinese Restaurants in Calgary
Calgary/Banff Tourist Attractions
Top-10 Reason I Stopped Working on Emacs
Misc
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright © 2003, 2004, 2005 Andrew Choi (Contact Information). | Created with FCBlog |