module Perform.Sc.Note (
Note(..), ControlId(..), PatchName
, Notes, PlayNotes(..)
, gate_id
) where
import qualified Data.ByteString as ByteString
import qualified Data.Int as Int
import qualified GHC.Generics as Generics
import qualified Util.Pretty as Pretty
import qualified Derive.LEvent as LEvent
import qualified Perform.Midi.MSignal as MSignal
import Global
import Types
data Note = Note {
Note -> PatchName
patch :: !PatchName
, Note -> RealTime
start :: !RealTime
, Note -> Map ControlId Signal
controls :: !(Map ControlId MSignal.Signal)
} deriving (Note -> Note -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Note -> Note -> Bool
$c/= :: Note -> Note -> Bool
== :: Note -> Note -> Bool
$c== :: Note -> Note -> Bool
Eq, Int -> Note -> ShowS
[Note] -> ShowS
Note -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Note] -> ShowS
$cshowList :: [Note] -> ShowS
show :: Note -> String
$cshow :: Note -> String
showsPrec :: Int -> Note -> ShowS
$cshowsPrec :: Int -> Note -> ShowS
Show, forall x. Rep Note x -> Note
forall x. Note -> Rep Note x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Note x -> Note
$cfrom :: forall x. Note -> Rep Note x
Generics.Generic)
instance Pretty.Pretty Note where format :: Note -> Doc
format = forall a. (PrettyG (Rep a), Generic a) => a -> Doc
Pretty.formatG
newtype ControlId = ControlId Int.Int32
deriving (ControlId -> ControlId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControlId -> ControlId -> Bool
$c/= :: ControlId -> ControlId -> Bool
== :: ControlId -> ControlId -> Bool
$c== :: ControlId -> ControlId -> Bool
Eq, Eq ControlId
ControlId -> ControlId -> Bool
ControlId -> ControlId -> Ordering
ControlId -> ControlId -> ControlId
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ControlId -> ControlId -> ControlId
$cmin :: ControlId -> ControlId -> ControlId
max :: ControlId -> ControlId -> ControlId
$cmax :: ControlId -> ControlId -> ControlId
>= :: ControlId -> ControlId -> Bool
$c>= :: ControlId -> ControlId -> Bool
> :: ControlId -> ControlId -> Bool
$c> :: ControlId -> ControlId -> Bool
<= :: ControlId -> ControlId -> Bool
$c<= :: ControlId -> ControlId -> Bool
< :: ControlId -> ControlId -> Bool
$c< :: ControlId -> ControlId -> Bool
compare :: ControlId -> ControlId -> Ordering
$ccompare :: ControlId -> ControlId -> Ordering
Ord, Int -> ControlId -> ShowS
[ControlId] -> ShowS
ControlId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ControlId] -> ShowS
$cshowList :: [ControlId] -> ShowS
show :: ControlId -> String
$cshow :: ControlId -> String
showsPrec :: Int -> ControlId -> ShowS
$cshowsPrec :: Int -> ControlId -> ShowS
Show, [ControlId] -> Doc
ControlId -> Text
ControlId -> Doc
forall a. (a -> Text) -> (a -> Doc) -> ([a] -> Doc) -> Pretty a
formatList :: [ControlId] -> Doc
$cformatList :: [ControlId] -> Doc
format :: ControlId -> Doc
$cformat :: ControlId -> Doc
pretty :: ControlId -> Text
$cpretty :: ControlId -> Text
Pretty)
type PatchName = ByteString.ByteString
type Notes = [LEvent.LEvent Note]
data PlayNotes = PlayNotes {
PlayNotes -> RealTime
shift :: RealTime
, PlayNotes -> RealTime
stretch :: RealTime
, PlayNotes -> Notes
notes :: Notes
} deriving (Int -> PlayNotes -> ShowS
[PlayNotes] -> ShowS
PlayNotes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlayNotes] -> ShowS
$cshowList :: [PlayNotes] -> ShowS
show :: PlayNotes -> String
$cshow :: PlayNotes -> String
showsPrec :: Int -> PlayNotes -> ShowS
$cshowsPrec :: Int -> PlayNotes -> ShowS
Show)
gate_id :: ControlId
gate_id :: ControlId
gate_id = Int32 -> ControlId
ControlId Int32
0