My OS X Programming Blog
Mac OS X Cocoa and CoreMIDI Programming
About Andrew Choi


MIDI Programs

MIDI File Player (External Device)

MIDI Destination Pop-Up Button

MIDI File Player (Internal Synth)

MusicSequence Sample Code

MIDI File Writer

MIDI Name Document Parser

NameConfigSetup

Fish Creek MIDI Framework

MidnamUtility

SysExSenderX

Other Programs

FCBlogEditor

FCBlog and Patch

Chinese Checkers Program

jyut6 ping3 Cantonese Input Method

Cocoa Sample Programs

Syntax Coloring Using Flex

NSTextField and Undo

NSToolbar

Implementing File Import

Launch Application and Open URL

Saving Uncommitted Text Field Edits

Algorithms

Jazz Chord Analysis as Optimization

Optimal Line Breaking for Music

Optimal Chord Spacing

   

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.

Getting Patch Names in CoreMIDI
Monday December 15, 2003

Now that I have written MidnamUtility to generate .midnam files and NameConfigSetup to edit the CoreMIDI name configuration, I’m all set to use patch names in my MIDI applications! Today’s test program PatchNameTest lists the patch names in each patch bank of each external device. It honors overriding name documents if they are assigned and uses the chosen patch name lists in them instead of the overridden ones in the master name document.

I assume no one is using FCBlog, since I haven’t received any feedback. But there is a bug which will manifest itself in January. I all of a sudden realize it’s there today :-). The following patch fixes it.

--- main.m.orig Mon Dec 15 21:46:38 2003
+++ main.m      Mon Dec 15 08:38:12 2003
@@ -30,7 +30,8 @@
   /* Note that date parameter is always a Sunday.  */
   NSCalendarDate *d = date;
   int month = [d monthOfYear];
-  while ([d monthOfYear] >= month)
+  int year = [d yearOfCommonEra];
+  while ([d monthOfYear] >= month && [d yearOfCommonEra] == year)
     d = [d dateByAddingYears:0 months:0 days:-7 hours:0 minutes:0 seconds:0];
   /* Use this value when the search fails */
   previousMonth = [d descriptionWithCalendarFormat:@"%b"];

December 2003
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Nov  Jan

xml

Search this blog with


Lists

Less-Known Facts About Emacs

Emacs Rants

Chinese Restaurants in Calgary

Calgary/Banff Tourist Attractions

C++ Reading List

Science Fiction Series

Top-10 Reason I Stopped Working on Emacs

Top-10 Types of Questions I Get About Emacs

10 Defining Moments as Programmer


Misc

Carbon XEmacs

Emacs for Mac OS X


Copyright © 2003, 2004, 2005 Andrew Choi (Contact Information). Created with FCBlog