undefinedを埋めてく感じでシンセ毎に機能を作っていく感じになるはず https://github.com/tokiwoousaka/ArareDSL/blob/master/src/Sound/Arare/ArareDSL.hs ただし事実上フレーズの多相化みたいな事は難しいっぽい。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
module Main where | |
import Sound.Arare.ArareDSL | |
data SinOscillator | |
instance NoteController SinOscillator where | |
noteOn = undefined | |
noteOff = undefined | |
instance MonadNoteController (ArareSequencer SinOscillator) where | |
getNoteLength = undefined | |
putNoteLength = undefined | |
getNoteVelocity = undefined | |
putNoteVelocity = undefined | |
instance DslNoteController (NoteLength -> NoteVelocity -> ArareSequencer SinOscillator ()) where | |
c l v = makeNote (Just l) (Just v) NoteC | |
cs l v = makeNote (Just l) (Just v) NoteCS | |
d l v = makeNote (Just l) (Just v) NoteD | |
ds l v = makeNote (Just l) (Just v) NoteDS | |
e l v = makeNote (Just l) (Just v) NoteE | |
f l v = makeNote (Just l) (Just v) NoteF | |
fs l v = makeNote (Just l) (Just v) NoteFS | |
g l v = makeNote (Just l) (Just v) NoteG | |
gs l v = makeNote (Just l) (Just v) NoteGS | |
a l v = makeNote (Just l) (Just v) NoteA | |
as l v = makeNote (Just l) (Just v) NoteAS | |
b l v = makeNote (Just l) (Just v) NoteB | |
instance DslNoteController (NoteLength -> ArareSequencer SinOscillator ()) where | |
c l = makeNote (Just l) Nothing NoteC | |
cs l = makeNote (Just l) Nothing NoteCS | |
d l = makeNote (Just l) Nothing NoteD | |
ds l = makeNote (Just l) Nothing NoteDS | |
e l = makeNote (Just l) Nothing NoteE | |
f l = makeNote (Just l) Nothing NoteF | |
fs l = makeNote (Just l) Nothing NoteFS | |
g l = makeNote (Just l) Nothing NoteG | |
gs l = makeNote (Just l) Nothing NoteGS | |
a l = makeNote (Just l) Nothing NoteA | |
as l = makeNote (Just l) Nothing NoteAS | |
b l = makeNote (Just l) Nothing NoteB | |
instance DslNoteController (ArareSequencer SinOscillator ()) where | |
c = makeNote Nothing Nothing NoteC | |
cs = makeNote Nothing Nothing NoteCS | |
d = makeNote Nothing Nothing NoteD | |
ds = makeNote Nothing Nothing NoteDS | |
e = makeNote Nothing Nothing NoteE | |
f = makeNote Nothing Nothing NoteF | |
fs = makeNote Nothing Nothing NoteFS | |
g = makeNote Nothing Nothing NoteG | |
gs = makeNote Nothing Nothing NoteGS | |
a = makeNote Nothing Nothing NoteA | |
as = makeNote Nothing Nothing NoteAS | |
b = makeNote Nothing Nothing NoteB | |
---- | |
test :: ArareSequencer SinOscillator () | |
test = do | |
-- さ〜い〜た〜さ〜い〜た〜 | |
c .> d .> e l2 .> c .> d .> e l2 | |
-- ちゅ〜りっぷ〜の〜は〜な〜が〜 | |
g .> e .> d .> c .> d .> e .> d l2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment