Skip to content

Instantly share code, notes, and snippets.

@mikesol
Last active September 21, 2021 17:06
Show Gist options
  • Save mikesol/454e7460816c3fdaf75cf9ba3920059e to your computer and use it in GitHub Desktop.
Save mikesol/454e7460816c3fdaf75cf9ba3920059e to your computer and use it in GitHub Desktop.
The Blue Danube Waltz
module Main where
import Prelude
import Data.NonEmpty ((:|))
import Effect (Effect)
import Halogen.Storybook (Stories, runStorybook, proxy)
import Type.Proxy (Proxy(..))
import WAGS.Lib.Learn (buffers, component, using, usingc, play)
import WAGS.Lib.Learn.Duration (crochet, crochetRest, dottedMinim, minim, semibreve)
import WAGS.Lib.Learn.Note (note, noteFromPitch_, note_, repeat, rs, seq)
import WAGS.Lib.Learn.Pitch (a4, a5, b4, b5, bFlat4, c4, c5, cSharp4, d4, d5, d6, e4, e5, fSharp4, fSharp5, fSharp6, g4, g5, gSharp4, gSharp5, majorThird, wholeTone)
import WAGS.Lib.Learn.Tempo (allegro)
import WAGS.Lib.Learn.Volume (mezzoForte)
main :: Effect Unit
main = play
$ seq
$ map allegro
let
n = note mezzoForte crochet
ndm = note mezzoForte dottedMinim
nm = note mezzoForte minim
cell p1 p2 p3 p4 p5 p6 p7 p8 p9 = n p1 :|
[ n p2
, n p3
, n p4
, n p5
, rs crochetRest
, n p6
, n p7
, rs crochetRest
, n p8
, n p9
, rs crochetRest
]
app (a :| b) (c :| d) = a :| (b <> [ c ] <> d)
in
cell d4 d4 fSharp4 a4 a4 a5 a5 fSharp5 fSharp5
`app` cell d4 d4 fSharp4 a4 a4 a5 a5 g5 g5
`app` cell cSharp4 cSharp4 e4 b4 b4 b5 b5 g5 g5
`app` cell cSharp4 cSharp4 e4 b4 b4 b5 b5 fSharp5 fSharp5
`app` cell d4 d4 fSharp4 a4 d5 d6 d6 a5 a5
`app` cell d4 d4 fSharp4 a4 d5 d6 d6 b5 b5
`app`
( n e5 :|
[ n e5
, n g5
, n b5
, ndm b5
, rs crochetRest
, n gSharp5
, n a5
, ndm fSharp6
, rs crochetRest
, n d6
, n fSharp5
, nm fSharp5
, n e5
, nm b5
, n a5
, nm d5
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment