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.

Bass Line Embellishments
Thursday April 8, 2004

It turns out to be quite simple to write the code to embellish the bass lines by “doubling” some notes. Here’s an accompaniment generated by the program for All the Things You Are. The input file was one in Band-in-a-Box format obtained from the Web. The drums now also end a little more nicely.

Comping on Drums
Wednesday April 7, 2004

The choice of a representation for drum tracks is an interesting problem. Since the algorithm that generates drum tracks manipulates patterns, the RhythmicPattern class, introduced while piano comping was implemented, naturally becomes the representation for the basic units of a drum track. Recall that a RhythmicPattern object is like a sequence, except it contains only a list of beats and durations but not the values of the “events” (MIDI note, chord, scale, etc.). In other words, it is logically equivalent to sequence<void>. The times and durations to play the notes on each drum instrument for the entire tune is contained in a sequence<RhythmicPattern> object. A drum track is a collection of sequence<RhythmicPattern> objects (one for ride cymbal, one for hi hat, etc.). Now that I’ve done implementing all this, I appreciate the power and flexibility of the STL more than ever. It certainly is very satisfying to use.

Here’re a few choruses of Blues for Alice generated by the new version of the program with the new drum comping simulation. Enjoy!

Chord Voicings
Monday April 5, 2004

I wrote some code today to generate the “position I/II” and “variation I/II” chord voicings from the book An Introduction to Jazz Chord Voicing for Keyboard by Bill Boyd. The accompaniment generation program now chooses among the different voicings for each chord to avoid big leaps in the voice leading. Here’s an example of an accompaniment generated using only variation I and II voicings. Notice that the notes in this sequence are still quantized (no “humanization”) and variations in note dynamics have not been introduced.

My next step will be to generate the drums. I read this article and this other article on jazz drumming. As in simulating piano comping, the challenge seems to be devising a good algorithm to choose the pattern used for each bar. Programmatically, drum sequences also require a slightly different data structure to represent (each instrument in the drum set should be contained in a different “track”) so a small bit of design work will be necessary.

April 2004
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
Mar  May

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