Skip to content

Instantly share code, notes, and snippets.

@softa
Created June 8, 2010 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save softa/430304 to your computer and use it in GitHub Desktop.
Save softa/430304 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)]
-- G|-------------3-----------3-6--------------------------------|
-- D|-----------6------------------------------------------------|
-- A|----------------3-4-5-6-------------------------------------|
-- E|--3-4-5-6---------------------------------------------------|
main_line = concat $ Prelude.replicate 8 $ concat [first_part, [rest (1%+24)], second_part, [rest (1%+32)], first_part', [rest (1%+24)], second_part', [rest (1%+32)]]
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