Siamsa Whistle and Fiddle: Week #2

No Comments Written by Etienne Laurin on 2011/09/23 in Music.

I am taking two classes this semester at the Siamsa School of Irish Music.

Fiddle

With Marc-Antoine in the fiddle class we started learning part A of Love at the Endings, a beautiful reel. The title comes from a play called Purple Dust, in which a man wins the heart of his beloved by promising her “things to say and things to do, and love at the endings”. The Comhaltas Archive has a recording of Ed Reavy, the composer, playing this tune. For this tune we practiced ornaments I had never used in a tune before: a roll on the low F♯ and a few cuts and slides.

My homework for this week: Practice part A with all the ornaments we saw.

Whistle

With Steve in the whistle class we studied a jig and a reel. We put aside the Man of Aran that we had started last week because the off-beat rolls seemed daunting to some.

We played the Jackie Small’s Jig together, a tune I first heard on a recording by Cormac Breatnac on his website, although he calls it the Tailor Small’s. I discovered that it was possible to cut a note immediately after a C♯.

We then learned the first part of the Chicago reel. It is one of the tunes available in the Foinn Seisiún collection. This tune is not as easy as it seems. The F♯ is not always played very sharp. The F♯ can also be rolled in a a weird sort of way by playing an E first and then a short roll on the F♯ (without tonguing). Also, the sequence that goes ecgc acgc should be played either without tonging or by tonging only the four C♯.

My homework for this week:

  • Practice the jig and both reels and the ornaments we saw
  • Practice cutting all notes in my range after a C♯
  • Bonus: try to roll an F♮

Visualise Persist Models Using Graphviz

No Comments Written by Etienne Laurin on 2011/09/14 in Code.

My current project uses the Yesod framework for web development. One of the advantages of Yesod is the Database.Persist library. It has type-checked queries, custom sql representations for types and automatic schema migration with postgresql, sqlite and mongodb support.

Here is a little script I wrote to visualise Persist data models.

persist-graph.hs

{-# LANGUAGE UnicodeSyntax, ViewPatterns #-}

-- usage:
--  persistent-graph < config/models > schema.dot
--  neato schema.dot -Tpdf > schema.pdf

import Database.Persist.Base (EntityDef(..), ColumnDef(..))
import Database.Persist.Quasi (parse)
import Data.List (intersperse)

main = do
  defs  getContents
  let schema = parse defs
  putStr $ convert schema

graphOpts = "node [shape=record]; overlap=false; splines=true;"

convert schema = unlines ["digraph {", graphOpts, unlines $ map entity schema, "}"] 

entity (EntityDef name _ cols _ _) = unlines $ [
  name ++ " [",
  "label=\"{" ++ name  ++ "|" ++
  (concat $ intersperse "|" (map column cols))
  ++ "}\"];"] ++
  map (links name) cols

column (ColumnDef name _ _) = "<" ++ name ++ "> " ++ name

links entity (ColumnDef name typ _) =
  if "dI" == take 2 (reverse typ)
  then entity ++ ":" ++ name ++ " -> " ++ reverse (drop 2 (reverse typ))
  else []