Zip module is result of merging Melodic and Rhyhm modules. \begin{code} -- | -- Maintainer : silva.samuel@alumni.uminho.pt -- Stability : experimental -- Portability: portable -- This module join Melodic and Rhythm module Music.Analysis.Abstract.Zip where import Music.Analysis.PF ((><), p2) import Music.Analysis.Base (Number, toRatio, toInteger) import Music.Analysis.Abstract.Settings (Settings, union) import Music.Analysis.Abstract.Motive import Music.Analysis.Abstract.Melodic as Melodic import Music.Analysis.Abstract.Rhythm as Rhythm import Data.Function ((.), id) import Prelude () \end{code} At this stage will be join pieces, like melodic and rhythm. \begin{code} -- * Types -- | VoiceZipNode definition type VoiceZipNode = (MelodicNode, RhythmNode) type VoiceZipAbsolute = (MelodicAbsolute, RhythmAbsolute) type VoiceZipRelative = (MelodicRelative, RhythmRelative) -- | default settings settings :: Settings settings = Melodic.settings `union` Rhythm.settings \end{code} \begin{code} -- | transposes transpose :: Number -> Motive VoiceZipAbsolute -> Motive VoiceZipAbsolute transpose n = joinMotivePair . (Melodic.transpose n >< id) . splitMotivePair -- | changes duration tempo :: Number -> Motive VoiceZipAbsolute -> Motive VoiceZipAbsolute tempo n = joinMotivePair . (id >< (Rhythm.tempo . toRatio . toInteger) n) . splitMotivePair -- | computes duration duration :: Motive VoiceZipNode -> Number duration = Rhythm.duration . p2 . splitMotivePair -- | reverse reverse :: Motive VoiceZipNode -> Motive VoiceZipNode reverse = joinMotivePair . (Melodic.reverse >< Rhythm.reverse) . splitMotivePair -- | relative relative :: Motive VoiceZipAbsolute -> Motive VoiceZipRelative relative = joinMotivePair . (Melodic.relative >< Rhythm.relative) . splitMotivePair -- | absolute absolute :: Motive VoiceZipRelative -> Motive VoiceZipAbsolute absolute = joinMotivePair . (Melodic.absolute >< Rhythm.absolute) . splitMotivePair \end{code}