Skip to content

Instantly share code, notes, and snippets.

@joaomilho
Forked from softa/ChameleonBass.hs
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaomilho/17425800d1da1a5d562b to your computer and use it in GitHub Desktop.
Save joaomilho/17425800d1da1a5d562b to your computer and use it in GitHub Desktop.
module ChameleonBass where
import Haskore.Music
import Haskore.Melody
import Haskore.Basic.Pitch
import Haskore.Basic.Duration
import Haskore.Music.GeneralMIDI
import Haskore.Interface.MIDI.Render
pitch_line = map (\(x,y,z) -> x (y :: Octave) z () )
first_part = pitch_line [(g,-2,1%+12),(gs,-2,1%+12),(a,-2,1%+12),(as,-2,1%+12)]
second_part = pitch_line [(gs,-1,1%+8),(as,-1,1%+8)]
first_part' = pitch_line [(c,-1,1%+12),(cs,-1,1%+12),(d,-1,1%+12),(ds,-1,1%+12)]
second_part' = pitch_line [(as,-1,1%+8),(cs,0,1%+8)]
song = concat [
first_part,
[rest (1%+24)],
second_part,
[rest (1%+32)],
first_part',
[rest (1%+24)],
second_part',
[rest (1%+32)]
]
-- G|-------------3-----------3-6--------------------------------|
-- D|-----------6------------------------------------------------|
-- A|----------------3-4-5-6-------------------------------------|
-- E|--3-4-5-6---------------------------------------------------|
main_line = concat $
Prelude.replicate 8 $
song
main = fileFromGeneralMIDIMusic "chameleon.midi" $ fromMelodyNullAttr AcousticBass (line main_line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment