[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guitar-tune.el 0.1
Re: guitar-tune.el 0.1
Sat, 12 Jan 2008 22:28:52 +0100
Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)
Mathias Dahl <address@hidden> writes:
How embarrassing, I misspelled "guitar". Have to blame it on the Swedish
Here is a corrected version.
;;; guitar-tune.el --- Tune your guitar
;; Copyright (C) 2008 Mathias Dahl
;; Version: 0.1
;; Keywords: convenience, music
;; Author: Mathias Dahl <address@hidden>
;; This file is NOT part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;; This is a small hack to help you tune your guitar. To use, first
;; you need some sound files, which can be downloaded as per
;; below. Save each URL as the file name described in the table:
;; Save as URL
;; ======= ===
;; E1.wav http://www.box.net/shared/xgeh7yqskg
;; A2.wav http://www.box.net/shared/lvlcuyvkso
;; D3.wav http://www.box.net/shared/u7hg1tg8cg
;; G4.wav http://www.box.net/shared/yfzha20g8s
;; B5.wav http://www.box.net/shared/nlitky58gg
;; E6.wav http://www.box.net/shared/x12ksgj4sk
;; browser, it seems (I don't want to host the files on my web server
;; so I had to use the Box.net account, if you know about any better
;; free sound hosting, please tell me.)
;; Next, do M-x eval-buffer RET
;; Now you need to define the place where you saved the sound
;; files. Do that by customizing `guitar-sound-dir'.
;; Finally, type M-x guitar-tune RET and follow the instructions
;; on the screen.
;; - EMMS
;; - The sound files mentioned above
(defun guitar-tune ()
"Tune your guitar."
(pop-to-buffer (get-buffer-create "*guitar-tune*"))
(insert "*** Guitar Tune ***\n\nType e, a, d, g, b, or E (uppercase\
e, for the high e note) to play.\nThe numbers 1
through 6 are also bound to the six strings on the guitar.\n")
(defcustom guitar-sound-dir "~/gfx/sound"
"Path to where the sound files are."
(defun guitar-tune-play (note)
(emms-play-file (concat (file-name-as-directory guitar-sound-dir)
"Mode for playing guitar"
(defvar guitar-tune-mode-map (make-sparse-keymap)
"Keymap for `guitar-tune-mode'.")
(defun guitar-tune-define-mode-keymap ()
"Define keymap for `guitar-tune-mode'."
(define-key guitar-tune-mode-map (car x)
`(lambda () (interactive) (guitar-tune-play ',(cdr x)))))
'(("e" . E1)
("a" . A2)
("d" . D3)
("g" . G4)
("b" . B5)
("E" . E6)
("1" . E1)
("2" . A2)
("3" . D3)
("4" . G4)
("5" . B5)
("6" . E6))))
;;; guitar-tune.el ends here
Message not available