-
-
Save fayimora/a7c3e2c28a0948a06218 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
import javax.sound.midi._ | |
val synth = MidiSystem.getSynthesizer() | |
synth.open() | |
def note(i: Int) = { | |
val channels = synth.getChannels() | |
channels(0).noteOn(i, 100) | |
Thread.sleep(250) | |
channels(0).noteOff(i) | |
} | |
val s1 = Seq(67, 72, 76, 79, 0, 78, 78, 77, 81, 84, 76, 0, 74, 0) | |
val first = Seq(60) ++ s1 ++ Seq(0) ++ s1 | |
val s2 = Seq(62, 0, 62, 64, 60, 0) | |
val s3 = s2 ++ Seq(55) | |
val second = s3 ++ Seq(55) ++ s3 ++ Seq(0) ++ s2 ++ Seq(57, 67, 67, 0, 0, 65, 62, 0, 0) | |
val s4 = Seq(69, 0, 64, 0, 67, 0, 64, 0) ++ Seq(64, 72, 71, 69, 67, 0, 64, 0) | |
val s6 = Seq(69, 0, 67, 65, 64, 0) | |
val s5 = s6 ++ Seq(65, 67, 0, 62, 0, 0, 62, 67, 74) | |
val s7 = Seq(62, 60, 0, 62) | |
(first ++ second ++ s4 ++ s5 ++ s4 ++ s6 ++ s7).foreach(note) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment