module Sound.Sc3.Server.Command.Generic where
import Data.List
import Data.Maybe
import Sound.Osc.Core
import qualified Sound.Sc3.Common.Base as Common.Base
import qualified Sound.Sc3.Server.Command.Completion as Server.Command.Completion
import qualified Sound.Sc3.Server.Enum as Server.Enum
import qualified Sound.Sc3.Server.Graphdef as Server.Graphdef
import qualified Sound.Sc3.Server.Graphdef.Binary as Server.Graphdef
import qualified Sound.Sc3.Server.Synthdef as Server.Synthdef
cmd_check_arg :: String -> (t -> Bool) -> t -> t
cmd_check_arg :: forall t. String -> (t -> Bool) -> t -> t
cmd_check_arg String
e t -> Bool
f t
x = if Bool -> Bool
not (t -> Bool
f t
x) then String -> t
forall a. HasCallStack => String -> a
error String
e else t
x
b_bufnum :: Integral t => t -> Datum
b_bufnum :: forall t. Integral t => t -> Datum
b_bufnum = t -> Datum
forall t. Integral t => t -> Datum
int32 (t -> Datum) -> (t -> t) -> t -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> (t -> Bool) -> t -> t
forall t. String -> (t -> Bool) -> t -> t
cmd_check_arg String
"buffer-number < 0?" (t -> t -> Bool
forall a. Ord a => a -> a -> Bool
>= t
0)
b_ix :: Integral t => t -> Datum
b_ix :: forall t. Integral t => t -> Datum
b_ix = t -> Datum
forall t. Integral t => t -> Datum
int32 (t -> Datum) -> (t -> t) -> t -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> (t -> Bool) -> t -> t
forall t. String -> (t -> Bool) -> t -> t
cmd_check_arg String
"buffer-ix < 0?" (t -> t -> Bool
forall a. Ord a => a -> a -> Bool
>= t
0)
b_ch :: Integral t => t -> Datum
b_ch :: forall t. Integral t => t -> Datum
b_ch = t -> Datum
forall t. Integral t => t -> Datum
int32 (t -> Datum) -> (t -> t) -> t -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> (t -> Bool) -> t -> t
forall t. String -> (t -> Bool) -> t -> t
cmd_check_arg String
"buffer-channel < 0?" (t -> t -> Bool
forall a. Ord a => a -> a -> Bool
>= t
0)
b_size :: Integral t => t -> Datum
b_size :: forall t. Integral t => t -> Datum
b_size = t -> Datum
forall t. Integral t => t -> Datum
int32 (t -> Datum) -> (t -> t) -> t -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> (t -> Bool) -> t -> t
forall t. String -> (t -> Bool) -> t -> t
cmd_check_arg String
"buffer-size < 0?" (t -> t -> Bool
forall a. Ord a => a -> a -> Bool
>= t
0)
b_alloc :: Integral i => i -> i -> i -> Message
b_alloc :: forall i. Integral i => i -> i -> i -> Message
b_alloc i
b i
frames i
channels = String -> [Datum] -> Message
message String
"/b_alloc" [i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b, i -> Datum
forall t. Integral t => t -> Datum
b_size i
frames, i -> Datum
forall t. Integral t => t -> Datum
int32 i
channels]
b_allocRead :: Integral i => i -> String -> i -> i -> Message
b_allocRead :: forall i. Integral i => i -> String -> i -> i -> Message
b_allocRead i
bufferNumber String
fileName i
startFrame i
frameCount =
String -> [Datum] -> Message
message
String
"/b_allocRead"
[ i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
bufferNumber
, String -> Datum
string String
fileName
, i -> Datum
forall t. Integral t => t -> Datum
b_ix i
startFrame
, i -> Datum
forall t. Integral t => t -> Datum
b_ix i
frameCount
]
b_allocReadChannel :: Integral i => i -> String -> i -> i -> [i] -> Message
b_allocReadChannel :: forall i. Integral i => i -> String -> i -> i -> [i] -> Message
b_allocReadChannel i
bufferNumber String
fileName i
startFrame i
frameCount [i]
channels =
String -> [Datum] -> Message
message
String
"/b_allocReadChannel"
( [ i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
bufferNumber
, String -> Datum
string String
fileName
, i -> Datum
forall t. Integral t => t -> Datum
b_ix i
startFrame
, i -> Datum
forall t. Integral t => t -> Datum
b_ix i
frameCount
]
[Datum] -> [Datum] -> [Datum]
forall a. [a] -> [a] -> [a]
++ (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
b_ch [i]
channels
)
b_close :: Integral i => i -> Message
b_close :: forall i. Integral i => i -> Message
b_close i
b = String -> [Datum] -> Message
message String
"/b_close" [i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b]
b_fill :: (Integral i, Real n) => i -> [(i, i, n)] -> Message
b_fill :: forall i n. (Integral i, Real n) => i -> [(i, i, n)] -> Message
b_fill i
b [(i, i, n)]
l = String -> [Datum] -> Message
message String
"/b_fill" (i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (i -> Datum)
-> (i -> Datum) -> (n -> Datum) -> [(i, i, n)] -> [Datum]
forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples i -> Datum
forall t. Integral t => t -> Datum
int32 i -> Datum
forall t. Integral t => t -> Datum
int32 n -> Datum
forall n. Real n => n -> Datum
float [(i, i, n)]
l)
b_free :: Integral i => i -> Message
b_free :: forall i. Integral i => i -> Message
b_free i
b = String -> [Datum] -> Message
message String
"/b_free" [i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b]
b_gen :: Integral i => i -> String -> [Datum] -> Message
b_gen :: forall i. Integral i => i -> String -> [Datum] -> Message
b_gen i
b String
name [Datum]
arg = String -> [Datum] -> Message
message String
"/b_gen" (i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: String -> Datum
string String
name Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: [Datum]
arg)
b_gen_sine1 :: (Integral i, Real n) => i -> [Server.Enum.B_Gen] -> [n] -> Message
b_gen_sine1 :: forall i n. (Integral i, Real n) => i -> [B_Gen] -> [n] -> Message
b_gen_sine1 i
z [B_Gen]
f [n]
n = i -> String -> [Datum] -> Message
forall i. Integral i => i -> String -> [Datum] -> Message
b_gen i
z String
"sine1" (Int -> Datum
forall t. Integral t => t -> Datum
int32 ([B_Gen] -> Int
Server.Enum.b_gen_flag [B_Gen]
f) Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (n -> Datum) -> [n] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map n -> Datum
forall n. Real n => n -> Datum
float [n]
n)
b_gen_sine2 :: (Integral i, Real n) => i -> [Server.Enum.B_Gen] -> [(n, n)] -> Message
b_gen_sine2 :: forall i n.
(Integral i, Real n) =>
i -> [B_Gen] -> [(n, n)] -> Message
b_gen_sine2 i
z [B_Gen]
f [(n, n)]
n = i -> String -> [Datum] -> Message
forall i. Integral i => i -> String -> [Datum] -> Message
b_gen i
z String
"sine2" (Int -> Datum
forall t. Integral t => t -> Datum
int32 ([B_Gen] -> Int
Server.Enum.b_gen_flag [B_Gen]
f) Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (n -> Datum) -> (n -> Datum) -> [(n, n)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples n -> Datum
forall n. Real n => n -> Datum
float n -> Datum
forall n. Real n => n -> Datum
float [(n, n)]
n)
b_gen_sine3 :: (Integral i, Real n) => i -> [Server.Enum.B_Gen] -> [(n, n, n)] -> Message
b_gen_sine3 :: forall i n.
(Integral i, Real n) =>
i -> [B_Gen] -> [(n, n, n)] -> Message
b_gen_sine3 i
z [B_Gen]
f [(n, n, n)]
n = i -> String -> [Datum] -> Message
forall i. Integral i => i -> String -> [Datum] -> Message
b_gen i
z String
"sine3" (Int -> Datum
forall t. Integral t => t -> Datum
int32 ([B_Gen] -> Int
Server.Enum.b_gen_flag [B_Gen]
f) Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (n -> Datum)
-> (n -> Datum) -> (n -> Datum) -> [(n, n, n)] -> [Datum]
forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples n -> Datum
forall n. Real n => n -> Datum
float n -> Datum
forall n. Real n => n -> Datum
float n -> Datum
forall n. Real n => n -> Datum
float [(n, n, n)]
n)
b_gen_cheby :: (Integral i, Real n) => i -> [Server.Enum.B_Gen] -> [n] -> Message
b_gen_cheby :: forall i n. (Integral i, Real n) => i -> [B_Gen] -> [n] -> Message
b_gen_cheby i
z [B_Gen]
f [n]
n = i -> String -> [Datum] -> Message
forall i. Integral i => i -> String -> [Datum] -> Message
b_gen i
z String
"cheby" (Int -> Datum
forall t. Integral t => t -> Datum
int32 ([B_Gen] -> Int
Server.Enum.b_gen_flag [B_Gen]
f) Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (n -> Datum) -> [n] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map n -> Datum
forall n. Real n => n -> Datum
float [n]
n)
b_gen_copy :: Integral i => i -> i -> i -> i -> Maybe i -> Message
b_gen_copy :: forall i. Integral i => i -> i -> i -> i -> Maybe i -> Message
b_gen_copy i
dst_b i
dst_ix i
src_b i
src_ix Maybe i
nf =
let nf' :: i
nf' = i -> Maybe i -> i
forall a. a -> Maybe a -> a
fromMaybe (-i
1) Maybe i
nf
in i -> String -> [Datum] -> Message
forall i. Integral i => i -> String -> [Datum] -> Message
b_gen i
dst_b String
"copy" ((i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32 [i
dst_ix, i
src_b, i
src_ix, i
nf'])
b_get :: Integral i => i -> [i] -> Message
b_get :: forall i. Integral i => i -> [i] -> Message
b_get i
b [i]
i = String -> [Datum] -> Message
message String
"/b_get" (i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32 [i]
i)
b_getn :: Integral i => i -> [(i, i)] -> Message
b_getn :: forall i. Integral i => i -> [(i, i)] -> Message
b_getn i
b [(i, i)]
l = String -> [Datum] -> Message
message String
"/b_getn" (i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (i -> Datum) -> (i -> Datum) -> [(i, i)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
b_ix i -> Datum
forall t. Integral t => t -> Datum
b_size [(i, i)]
l)
b_query :: Integral i => [i] -> Message
b_query :: forall i. Integral i => [i] -> Message
b_query = String -> [Datum] -> Message
message String
"/b_query" ([Datum] -> Message) -> ([i] -> [Datum]) -> [i] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32
b_read :: Integral i => i -> String -> i -> i -> i -> Bool -> Message
b_read :: forall i.
Integral i =>
i -> String -> i -> i -> i -> Bool -> Message
b_read i
bufId String
pathName i
startFrame i
numFrames i
bufFrame Bool
leaveOpen =
String -> [Datum] -> Message
message String
"/b_read" [i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
bufId, String -> Datum
string String
pathName, i -> Datum
forall t. Integral t => t -> Datum
int32 i
startFrame, i -> Datum
forall t. Integral t => t -> Datum
int32 i
numFrames, i -> Datum
forall t. Integral t => t -> Datum
int32 i
bufFrame, Int -> Datum
forall t. Integral t => t -> Datum
int32 (Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
leaveOpen)]
b_readChannel :: Integral i => i -> String -> i -> i -> i -> Bool -> [i] -> Message
b_readChannel :: forall i.
Integral i =>
i -> String -> i -> i -> i -> Bool -> [i] -> Message
b_readChannel i
b String
p i
f i
n i
f' Bool
z [i]
cs = String -> [Datum] -> Message
message String
"/b_readChannel" ([i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b, String -> Datum
string String
p, i -> Datum
forall t. Integral t => t -> Datum
int32 i
f, i -> Datum
forall t. Integral t => t -> Datum
int32 i
n, i -> Datum
forall t. Integral t => t -> Datum
int32 i
f', Int -> Datum
forall t. Integral t => t -> Datum
int32 (Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
z)] [Datum] -> [Datum] -> [Datum]
forall a. [a] -> [a] -> [a]
++ (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32 [i]
cs)
b_set :: (Integral i, Real n) => i -> [(i, n)] -> Message
b_set :: forall i n. (Integral i, Real n) => i -> [(i, n)] -> Message
b_set i
b [(i, n)]
l = String -> [Datum] -> Message
message String
"/b_set" (i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (i -> Datum) -> (n -> Datum) -> [(i, n)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
int32 n -> Datum
forall n. Real n => n -> Datum
float [(i, n)]
l)
b_setn :: (Integral i, Real n) => i -> [(i, [n])] -> Message
b_setn :: forall i n. (Integral i, Real n) => i -> [(i, [n])] -> Message
b_setn i
b [(i, [n])]
l =
let f :: (n, [a]) -> [Datum]
f (n
i, [a]
d) = n -> Datum
forall t. Integral t => t -> Datum
int32 n
i Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: Int -> Datum
forall t. Integral t => t -> Datum
int32 ([a] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
d) Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (a -> Datum) -> [a] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map a -> Datum
forall n. Real n => n -> Datum
float [a]
d
in String -> [Datum] -> Message
message String
"/b_setn" (i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: ((i, [n]) -> [Datum]) -> [(i, [n])] -> [Datum]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (i, [n]) -> [Datum]
forall {n} {a}. (Integral n, Real a) => (n, [a]) -> [Datum]
f [(i, [n])]
l)
b_write :: Integral i => i -> String -> Server.Enum.SoundFileFormat -> Server.Enum.SampleFormat -> i -> i -> Bool -> Message
b_write :: forall i.
Integral i =>
i
-> String
-> SoundFileFormat
-> SampleFormat
-> i
-> i
-> Bool
-> Message
b_write i
b String
p SoundFileFormat
h SampleFormat
t i
f i
s Bool
z =
let h' :: Datum
h' = String -> Datum
string (SoundFileFormat -> String
Server.Enum.soundFileFormatString SoundFileFormat
h)
t' :: Datum
t' = String -> Datum
string (SampleFormat -> String
Server.Enum.sampleFormatString SampleFormat
t)
in String -> [Datum] -> Message
message String
"/b_write" [i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b, String -> Datum
string String
p, Datum
h', Datum
t', i -> Datum
forall t. Integral t => t -> Datum
int32 i
f, i -> Datum
forall t. Integral t => t -> Datum
int32 i
s, Int -> Datum
forall t. Integral t => t -> Datum
int32 (Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
z)]
b_zero :: Integral i => i -> Message
b_zero :: forall i. Integral i => i -> Message
b_zero i
b = String -> [Datum] -> Message
message String
"/b_zero" [i -> Datum
forall t. Integral t => t -> Datum
b_bufnum i
b]
c_fill :: (Integral i, Real n) => [(i, i, n)] -> Message
c_fill :: forall i n. (Integral i, Real n) => [(i, i, n)] -> Message
c_fill = String -> [Datum] -> Message
message String
"/c_fill" ([Datum] -> Message)
-> ([(i, i, n)] -> [Datum]) -> [(i, i, n)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum)
-> (i -> Datum) -> (n -> Datum) -> [(i, i, n)] -> [Datum]
forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples i -> Datum
forall t. Integral t => t -> Datum
int32 i -> Datum
forall t. Integral t => t -> Datum
int32 n -> Datum
forall n. Real n => n -> Datum
float
c_get :: Integral i => [i] -> Message
c_get :: forall i. Integral i => [i] -> Message
c_get = String -> [Datum] -> Message
message String
"/c_get" ([Datum] -> Message) -> ([i] -> [Datum]) -> [i] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32
c_getn :: Integral i => [(i, i)] -> Message
c_getn :: forall i. Integral i => [(i, i)] -> Message
c_getn = String -> [Datum] -> Message
message String
"/c_getn" ([Datum] -> Message)
-> ([(i, i)] -> [Datum]) -> [(i, i)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> (i -> Datum) -> [(i, i)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
int32 i -> Datum
forall t. Integral t => t -> Datum
int32
c_set :: (Integral i, Real n) => [(i, n)] -> Message
c_set :: forall i n. (Integral i, Real n) => [(i, n)] -> Message
c_set = String -> [Datum] -> Message
message String
"/c_set" ([Datum] -> Message)
-> ([(i, n)] -> [Datum]) -> [(i, n)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> (n -> Datum) -> [(i, n)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
int32 n -> Datum
forall n. Real n => n -> Datum
float
c_setn :: (Integral i, Real n) => [(i, [n])] -> Message
c_setn :: forall i n. (Integral i, Real n) => [(i, [n])] -> Message
c_setn [(i, [n])]
l =
let f :: (n, [a]) -> [Datum]
f (n
i, [a]
d) = n -> Datum
forall t. Integral t => t -> Datum
int32 n
i Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: Int -> Datum
forall t. Integral t => t -> Datum
int32 ([a] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
d) Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (a -> Datum) -> [a] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map a -> Datum
forall n. Real n => n -> Datum
float [a]
d
in String -> [Datum] -> Message
message String
"/c_setn" (((i, [n]) -> [Datum]) -> [(i, [n])] -> [Datum]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (i, [n]) -> [Datum]
forall {n} {a}. (Integral n, Real a) => (n, [a]) -> [Datum]
f [(i, [n])]
l)
d_recv_bytes :: Blob -> Message
d_recv_bytes :: Blob -> Message
d_recv_bytes Blob
b = String -> [Datum] -> Message
message String
"/d_recv" [Blob -> Datum
Blob Blob
b]
d_recv_gr :: Server.Graphdef.Graphdef -> Message
d_recv_gr :: Graphdef -> Message
d_recv_gr = Blob -> Message
d_recv_bytes (Blob -> Message) -> (Graphdef -> Blob) -> Graphdef -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Graphdef -> Blob
Server.Graphdef.encode_graphdef
d_recv :: Server.Synthdef.Synthdef -> Message
d_recv :: Synthdef -> Message
d_recv = Blob -> Message
d_recv_bytes (Blob -> Message) -> (Synthdef -> Blob) -> Synthdef -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Synthdef -> Blob
Server.Synthdef.synthdefData
d_load :: String -> Message
d_load :: String -> Message
d_load String
p = String -> [Datum] -> Message
message String
"/d_load" [String -> Datum
string String
p]
d_loadDir :: String -> Message
d_loadDir :: String -> Message
d_loadDir String
p = String -> [Datum] -> Message
message String
"/d_loadDir" [String -> Datum
string String
p]
d_free :: [String] -> Message
d_free :: [String] -> Message
d_free = String -> [Datum] -> Message
message String
"/d_free" ([Datum] -> Message)
-> ([String] -> [Datum]) -> [String] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> Datum) -> [String] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map String -> Datum
string
g_deepFree :: Integral i => [i] -> Message
g_deepFree :: forall i. Integral i => [i] -> Message
g_deepFree = String -> [Datum] -> Message
message String
"/g_deepFree" ([Datum] -> Message) -> ([i] -> [Datum]) -> [i] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32
g_freeAll :: Integral i => [i] -> Message
g_freeAll :: forall i. Integral i => [i] -> Message
g_freeAll = String -> [Datum] -> Message
message String
"/g_freeAll" ([Datum] -> Message) -> ([i] -> [Datum]) -> [i] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32
g_head :: Integral i => [(i, i)] -> Message
g_head :: forall i. Integral i => [(i, i)] -> Message
g_head = String -> [Datum] -> Message
message String
"/g_head" ([Datum] -> Message)
-> ([(i, i)] -> [Datum]) -> [(i, i)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> (i -> Datum) -> [(i, i)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
int32 i -> Datum
forall t. Integral t => t -> Datum
int32
g_new :: Integral i => [(i, Server.Enum.AddAction, i)] -> Message
g_new :: forall i. Integral i => [(i, AddAction, i)] -> Message
g_new = String -> [Datum] -> Message
message String
"/g_new" ([Datum] -> Message)
-> ([(i, AddAction, i)] -> [Datum])
-> [(i, AddAction, i)]
-> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum)
-> (AddAction -> Datum)
-> (i -> Datum)
-> [(i, AddAction, i)]
-> [Datum]
forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples i -> Datum
forall t. Integral t => t -> Datum
int32 (Int -> Datum
forall t. Integral t => t -> Datum
int32 (Int -> Datum) -> (AddAction -> Int) -> AddAction -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AddAction -> Int
forall a. Enum a => a -> Int
fromEnum) i -> Datum
forall t. Integral t => t -> Datum
int32
g_tail :: Integral i => [(i, i)] -> Message
g_tail :: forall i. Integral i => [(i, i)] -> Message
g_tail = String -> [Datum] -> Message
message String
"/g_tail" ([Datum] -> Message)
-> ([(i, i)] -> [Datum]) -> [(i, i)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> (i -> Datum) -> [(i, i)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
int32 i -> Datum
forall t. Integral t => t -> Datum
int32
g_dumpTree :: Integral i => [(i, Bool)] -> Message
g_dumpTree :: forall i. Integral i => [(i, Bool)] -> Message
g_dumpTree = String -> [Datum] -> Message
message String
"/g_dumpTree" ([Datum] -> Message)
-> ([(i, Bool)] -> [Datum]) -> [(i, Bool)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> (Bool -> Datum) -> [(i, Bool)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
int32 (Int -> Datum
forall t. Integral t => t -> Datum
int32 (Int -> Datum) -> (Bool -> Int) -> Bool -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum)
g_queryTree :: Integral i => [(i, Bool)] -> Message
g_queryTree :: forall i. Integral i => [(i, Bool)] -> Message
g_queryTree = String -> [Datum] -> Message
message String
"/g_queryTree" ([Datum] -> Message)
-> ([(i, Bool)] -> [Datum]) -> [(i, Bool)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> (Bool -> Datum) -> [(i, Bool)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
int32 (Int -> Datum
forall t. Integral t => t -> Datum
int32 (Int -> Datum) -> (Bool -> Int) -> Bool -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum)
n_id :: Integral t => t -> Datum
n_id :: forall t. Integral t => t -> Datum
n_id = t -> Datum
forall t. Integral t => t -> Datum
int32 (t -> Datum) -> (t -> t) -> t -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> (t -> Bool) -> t -> t
forall t. String -> (t -> Bool) -> t -> t
cmd_check_arg String
"node-id < -1?" (t -> t -> Bool
forall a. Ord a => a -> a -> Bool
>= (-t
1))
n_after :: Integral i => [(i, i)] -> Message
n_after :: forall i. Integral i => [(i, i)] -> Message
n_after = String -> [Datum] -> Message
message String
"/n_after" ([Datum] -> Message)
-> ([(i, i)] -> [Datum]) -> [(i, i)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> (i -> Datum) -> [(i, i)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
n_id i -> Datum
forall t. Integral t => t -> Datum
n_id
n_before :: Integral i => [(i, i)] -> Message
n_before :: forall i. Integral i => [(i, i)] -> Message
n_before = String -> [Datum] -> Message
message String
"/n_before" ([Datum] -> Message)
-> ([(i, i)] -> [Datum]) -> [(i, i)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> (i -> Datum) -> [(i, i)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
int32 i -> Datum
forall t. Integral t => t -> Datum
int32
n_fill :: (Integral i, Real f) => i -> [(String, i, f)] -> Message
n_fill :: forall i f.
(Integral i, Real f) =>
i -> [(String, i, f)] -> Message
n_fill i
n [(String, i, f)]
l = String -> [Datum] -> Message
message String
"/n_fill" (i -> Datum
forall t. Integral t => t -> Datum
n_id i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (String -> Datum)
-> (i -> Datum) -> (f -> Datum) -> [(String, i, f)] -> [Datum]
forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples String -> Datum
string i -> Datum
forall t. Integral t => t -> Datum
int32 f -> Datum
forall n. Real n => n -> Datum
float [(String, i, f)]
l)
n_free :: Integral i => [i] -> Message
n_free :: forall i. Integral i => [i] -> Message
n_free = String -> [Datum] -> Message
message String
"/n_free" ([Datum] -> Message) -> ([i] -> [Datum]) -> [i] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
n_id
n_map :: Integral i => i -> [(String, i)] -> Message
n_map :: forall i. Integral i => i -> [(String, i)] -> Message
n_map i
n [(String, i)]
l = String -> [Datum] -> Message
message String
"/n_map" (i -> Datum
forall t. Integral t => t -> Datum
n_id i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (String -> Datum) -> (i -> Datum) -> [(String, i)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples String -> Datum
string i -> Datum
forall t. Integral t => t -> Datum
int32 [(String, i)]
l)
n_mapn :: Integral i => i -> [(i, i, i)] -> Message
n_mapn :: forall i. Integral i => i -> [(i, i, i)] -> Message
n_mapn i
n [(i, i, i)]
l = String -> [Datum] -> Message
message String
"/n_mapn" (i -> Datum
forall t. Integral t => t -> Datum
n_id i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (i -> Datum)
-> (i -> Datum) -> (i -> Datum) -> [(i, i, i)] -> [Datum]
forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples i -> Datum
forall t. Integral t => t -> Datum
int32 i -> Datum
forall t. Integral t => t -> Datum
int32 i -> Datum
forall t. Integral t => t -> Datum
int32 [(i, i, i)]
l)
n_mapa :: Integral i => i -> [(String, i)] -> Message
n_mapa :: forall i. Integral i => i -> [(String, i)] -> Message
n_mapa i
n [(String, i)]
l = String -> [Datum] -> Message
message String
"/n_mapa" (i -> Datum
forall t. Integral t => t -> Datum
n_id i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (String -> Datum) -> (i -> Datum) -> [(String, i)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples String -> Datum
string i -> Datum
forall t. Integral t => t -> Datum
int32 [(String, i)]
l)
n_mapan :: Integral i => i -> [(String, i, i)] -> Message
n_mapan :: forall i. Integral i => i -> [(String, i, i)] -> Message
n_mapan i
n [(String, i, i)]
l = String -> [Datum] -> Message
message String
"/n_mapan" (i -> Datum
forall t. Integral t => t -> Datum
n_id i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (String -> Datum)
-> (i -> Datum) -> (i -> Datum) -> [(String, i, i)] -> [Datum]
forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples String -> Datum
string i -> Datum
forall t. Integral t => t -> Datum
int32 i -> Datum
forall t. Integral t => t -> Datum
int32 [(String, i, i)]
l)
n_query :: Integral i => [i] -> Message
n_query :: forall i. Integral i => [i] -> Message
n_query = String -> [Datum] -> Message
message String
"/n_query" ([Datum] -> Message) -> ([i] -> [Datum]) -> [i] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
n_id
n_run :: Integral i => [(i, Bool)] -> Message
n_run :: forall i. Integral i => [(i, Bool)] -> Message
n_run = String -> [Datum] -> Message
message String
"/n_run" ([Datum] -> Message)
-> ([(i, Bool)] -> [Datum]) -> [(i, Bool)] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> (Bool -> Datum) -> [(i, Bool)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples i -> Datum
forall t. Integral t => t -> Datum
n_id (Int -> Datum
forall t. Integral t => t -> Datum
int32 (Int -> Datum) -> (Bool -> Int) -> Bool -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum)
n_set :: (Integral i, Real n) => i -> [(String, n)] -> Message
n_set :: forall i n. (Integral i, Real n) => i -> [(String, n)] -> Message
n_set i
n [(String, n)]
c = String -> [Datum] -> Message
message String
"/n_set" (i -> Datum
forall t. Integral t => t -> Datum
n_id i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (String -> Datum) -> (n -> Datum) -> [(String, n)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples String -> Datum
string n -> Datum
forall n. Real n => n -> Datum
float [(String, n)]
c)
n_setn :: (Integral i, Real n) => i -> [(i, [n])] -> Message
n_setn :: forall i n. (Integral i, Real n) => i -> [(i, [n])] -> Message
n_setn i
n [(i, [n])]
l =
let f :: (n, [a]) -> [Datum]
f (n
s, [a]
d) = n -> Datum
forall t. Integral t => t -> Datum
int32 n
s Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: Int -> Datum
forall t. Integral t => t -> Datum
int32 ([a] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
d) Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (a -> Datum) -> [a] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map a -> Datum
forall n. Real n => n -> Datum
float [a]
d
in String -> [Datum] -> Message
message String
"/n_setn" (i -> Datum
forall t. Integral t => t -> Datum
n_id i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: ((i, [n]) -> [Datum]) -> [(i, [n])] -> [Datum]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (i, [n]) -> [Datum]
forall {n} {a}. (Integral n, Real a) => (n, [a]) -> [Datum]
f [(i, [n])]
l)
n_trace :: Integral i => [i] -> Message
n_trace :: forall i. Integral i => [i] -> Message
n_trace = String -> [Datum] -> Message
message String
"/n_trace" ([Datum] -> Message) -> ([i] -> [Datum]) -> [i] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32
n_order :: Integral i => Server.Enum.AddAction -> i -> [i] -> Message
n_order :: forall i. Integral i => AddAction -> i -> [i] -> Message
n_order AddAction
a i
n [i]
ns = String -> [Datum] -> Message
message String
"/n_order" (Int -> Datum
forall t. Integral t => t -> Datum
int32 (AddAction -> Int
forall a. Enum a => a -> Int
fromEnum AddAction
a) Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: i -> Datum
forall t. Integral t => t -> Datum
int32 i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32 [i]
ns)
p_new :: Integral i => [(i, Server.Enum.AddAction, i)] -> Message
p_new :: forall i. Integral i => [(i, AddAction, i)] -> Message
p_new = String -> [Datum] -> Message
message String
"/p_new" ([Datum] -> Message)
-> ([(i, AddAction, i)] -> [Datum])
-> [(i, AddAction, i)]
-> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum)
-> (AddAction -> Datum)
-> (i -> Datum)
-> [(i, AddAction, i)]
-> [Datum]
forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples i -> Datum
forall t. Integral t => t -> Datum
int32 (Int -> Datum
forall t. Integral t => t -> Datum
int32 (Int -> Datum) -> (AddAction -> Int) -> AddAction -> Datum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AddAction -> Int
forall a. Enum a => a -> Int
fromEnum) i -> Datum
forall t. Integral t => t -> Datum
int32
s_get :: Integral i => i -> [String] -> Message
s_get :: forall i. Integral i => i -> [String] -> Message
s_get i
n [String]
i = String -> [Datum] -> Message
message String
"/s_get" (i -> Datum
forall t. Integral t => t -> Datum
n_id i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (String -> Datum) -> [String] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map String -> Datum
string [String]
i)
s_getn :: Integral i => i -> [(String, i)] -> Message
s_getn :: forall i. Integral i => i -> [(String, i)] -> Message
s_getn i
n [(String, i)]
l = String -> [Datum] -> Message
message String
"/s_getn" (i -> Datum
forall t. Integral t => t -> Datum
n_id i
n Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (String -> Datum) -> (i -> Datum) -> [(String, i)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples String -> Datum
string i -> Datum
forall t. Integral t => t -> Datum
int32 [(String, i)]
l)
s_new :: (Integral i, Real n) => String -> i -> Server.Enum.AddAction -> i -> [(String, n)] -> Message
s_new :: forall i n.
(Integral i, Real n) =>
String -> i -> AddAction -> i -> [(String, n)] -> Message
s_new String
synthdefName i
nodeId AddAction
addAction i
targetId [(String, n)]
controlValues =
String -> [Datum] -> Message
message
String
"/s_new"
( String -> Datum
string String
synthdefName
Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: i -> Datum
forall t. Integral t => t -> Datum
int32 i
nodeId
Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: Int -> Datum
forall t. Integral t => t -> Datum
int32 (AddAction -> Int
forall a. Enum a => a -> Int
fromEnum AddAction
addAction)
Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: i -> Datum
forall t. Integral t => t -> Datum
int32 i
targetId
Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
: (String -> Datum) -> (n -> Datum) -> [(String, n)] -> [Datum]
forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples String -> Datum
string n -> Datum
forall n. Real n => n -> Datum
float [(String, n)]
controlValues
)
s_noid :: Integral i => [i] -> Message
s_noid :: forall i. Integral i => [i] -> Message
s_noid = String -> [Datum] -> Message
message String
"/s_noid" ([Datum] -> Message) -> ([i] -> [Datum]) -> [i] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32
u_cmd :: Integral i => i -> i -> String -> [Datum] -> Message
u_cmd :: forall i. Integral i => i -> i -> String -> [Datum] -> Message
u_cmd i
n i
uid String
name [Datum]
arg = String -> [Datum] -> Message
message String
"/u_cmd" ([i -> Datum
forall t. Integral t => t -> Datum
n_id i
n, i -> Datum
forall t. Integral t => t -> Datum
int32 i
uid, String -> Datum
string String
name] [Datum] -> [Datum] -> [Datum]
forall a. [a] -> [a] -> [a]
++ [Datum]
arg)
cmd :: String -> [Datum] -> Message
cmd :: String -> [Datum] -> Message
cmd String
name = String -> [Datum] -> Message
message String
"/cmd" ([Datum] -> Message) -> ([Datum] -> [Datum]) -> [Datum] -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> Datum
string String
name Datum -> [Datum] -> [Datum]
forall a. a -> [a] -> [a]
:)
clearSched :: Message
clearSched :: Message
clearSched = String -> [Datum] -> Message
message String
"/clearSched" []
dumpOsc :: Server.Enum.PrintLevel -> Message
dumpOsc :: PrintLevel -> Message
dumpOsc PrintLevel
c = String -> [Datum] -> Message
message String
"/dumpOSC" [Int -> Datum
forall t. Integral t => t -> Datum
int32 (PrintLevel -> Int
forall a. Enum a => a -> Int
fromEnum PrintLevel
c)]
errorMode :: Server.Enum.ErrorScope -> Server.Enum.ErrorMode -> Message
errorMode :: ErrorScope -> ErrorMode -> Message
errorMode ErrorScope
scope ErrorMode
mode =
let e :: Int
e = case ErrorScope
scope of
ErrorScope
Server.Enum.Globally -> ErrorMode -> Int
forall a. Enum a => a -> Int
fromEnum ErrorMode
mode
ErrorScope
Server.Enum.Locally -> -Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
- ErrorMode -> Int
forall a. Enum a => a -> Int
fromEnum ErrorMode
mode
in String -> [Datum] -> Message
message String
"/error" [Int -> Datum
forall t. Integral t => t -> Datum
int32 Int
e]
notify :: Bool -> Message
notify :: Bool -> Message
notify Bool
c = String -> [Datum] -> Message
message String
"/notify" [Int -> Datum
forall t. Integral t => t -> Datum
int32 (Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
c)]
nrt_end :: Message
nrt_end :: Message
nrt_end = String -> [Datum] -> Message
message String
"/nrt_end" []
quit :: Message
quit :: Message
quit = String -> [Datum] -> Message
message String
"/quit" []
status :: Message
status :: Message
status = String -> [Datum] -> Message
message String
"/status" []
sync :: Integral i => i -> Message
sync :: forall i. Integral i => i -> Message
sync i
sid = String -> [Datum] -> Message
message String
"/sync" [i -> Datum
forall t. Integral t => t -> Datum
int32 i
sid]
b_alloc_setn1 :: (Integral i, Real n) => i -> i -> [n] -> Message
b_alloc_setn1 :: forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_alloc_setn1 i
b i
i [n]
xs =
let k :: i
k = i
i i -> i -> i
forall a. Num a => a -> a -> a
+ [n] -> i
forall i a. Num i => [a] -> i
genericLength [n]
xs
xs' :: [n]
xs' = i -> n -> [n]
forall i a. Integral i => i -> a -> [a]
genericReplicate i
i n
0 [n] -> [n] -> [n]
forall a. [a] -> [a] -> [a]
++ [n]
xs
in Message -> Message -> Message
Server.Command.Completion.withCm (i -> i -> i -> Message
forall i. Integral i => i -> i -> i -> Message
b_alloc i
b i
k i
1) (i -> i -> [n] -> Message
forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_setn1 i
b i
0 [n]
xs')
b_getn1 :: Integral i => i -> (i, i) -> Message
b_getn1 :: forall i. Integral i => i -> (i, i) -> Message
b_getn1 i
b = i -> [(i, i)] -> Message
forall i. Integral i => i -> [(i, i)] -> Message
b_getn i
b ([(i, i)] -> Message) -> ((i, i) -> [(i, i)]) -> (i, i) -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i, i) -> [(i, i)]
forall a. a -> [a]
forall (m :: * -> *) a. Monad m => a -> m a
return
b_query1 :: Integral i => i -> Message
b_query1 :: forall i. Integral i => i -> Message
b_query1 = [i] -> Message
forall i. Integral i => [i] -> Message
b_query ([i] -> Message) -> (i -> [i]) -> i -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. i -> [i]
forall a. a -> [a]
forall (m :: * -> *) a. Monad m => a -> m a
return
b_set1 :: (Integral i, Real n) => i -> i -> n -> Message
b_set1 :: forall i n. (Integral i, Real n) => i -> i -> n -> Message
b_set1 i
b i
i n
x = i -> [(i, n)] -> Message
forall i n. (Integral i, Real n) => i -> [(i, n)] -> Message
b_set i
b [(i
i, n
x)]
b_setn1 :: (Integral i, Real n) => i -> i -> [n] -> Message
b_setn1 :: forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_setn1 i
b i
i [n]
xs = i -> [(i, [n])] -> Message
forall i n. (Integral i, Real n) => i -> [(i, [n])] -> Message
b_setn i
b [(i
i, [n]
xs)]
b_setn1_segmented :: (Integral i, Real n) => i -> i -> i -> [n] -> [Message]
b_setn1_segmented :: forall i n. (Integral i, Real n) => i -> i -> i -> [n] -> [Message]
b_setn1_segmented i
k i
b i
i [n]
d =
if [n] -> i
forall i a. Num i => [a] -> i
genericLength [n]
d i -> i -> Bool
forall a. Ord a => a -> a -> Bool
< i
k
then [i -> i -> [n] -> Message
forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_setn1 i
b i
i [n]
d]
else i -> i -> [n] -> Message
forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_setn1 i
b i
i (i -> [n] -> [n]
forall i a. Integral i => i -> [a] -> [a]
genericTake i
k [n]
d) Message -> [Message] -> [Message]
forall a. a -> [a] -> [a]
: i -> i -> i -> [n] -> [Message]
forall i n. (Integral i, Real n) => i -> i -> i -> [n] -> [Message]
b_setn1_segmented i
k i
b (i
i i -> i -> i
forall a. Num a => a -> a -> a
+ i
k) (i -> [n] -> [n]
forall i a. Integral i => i -> [a] -> [a]
genericDrop i
k [n]
d)
c_getn1 :: Integral i => (i, i) -> Message
c_getn1 :: forall i. Integral i => (i, i) -> Message
c_getn1 = [(i, i)] -> Message
forall i. Integral i => [(i, i)] -> Message
c_getn ([(i, i)] -> Message) -> ((i, i) -> [(i, i)]) -> (i, i) -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i, i) -> [(i, i)]
forall a. a -> [a]
forall (m :: * -> *) a. Monad m => a -> m a
return
c_set1 :: (Integral i, Real n) => i -> n -> Message
c_set1 :: forall i n. (Integral i, Real n) => i -> n -> Message
c_set1 i
i n
x = [(i, n)] -> Message
forall i n. (Integral i, Real n) => [(i, n)] -> Message
c_set [(i
i, n
x)]
c_setn1 :: (Integral i, Real n) => (i, [n]) -> Message
c_setn1 :: forall i n. (Integral i, Real n) => (i, [n]) -> Message
c_setn1 = [(i, [n])] -> Message
forall i n. (Integral i, Real n) => [(i, [n])] -> Message
c_setn ([(i, [n])] -> Message)
-> ((i, [n]) -> [(i, [n])]) -> (i, [n]) -> Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (i, [n]) -> [(i, [n])]
forall a. a -> [a]
forall (m :: * -> *) a. Monad m => a -> m a
return
n_run1 :: Integral i => i -> Bool -> Message
n_run1 :: forall i. Integral i => i -> Bool -> Message
n_run1 i
n Bool
k = [(i, Bool)] -> Message
forall i. Integral i => [(i, Bool)] -> Message
n_run [(i
n, Bool
k)]
n_set1 :: (Integral i, Real n) => i -> String -> n -> Message
n_set1 :: forall i n. (Integral i, Real n) => i -> String -> n -> Message
n_set1 i
n String
k n
v = i -> [(String, n)] -> Message
forall i n. (Integral i, Real n) => i -> [(String, n)] -> Message
n_set i
n [(String
k, n
v)]
s_new0 :: Integral i => String -> i -> Server.Enum.AddAction -> i -> Message
s_new0 :: forall i. Integral i => String -> i -> AddAction -> i -> Message
s_new0 String
n i
i AddAction
a i
t = String -> i -> AddAction -> i -> [(String, Double)] -> Message
forall i n.
(Integral i, Real n) =>
String -> i -> AddAction -> i -> [(String, n)] -> Message
s_new String
n i
i AddAction
a i
t ([] :: [(String, Double)])
b_segment :: Integral i => i -> i -> [i]
b_segment :: forall i. Integral i => i -> i -> [i]
b_segment i
n i
m =
let (i
q, i
r) = i
m i -> i -> (i, i)
forall a. Integral a => a -> a -> (a, a)
`quotRem` i
n
s :: [i]
s = i -> i -> [i]
forall i a. Integral i => i -> a -> [a]
genericReplicate i
q i
n
in if i
r i -> i -> Bool
forall a. Eq a => a -> a -> Bool
== i
0 then [i]
s else i
r i -> [i] -> [i]
forall a. a -> [a] -> [a]
: [i]
s
b_indices :: Integral i => i -> i -> i -> [(i, i)]
b_indices :: forall i. Integral i => i -> i -> i -> [(i, i)]
b_indices i
n i
m i
k =
let s :: [i]
s = i -> i -> [i]
forall i. Integral i => i -> i -> [i]
b_segment i
n i
m
i :: [i]
i = i
0 i -> [i] -> [i]
forall a. a -> [a] -> [a]
: [i] -> [i]
forall n. Num n => [n] -> [n]
Common.Base.dx_d [i]
s
in [i] -> [i] -> [(i, i)]
forall a b. [a] -> [b] -> [(a, b)]
zip ((i -> i) -> [i] -> [i]
forall a b. (a -> b) -> [a] -> [b]
map (i -> i -> i
forall a. Num a => a -> a -> a
+ i
k) [i]
i) [i]
s
partConv_preparePartConv :: Integral i => i -> i -> i -> Message
partConv_preparePartConv :: forall i. Integral i => i -> i -> i -> Message
partConv_preparePartConv i
b i
irb i
fft_size = i -> String -> [Datum] -> Message
forall i. Integral i => i -> String -> [Datum] -> Message
b_gen i
b String
"PreparePartConv" ((i -> Datum) -> [i] -> [Datum]
forall a b. (a -> b) -> [a] -> [b]
map i -> Datum
forall t. Integral t => t -> Datum
int32 [i
irb, i
fft_size])
unpack_n_info_datum_plain :: Num i => [Datum] -> [i]
unpack_n_info_datum_plain :: forall i. Num i => [Datum] -> [i]
unpack_n_info_datum_plain [Datum]
m =
let to_i :: Int32 -> i
to_i = Int32 -> i
forall a b. (Integral a, Num b) => a -> b
fromIntegral
in case [Datum]
m of
[Int32 Int32
i1, Int32 Int32
i2, Int32 Int32
i3, Int32 Int32
i4, Int32 Int32
i5] -> [Int32 -> i
to_i Int32
i1, Int32 -> i
to_i Int32
i2, Int32 -> i
to_i Int32
i3, Int32 -> i
to_i Int32
i4, Int32 -> i
to_i Int32
i5]
[Int32 Int32
i1, Int32 Int32
i2, Int32 Int32
i3, Int32 Int32
i4, Int32 Int32
i5, Int32 Int32
i6, Int32 Int32
i7] -> [Int32 -> i
to_i Int32
i1, Int32 -> i
to_i Int32
i2, Int32 -> i
to_i Int32
i3, Int32 -> i
to_i Int32
i4, Int32 -> i
to_i Int32
i5, Int32 -> i
to_i Int32
i6, Int32 -> i
to_i Int32
i7]
[Datum]
_ -> []
unpack_n_info_plain :: Num i => Message -> [i]
unpack_n_info_plain :: forall i. Num i => Message -> [i]
unpack_n_info_plain Message
m =
case Message
m of
Message String
"/n_info" [Datum]
dat -> [Datum] -> [i]
forall i. Num i => [Datum] -> [i]
unpack_n_info_datum_plain [Datum]
dat
Message
_ -> []
unpack_n_info :: Num i => Message -> Maybe (i, i, i, i, i, Maybe (i, i))
unpack_n_info :: forall i. Num i => Message -> Maybe (i, i, i, i, i, Maybe (i, i))
unpack_n_info Message
m =
case Message -> [i]
forall i. Num i => Message -> [i]
unpack_n_info_plain Message
m of
[i
i1, i
i2, i
i3, i
i4, i
i5] -> (i, i, i, i, i, Maybe (i, i))
-> Maybe (i, i, i, i, i, Maybe (i, i))
forall a. a -> Maybe a
Just (i
i1, i
i2, i
i3, i
i4, i
i5, Maybe (i, i)
forall a. Maybe a
Nothing)
[i
i1, i
i2, i
i3, i
i4, i
i5, i
i6, i
i7] -> (i, i, i, i, i, Maybe (i, i))
-> Maybe (i, i, i, i, i, Maybe (i, i))
forall a. a -> Maybe a
Just (i
i1, i
i2, i
i3, i
i4, i
i5, (i, i) -> Maybe (i, i)
forall a. a -> Maybe a
Just (i
i6, i
i7))
[i]
_ -> Maybe (i, i, i, i, i, Maybe (i, i))
forall a. Maybe a
Nothing
unpack_n_info_err :: Num i => Message -> (i, i, i, i, i, Maybe (i, i))
unpack_n_info_err :: forall i. Num i => Message -> (i, i, i, i, i, Maybe (i, i))
unpack_n_info_err = (i, i, i, i, i, Maybe (i, i))
-> Maybe (i, i, i, i, i, Maybe (i, i))
-> (i, i, i, i, i, Maybe (i, i))
forall a. a -> Maybe a -> a
fromMaybe (String -> (i, i, i, i, i, Maybe (i, i))
forall a. HasCallStack => String -> a
error String
"unpack_n_info") (Maybe (i, i, i, i, i, Maybe (i, i))
-> (i, i, i, i, i, Maybe (i, i)))
-> (Message -> Maybe (i, i, i, i, i, Maybe (i, i)))
-> Message
-> (i, i, i, i, i, Maybe (i, i))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Message -> Maybe (i, i, i, i, i, Maybe (i, i))
forall i. Num i => Message -> Maybe (i, i, i, i, i, Maybe (i, i))
unpack_n_info
unpack_tr :: (Num i, Fractional f) => Message -> Maybe (i, i, f)
unpack_tr :: forall i f. (Num i, Fractional f) => Message -> Maybe (i, i, f)
unpack_tr Message
m =
let to_i :: Int32 -> i
to_i = Int32 -> i
forall a b. (Integral a, Num b) => a -> b
fromIntegral
to_f :: Float -> f
to_f = Float -> f
forall a b. (Real a, Fractional b) => a -> b
realToFrac
in case Message
m of
Message String
"/tr" [Int32 Int32
p, Int32 Int32
q, Float Float
r] -> (i, i, f) -> Maybe (i, i, f)
forall a. a -> Maybe a
Just (Int32 -> i
to_i Int32
p, Int32 -> i
to_i Int32
q, Float -> f
to_f Float
r)
Message
_ -> Maybe (i, i, f)
forall a. Maybe a
Nothing
unpack_tr_err :: (Num i, Fractional f) => Message -> (i, i, f)
unpack_tr_err :: forall i f. (Num i, Fractional f) => Message -> (i, i, f)
unpack_tr_err = (i, i, f) -> Maybe (i, i, f) -> (i, i, f)
forall a. a -> Maybe a -> a
fromMaybe (String -> (i, i, f)
forall a. HasCallStack => String -> a
error String
"unpack_tr") (Maybe (i, i, f) -> (i, i, f))
-> (Message -> Maybe (i, i, f)) -> Message -> (i, i, f)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Message -> Maybe (i, i, f)
forall i f. (Num i, Fractional f) => Message -> Maybe (i, i, f)
unpack_tr
unpack_b_setn :: (Num i, Fractional f) => Message -> Maybe (i, i, i, [f])
unpack_b_setn :: forall i f.
(Num i, Fractional f) =>
Message -> Maybe (i, i, i, [f])
unpack_b_setn Message
m =
let to_i :: Int32 -> i
to_i = Int32 -> i
forall a b. (Integral a, Num b) => a -> b
fromIntegral
to_f :: Datum -> b
to_f Datum
d = case Datum
d of
Float Float
n -> Float -> b
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
n
Datum
_ -> String -> b
forall a. HasCallStack => String -> a
error String
"unpack_b_setn: non-float data"
in case Message
m of
Message String
"/b_setn" (Int32 Int32
p : Int32 Int32
q : Int32 Int32
r : [Datum]
z) -> (i, i, i, [f]) -> Maybe (i, i, i, [f])
forall a. a -> Maybe a
Just (Int32 -> i
to_i Int32
p, Int32 -> i
to_i Int32
q, Int32 -> i
to_i Int32
r, (Datum -> f) -> [Datum] -> [f]
forall a b. (a -> b) -> [a] -> [b]
map Datum -> f
forall {b}. Fractional b => Datum -> b
to_f [Datum]
z)
Message
_ -> Maybe (i, i, i, [f])
forall a. Maybe a
Nothing
unpack_b_setn_err :: (Num i, Fractional f) => Message -> (i, i, i, [f])
unpack_b_setn_err :: forall i f. (Num i, Fractional f) => Message -> (i, i, i, [f])
unpack_b_setn_err = (i, i, i, [f]) -> Maybe (i, i, i, [f]) -> (i, i, i, [f])
forall a. a -> Maybe a -> a
fromMaybe (String -> (i, i, i, [f])
forall a. HasCallStack => String -> a
error String
"unpack_b_setn") (Maybe (i, i, i, [f]) -> (i, i, i, [f]))
-> (Message -> Maybe (i, i, i, [f])) -> Message -> (i, i, i, [f])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Message -> Maybe (i, i, i, [f])
forall i f.
(Num i, Fractional f) =>
Message -> Maybe (i, i, i, [f])
unpack_b_setn
unpack_b_info :: (Num i, Fractional f) => Message -> Maybe (i, i, i, f)
unpack_b_info :: forall i f. (Num i, Fractional f) => Message -> Maybe (i, i, i, f)
unpack_b_info Message
m =
let to_i :: Int32 -> i
to_i = Int32 -> i
forall a b. (Integral a, Num b) => a -> b
fromIntegral
to_f :: Float -> f
to_f = Float -> f
forall a b. (Real a, Fractional b) => a -> b
realToFrac
in case Message
m of
Message String
"/b_info" [Int32 Int32
p, Int32 Int32
q, Int32 Int32
r, Float Float
s] -> (i, i, i, f) -> Maybe (i, i, i, f)
forall a. a -> Maybe a
Just (Int32 -> i
to_i Int32
p, Int32 -> i
to_i Int32
q, Int32 -> i
to_i Int32
r, Float -> f
to_f Float
s)
Message
_ -> Maybe (i, i, i, f)
forall a. Maybe a
Nothing
unpack_b_info_err :: (Num i, Fractional f) => Message -> (i, i, i, f)
unpack_b_info_err :: forall i f. (Num i, Fractional f) => Message -> (i, i, i, f)
unpack_b_info_err = (i, i, i, f) -> Maybe (i, i, i, f) -> (i, i, i, f)
forall a. a -> Maybe a -> a
fromMaybe (String -> (i, i, i, f)
forall a. HasCallStack => String -> a
error String
"unpack_b_info") (Maybe (i, i, i, f) -> (i, i, i, f))
-> (Message -> Maybe (i, i, i, f)) -> Message -> (i, i, i, f)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Message -> Maybe (i, i, i, f)
forall i f. (Num i, Fractional f) => Message -> Maybe (i, i, i, f)
unpack_b_info