I am looking to make a function that is similar to
toScale but that takes a pattern of chords as its input instead of a list.
The reason I want to build this is so that I can write chord progressions and strum them with a series of numbers in a more precise way than arpeggiate.
d1 $ note ( fingerpick "<c'maj7 d'min7 g'dom7 c'maj7>" $ (run 8) ) # s "midi"
fingerpick is my custom function. The result in this case would be 8 notes of each chord ascending but could be patterned to be the notes in any order.
I started by reading over some similar posts on the forum and building up from the implementation of
toScale :: Num a => [a] -> Pattern Int -> Pattern a toScale  = const silence toScale s = fmap noteInScale where octave x = x `div` length s noteInScale x = (s !!! x) + fromIntegral (12 * octave x)
The type of
fingerpick would be:
fingerpick :: Num a => Pattern a -> Pattern Int -> Pattern a but I'm lost as to how to write it. My gut is that the answer will be similar to this [thread](thread Working with groups of co-occuring events) in that it will involve making the main function (in this case
noteInScale) to operator on
[Event a] rather than
[a] but I'm getting lost in the wiring.
I've gotten as far as attempting to define the following 'force to scale' function for lists of events in the hopes that this will bring me closer to being able to define it for patterns of chords
eventFts :: Num a => [Event a] -> [Event Int] -> [Event a] eventFts s = fmap ( (\x -> (s !!! x) + fromIntegral (12 * (octave x) )) =<<) where octave x = x `div` length s
I'm not at all sure that is a step in the right direction.
Does anyone have an idea for what I might try next? Thanks!