Skip to content

Instantly share code, notes, and snippets.

@deltam
Created December 10, 2011 08:50
Show Gist options
  • Save deltam/1454843 to your computer and use it in GitHub Desktop.
Save deltam/1454843 to your computer and use it in GitHub Desktop.
(ns overtone-chrismas.core
(:use [overtone.live]))
(defn foo [freq]
(pan2 (sin-osc freq)))
; ドレミの周波数を定義
(def doremi {:none 0
:do 261.6
:re 293.6
:mi 329.6
:fa 349.2
:so 392
:ra 440
:si 493.8
:do2 523.3
:re2 587})
(defn key-on [note]
(demo 0.3 (foo (note doremi))))
(defn play-notes [notes]
(dorun (map #(do (key-on %) (Thread/sleep 300))
notes)))
;ジングルベル
(defn play-jingle-bells []
(play-notes
[:do :ra :so :fa :do :none
:do :ra :so :fa :re :none
:re :si :ra :so :mi :none
:do2 :do2 :si :so :ra :none
:do :ra :so :fa :do :none
:do :ra :so :fa :re :none
:re :si :ra :so :do2 :do2 :do2 :do2
:re2 :do2 :si :ra :so :none
:do2 :none
:ra :ra :ra :none :ra :ra :ra :none
:ra :do2 :fa :so :ra :none
:si :si :si :si :si :ra :ra :ra
:ra :so :so :ra :so :none
:do2 :none
:ra :ra :ra :none :ra :ra :ra :none
:ra :do2 :fa :so :ra :none
:si :si :si :si :si :ra :ra :ra
:do2 :do2 :si :so :fa
])
)
(defproject overtone-chrismas "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.3.0"]
[overtone "0.5.0"]])
@samaaron
Copy link

Excellent work :-)

If you're interested, I've fixed up a few things here: https://gist.github.com/1457193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment