I'm not sure if there isn't already a solution to my problem, but I'm trying to replace the values of a pattern with another value. The time per event should remain the same.
I think my first quick hack should make my problem more understandable:
-- This is my list of tuples
rev_map = [("spring", 0), ("hall", 127)]
-- This is my first quick hack
rev_type p = (fromMaybe 0 $ lookup p rev_map) :: Pattern Note
-- This:
rev_type "hall"
-- will translated to this
-- (0>1)|Note {unNote = 127.0}
-- But obviously I can not use patterns for multiple values
-- because my quick hack is only mapping one value to another
rev_type "[hall spring]"
-- But it would be awesome to have this result:
-- (0>1/2)|Note {unNote = 127.0}
-- (1/2>1)|Note {unNote = 0.0}
Can someone please help me here how I can possibly implement this? Any approach would be a great help.