[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guitar-tune.el 0.1

From: Mathias Dahl
Subject: Re: guitar-tune.el 0.1
Date: Sat, 12 Jan 2008 22:28:52 +0100
User-agent: 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
;; 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.

;;; Commentary:
;; 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
;; A2.wav
;; D3.wav
;; G4.wav
;; B5.wav
;; E6.wav

;; The files can only be downloaded through a javascript-enabled web
;; browser, it seems (I don't want to host the files on my web server
;; so I had to use the 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.
;; Enjoy!

;;; Requirements
;; - EMMS
;; - The sound files mentioned above

;;; History:

;;; Code:

(require 'emms-setup)


(defun guitar-tune ()
  "Tune your guitar."
  (pop-to-buffer (get-buffer-create "*guitar-tune*"))
  (toggle-read-only 0)
  (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")
  (toggle-read-only 1)

(defcustom guitar-sound-dir "~/gfx/sound"
  "Path to where the sound files are."
  :type 'string
  :group 'multimedia)

(defun guitar-tune-play (note)
  "Play NOTE."
    (emms-play-file (concat (file-name-as-directory guitar-sound-dir)
                            (symbol-name note)

(define-derived-mode guitar-tune-mode
  fundamental-mode "guitar-tune"
  "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'."
   (lambda (x)
     (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))))

(provide 'guitar-tune)

(provide 'guitar-tune)

;;; guitar-tune.el ends here

reply via email to

[Prev in Thread] Current Thread [Next in Thread]