About Andrew Choi
MIDI File Player (External Device)
Cocoa Sample Programs
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.
I wrote some code to handle selection of one of more bars in the chord editor. To select a bar, click anywhere on its notation (the slashes). Clicking on one of the chord names will of course select the chord for editing.
To select a number of bars, click on the notation of the starting (or ending) bar and drag and release the mouse in the ending (or starting) bar.
The scroll view will auto-scroll if necessary if the mouse is dragged outside the window. This is such a nice Cocoa feature enabled by a single line of code! The focus ring can have a variety of shapes and is interesting to program.
The Cocoa undo manager turns out not to be too difficult to learn. I skimmed its documentation, then the articles whose links I posted yesterday, and then I carefully read its documentation from beginning to end. The problem with articles on the Web is sometimes their authors can be too fixated on their solutions of specialized problems. The quality and generality of these solutions can also be questionable sometimes.
[textView shouldChangeTextInRange:... replacementString:...]; [[textView textStorage] replaceCharactersInRange:... withString:...]; [textView didChangeText];for undo and redo to work correctly. Heres a new version of FCBlogEditor that includes this and other small changes I have made since it was last posted.
There is also a well-known problem with using
I implemented an
eb7 Cmd-→ dm6 Cmd-→ eb7 Cmd-→ dm6 Cmd-→ eb7 Cmd-→ dm6 Cmd-→ em7b5 Opt-→ a7b5 F5 ↓ Opt-→ dm6 Cmd-→
Notice that the formatter will automatically capitalize the chord keys (of course one may also enter the capital letters). It will also turn the letter b and the hash mark # at suitable locations into a flat and sharp, respectively. Note also that the command right arrow key jumps to the first chord of the next bar and the option right arrow key jumps to the chord at the next half note. Of course you can instead hit the tab key or right arrow key a number of times to get where you want. Text completion is used to enter the A7♭5♭9 chord. Whats also interesting is the FMaj7 and DmMaj7 chords can be typed as
My next step is to implement cut, copy, and paste using the mouse. Ill be using a bar as the smallest unit on which the program will operate. This is similar to Finales mass mover and mass edit tools. First I have to learn about the
I wrote some code to allow the user to navigate within a chord chart in the chord editor using the arrow keys. The left and right arrow keys move to the previous and next beats, respectively. So do the tab and shift-tab keys (to be consistent with Cocoas selection of text fields). Option left and right arrow keys move to the next half note. Command left and right arrow keys move to the beginning of the previous and next bar, respectively.
Less-Known Facts About Emacs
Less-Known Facts About Emacs
|Copyright © 2003, 2004, 2005 Andrew Choi (Contact Information).||Created with FCBlog|