Corrections to the beat generation.
authorGuerric Chupin <guerric.chupin@gmail.com>
Fri, 19 Aug 2016 15:38:56 +0000 (16:38 +0100)
committerGuerric Chupin <guerric.chupin@gmail.com>
Fri, 19 Aug 2016 15:38:56 +0000 (16:38 +0100)
src/RMCA/Auxiliary.hs
src/RMCA/Global/Clock.hs
src/RMCA/Translator/Translator.hs

index c49e5cc2c447c103cf91050a64da0ecc36712e81..0d1e77c631f9ec6fe0b8347e794070b9c2c513d2 100644 (file)
@@ -100,7 +100,7 @@ onChange' = proc x -> do
 varFreqSine :: SF DTime Double
 varFreqSine = sin ^<< (2*pi*) ^<< integral <<^ (1/)
 
--- | Generates an 'Event' at a regular frequency, which is given as an input to the signal function.
+-- | Generates an 'Event' with a regular period, which is given as an input to the signal function.
 repeatedlyS :: a -> SF DTime (Event a)
 repeatedlyS x = edgeBy (\a b -> maybeIf (a * b < 0) $> x) 0
                 <<< varFreqSine <<^ (2*)
index c01b1911afe4ebb59ea89dea05ae50fb08e3931a..481101b4afdd52d7740966c1433208edc4591fa2 100644 (file)
@@ -29,7 +29,7 @@ maxAbsBeat = 16
 -- its own fraction, discarding the unecessary beats.
 metronome :: SF Tempo (Event AbsBeat)
 metronome = accumBy (\pb _ -> nextBeatNo maxAbsBeat pb) 1 <<<
-            repeatedlyS () <<^ (/4) <<^ tempoToQNoteIvl
+            repeatedlyS () <<^ (15*) <<^ (1/) <<^ fromIntegral
 
 -- Tempo is the number of quarter notes per minute.
 tempoToQNoteIvl :: Tempo -> DTime
index c29f5f06ee9bc972d82df4639479761d3d3d7e07..edff9f7489ca71acd0fa0aa1ad7c7666da5e0756 100644 (file)
@@ -30,7 +30,7 @@ noteToMessages :: SampleRate
                -> LTempo
                -> (Frames,Note)
                -> [(Frames,Message)]
-noteToMessages sr chan lt (t,n@Note { noteDur = d }) =
+noteToMessages sr chan lt (t,n@Note { noteDur = d })
   | d == 0 = []
   | otherwise = [(t,nm),(t + dn,switchOnOff nm)]
   where nm = noteOnToMessage chan n