Fun with Lisp: Just Intonation and Microtonality

Submitted by Bill St. Clair on Tue, 24 Jan 2012 14:33:32 GMT  <== Lisp ==> 

Andy Hefner gives some examples of just intonation and microtonality using his Lisp Mixalot library. Cool.

Add comment Edit post Add post

KeyRemap4MacBook

Submitted by Bill St. Clair on Tue, 16 Aug 2011 03:50:01 GMT  <== Lisp ==> 

I spend most of my days in Emacs, writing Lisp. So I use the "control" and "meta" keys all the time. I map meta to the Mac "command" key with a setting in my "~/.emacs" file:

  (setq mac-command-modifier 'meta
        mac-option-modifier nil)
My new Apple wireless keyboard has a "fn" key in the lower left-hand corner of the keyboard, with the "control" key next to it. Most distressing, since my left pinky is accustomed to finding the "control" key in the lower left-hand corner. I knew this before I got this keyboard, and would have gotten the wired keyboard with the numeric keypad had I not had a solution in mind. Enter KeyRemap4MacBook, a System Preferences panel that allows you to remap just about any key to just about any other key. It has a setting that maps "fn" to "control" only when a letter is pressed. This allows "fn" to be used normally on the top row of keys, but makes it function fine as emacs "control" when you need it. Almost. The one problem with the built-in key mapping is that it doesn't map <fn>-space to <control>-space. I type that pretty often, and moving my pinky over to the "control" key to do so is a real pain. Fortunately, KeyRemap4MacBook is open source, and you can customize it by adding XML to "~/Library/Application Support/KeyRemap4MacBook/private.xml". I found the source for the built-in XML settings, looked through that for "Fn+letter to Control_L+letter", add a setting to private.xml containing a single key mapping:

          --KeyToKey-- KeyCode::SPACE, ModifierFlag::FN, KeyCode::SPACE, ModifierFlag::CONTROL_L

Presto, <fn>-space sets the mark.

Here's my private.xml. To use it, install KeyRemap4MacBook, which requires a restart of your computer. save the file as "~/Library/Application Support/KeyRemap4MacBook/private.xml", in the KeyRemap4MacBook preference pane, press the "ReloadXML" button, then check "Fn+space+ to Control_L+space+".

KeyRemap4MacBook settings

3 comments Edit post Add post

cl-autorepo

Submitted by Bill St. Clair on Thu, 11 Aug 2011 20:45:31 GMT  <== Lisp ==> 

github.com/billstclair/cl-autorepo

I have a few libraries that are not yet in Quicklisp, either because they're in development or I doubt they'll be useful to others. I've been adding them to my projects as git submodules, but I find submodules a pain to maintain. I invented cl-autorepo to make it easier, e.g.:

(cl-autorepo:add-system "fsdb" "https://github.com/billstclair/fsdb" :git)
(ql:quickload "fsdb")

More in the README at the link.

Add comment Edit post Add post

ASDF2-compatible delfasls

Submitted by Bill St. Clair on Wed, 15 Jun 2011 15:22:47 GMT  <== Lisp ==> 

I use ASDF2 via Quicklisp for a lot of my Lisp work these days (Quicklisp rocks!). I like to keep my systems warning-free, so I recompile often. In order to do that, I've always used a script named delfasls. It was simple when my fasls were stored in the same directory as my code:

find . -name "*.fasl" -delete

ASDF2 stores the fasls in a separate directory, however, so I needed delfasls to be smart about that. Just did that today:

#!/bin/bash

find . -name "*.*fsl" -delete
find . -name "*.fasl" -delete

# Delete the asdf2 cached fasl files for the current directory
DIR=`pwd`
if cd ~/.cache/common-lisp 2>/dev/null; then
  CACHE=`pwd`
  for D in `ls`; do
    FASLDIR="$CACHE/$D$DIR"
    #echo $FASLDIR
    if cd $FASLDIR 2>/dev/null; then
        find . -name "*.*fsl" -delete
        find . -name "*.fasl" -delete
    fi
  done
fi

3 comments Edit post Add post

Cocoa/Lisp Tutorial

Submitted by Bill St. Clair on Sun, 17 Jan 2010 12:32:42 GMT  <== Lisp ==> 

plkrueger at TC Lispers - a 70-page tutorial on writing Macintosh Cocoa apps in Clozure Common Lisp (CCL). I write lisp in CCL for a living, but I have only played with Cocoa a few times. This may well be a good place to start should I need to write a Mac GUI app.

Add comment Edit post Add post