Skip to content

Instantly share code, notes, and snippets.

@softa
Created June 8, 2010 03:38
Show Gist options
  • Select an option

  • Save softa/429573 to your computer and use it in GitHub Desktop.

Select an option

Save softa/429573 to your computer and use it in GitHub Desktop.
module FrereJacques where
import Haskore.Music
import Haskore.Melody
import Haskore.Basic.Pitch
import Haskore.Basic.Duration
import Haskore.Music.GeneralMIDI as MidiMusic
import Haskore.Interface.MIDI.Render as Render
render_to f m = Render.fileFromGeneralMIDIMusic f song where
song = MidiMusic.fromMelodyNullAttr MidiMusic.AcousticGrandPiano m
pitch_line = line . map to_note
to_note (x,y) = x (1 :: Octave) y ()
main = render_to "frere_jacques.midi" $ (pitch_line [(c,en),(d,en),(e,en),(c,en),(c,en),(d,en),(e,en),(c,en),(e,en),(f,en),(g,qn),(e,en),(f,en),(g,qn),(g,sn),(a,sn),(g,sn),(f,sn),(e,en),(c,en),(g,sn),(a,sn),(g,sn),(f,sn),(e,en),(c,en),(d,en),(d,en),(c,qn),(d,en),(d,en),(c,qn)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment