/
Params.hs
3371 lines (2895 loc) · 145 KB
/
Params.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
module Sound.Tidal.Params where
-- Please note, this file is generated by bin/generate-params.hs
-- Submit any pull requests against that file and/or params-header.hs
-- in the same folder, thanks.
{-
Params.hs - Provides the basic control patterns available to TidalCycles by default
Copyright (C) 2021, Alex McLean and contributors
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library. If not, see <http://www.gnu.org/licenses/>.
-}
import qualified Data.Map.Strict as Map
import Sound.Tidal.Compose ((#))
import Sound.Tidal.Pattern
import Sound.Tidal.Signal.Base
import Sound.Tidal.Types
import Sound.Tidal.Value
-- import Sound.Tidal.Core ((#))
import Data.Fixed (mod')
import Data.Maybe (fromMaybe)
import Data.Word (Word8)
import Sound.Tidal.Utils
-- | group multiple params into one
grp :: Pattern p => [String -> ValueMap] -> p String -> p ValueMap
grp [] _ = silence
grp fs p = splitby <$> p
where splitby name = Map.unions $ map (\(v, f) -> f v) $ zip (split name) fs
split :: String -> [String]
split = wordsBy (==':')
mF :: String -> String -> ValueMap
mF name v = fromMaybe Map.empty $ do f <- readMaybe v
return $ Map.singleton name (VF f)
mI :: String -> String -> ValueMap
mI name v = fromMaybe Map.empty $ do i <- readMaybe v
return $ Map.singleton name (VI i)
mS :: String -> String -> ValueMap
mS name v = Map.singleton name (VS v)
-- | Param makers
pF :: Pattern p => String -> p Double -> p ValueMap
pF name = fmap (Map.singleton name . VF)
pI :: Pattern p => String -> p Int -> p ValueMap
pI name = fmap (Map.singleton name . VI)
pB :: Pattern p => String -> p Bool -> p ValueMap
pB name = fmap (Map.singleton name . VB)
pR :: Pattern p => String -> p Time -> p ValueMap
pR name = fmap (Map.singleton name . VR)
pN :: Pattern p => String -> p Note -> p ValueMap
pN name = fmap (Map.singleton name . VN)
pS :: Pattern p => String -> p String -> p ValueMap
pS name = fmap (Map.singleton name . VS)
pX :: Pattern p => String -> p [Word8] -> p ValueMap
pX name = fmap (Map.singleton name . VX)
pStateF :: Pattern p => String -> String -> (Maybe Double -> Double) -> p ValueMap
pStateF name sName update = pure $ Map.singleton name $ VState statef
where statef :: ValueMap -> (ValueMap, Value)
statef sMap = (Map.insert sName v sMap, v)
where v = VF $ update $ Map.lookup sName sMap >>= getF
pStateList :: Pattern p => String -> String -> [Value] -> p ValueMap
pStateList name sName xs = pure $ Map.singleton name $ VState statef
where statef :: ValueMap -> (ValueMap, Value)
statef sMap = (Map.insert sName (VList $ tail looped) sMap, head looped)
where xs' = fromMaybe xs (Map.lookup sName sMap >>= getList)
-- do this instead of a cycle, so it can get updated with the a list
looped | null xs' = xs
| otherwise = xs'
pStateListF :: Pattern p => String -> String -> [Double] -> p ValueMap
pStateListF name sName = pStateList name sName . map VF
pStateListS :: Pattern p => String -> String -> [String] -> p ValueMap
pStateListS name sName = pStateList name sName . map VS
-- | Grouped params
sound :: Pattern p => p String -> p ValueMap
sound = grp [mS "s", mF "n"]
sTake :: Pattern p => String -> [String] -> p ValueMap
sTake name xs = pStateListS "s" name xs
cc :: Pattern p => p String -> p ValueMap
cc = grp [mF "ccn", mF "ccv"]
nrpn :: Pattern p => p String -> p ValueMap
nrpn = grp [mI "nrpn", mI "val"]
nrpnn :: Pattern p => p Int -> p ValueMap
nrpnn = pI "nrpn"
nrpnv :: Pattern p => p Int -> p ValueMap
nrpnv = pI "val"
grain' :: Pattern p => p String -> p ValueMap
grain' = grp [mF "begin", mF "end"]
midinote :: Pattern p => p Note -> p ValueMap
midinote = note . (subtract 60 <$>)
drum :: Pattern p => p String -> p ValueMap
drum = n . (subtract 60 . drumN <$>)
drumN :: Num a => String -> a
drumN "hq" = 27
drumN "sl" = 28
drumN "ps" = 29
drumN "pl" = 30
drumN "st" = 31
drumN "sq" = 32
drumN "ml" = 33
drumN "mb" = 34
drumN "ab" = 35
drumN "bd" = 36
drumN "rm" = 37
drumN "sn" = 38
drumN "cp" = 39
drumN "es" = 40
drumN "lf" = 41
drumN "ch" = 42
drumN "lt" = 43
drumN "hh" = 44
drumN "ft" = 45
drumN "oh" = 46
drumN "mt" = 47
drumN "hm" = 48
drumN "cr" = 49
drumN "ht" = 50
drumN "ri" = 51
drumN "cy" = 52
drumN "be" = 53
drumN "ta" = 54
drumN "sc" = 55
drumN "cb" = 56
drumN "cs" = 57
drumN "vi" = 58
drumN "rc" = 59
drumN "hb" = 60
drumN "lb" = 61
drumN "mh" = 62
drumN "hc" = 63
drumN "lc" = 64
drumN "he" = 65
drumN "le" = 66
drumN "ag" = 67
drumN "la" = 68
drumN "ca" = 69
drumN "ma" = 70
drumN "sw" = 71
drumN "lw" = 72
drumN "sg" = 73
drumN "lg" = 74
drumN "cl" = 75
drumN "hi" = 76
drumN "li" = 77
drumN "mc" = 78
drumN "oc" = 79
drumN "tr" = 80
drumN "ot" = 81
drumN "sh" = 82
drumN "jb" = 83
drumN "bt" = 84
drumN "ct" = 85
drumN "ms" = 86
drumN "os" = 87
drumN _ = 0
-- Generated params
-- | a pattern of numbers that speed up (or slow down) samples while they play.
accelerate :: Pattern p => p Double -> p ValueMap
accelerate = pF "accelerate"
accelerateTake :: Pattern p => String -> [Double] -> p ValueMap
accelerateTake name xs = pStateListF "accelerate" name xs
accelerateCount :: Pattern p => String -> p ValueMap
accelerateCount name = pStateF "accelerate" name (maybe 0 (+1))
accelerateCountTo :: Pattern p => String -> p Double -> p ValueMap
accelerateCountTo name ipat = innerJoin $ (\i -> pStateF "accelerate" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
acceleratebus :: Pattern p => p Int -> p Double -> p ValueMap
acceleratebus _ _ = error "Control parameter 'accelerate' can't be sent to a bus."
-- | like @gain@, but linear.
amp :: Pattern p => p Double -> p ValueMap
amp = pF "amp"
ampTake :: Pattern p => String -> [Double] -> p ValueMap
ampTake name xs = pStateListF "amp" name xs
ampCount :: Pattern p => String -> p ValueMap
ampCount name = pStateF "amp" name (maybe 0 (+1))
ampCountTo :: Pattern p => String -> p Double -> p ValueMap
ampCountTo name ipat = innerJoin $ (\i -> pStateF "amp" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
ampbus :: Pattern p => p Int -> p Double -> p ValueMap
ampbus busid pat = pF "amp" pat # pI "^amp" busid
amprecv :: Pattern p => p Int -> p ValueMap
amprecv busid = pI "^amp" busid
-- |
array :: Pattern p => p [Word8] -> p ValueMap
array = pX "array"
arrayTake :: Pattern p => String -> [Double] -> p ValueMap
arrayTake name xs = pStateListF "array" name xs
arraybus :: Pattern p => p Int -> p [Word8] -> p ValueMap
arraybus _ _ = error "Control parameter 'array' can't be sent to a bus."
-- | a pattern of numbers to specify the attack time (in seconds) of an envelope applied to each sample.
attack :: Pattern p => p Double -> p ValueMap
attack = pF "attack"
attackTake :: Pattern p => String -> [Double] -> p ValueMap
attackTake name xs = pStateListF "attack" name xs
attackCount :: Pattern p => String -> p ValueMap
attackCount name = pStateF "attack" name (maybe 0 (+1))
attackCountTo :: Pattern p => String -> p Double -> p ValueMap
attackCountTo name ipat = innerJoin $ (\i -> pStateF "attack" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
attackbus :: Pattern p => p Int -> p Double -> p ValueMap
attackbus busid pat = pF "attack" pat # pI "^attack" busid
attackrecv :: Pattern p => p Int -> p ValueMap
attackrecv busid = pI "^attack" busid
-- | a pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter.
bandf :: Pattern p => p Double -> p ValueMap
bandf = pF "bandf"
bandfTake :: Pattern p => String -> [Double] -> p ValueMap
bandfTake name xs = pStateListF "bandf" name xs
bandfCount :: Pattern p => String -> p ValueMap
bandfCount name = pStateF "bandf" name (maybe 0 (+1))
bandfCountTo :: Pattern p => String -> p Double -> p ValueMap
bandfCountTo name ipat = innerJoin $ (\i -> pStateF "bandf" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
bandfbus :: Pattern p => p Int -> p Double -> p ValueMap
bandfbus busid pat = pF "bandf" pat # pI "^bandf" busid
bandfrecv :: Pattern p => p Int -> p ValueMap
bandfrecv busid = pI "^bandf" busid
-- | a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter.
bandq :: Pattern p => p Double -> p ValueMap
bandq = pF "bandq"
bandqTake :: Pattern p => String -> [Double] -> p ValueMap
bandqTake name xs = pStateListF "bandq" name xs
bandqCount :: Pattern p => String -> p ValueMap
bandqCount name = pStateF "bandq" name (maybe 0 (+1))
bandqCountTo :: Pattern p => String -> p Double -> p ValueMap
bandqCountTo name ipat = innerJoin $ (\i -> pStateF "bandq" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
bandqbus :: Pattern p => p Int -> p Double -> p ValueMap
bandqbus busid pat = pF "bandq" pat # pI "^bandq" busid
bandqrecv :: Pattern p => p Int -> p ValueMap
bandqrecv busid = pI "^bandq" busid
-- | a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample.
begin :: Pattern p => p Double -> p ValueMap
begin = pF "begin"
beginTake :: Pattern p => String -> [Double] -> p ValueMap
beginTake name xs = pStateListF "begin" name xs
beginCount :: Pattern p => String -> p ValueMap
beginCount name = pStateF "begin" name (maybe 0 (+1))
beginCountTo :: Pattern p => String -> p Double -> p ValueMap
beginCountTo name ipat = innerJoin $ (\i -> pStateF "begin" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
beginbus :: Pattern p => p Int -> p Double -> p ValueMap
beginbus _ _ = error "Control parameter 'begin' can't be sent to a bus."
-- | Spectral binshift
binshift :: Pattern p => p Double -> p ValueMap
binshift = pF "binshift"
binshiftTake :: Pattern p => String -> [Double] -> p ValueMap
binshiftTake name xs = pStateListF "binshift" name xs
binshiftCount :: Pattern p => String -> p ValueMap
binshiftCount name = pStateF "binshift" name (maybe 0 (+1))
binshiftCountTo :: Pattern p => String -> p Double -> p ValueMap
binshiftCountTo name ipat = innerJoin $ (\i -> pStateF "binshift" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
binshiftbus :: Pattern p => p Int -> p Double -> p ValueMap
binshiftbus busid pat = pF "binshift" pat # pI "^binshift" busid
binshiftrecv :: Pattern p => p Int -> p ValueMap
binshiftrecv busid = pI "^binshift" busid
-- |
button0 :: Pattern p => p Double -> p ValueMap
button0 = pF "button0"
button0Take :: Pattern p => String -> [Double] -> p ValueMap
button0Take name xs = pStateListF "button0" name xs
button0Count :: Pattern p => String -> p ValueMap
button0Count name = pStateF "button0" name (maybe 0 (+1))
button0CountTo :: Pattern p => String -> p Double -> p ValueMap
button0CountTo name ipat = innerJoin $ (\i -> pStateF "button0" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button0bus :: Pattern p => p Int -> p Double -> p ValueMap
button0bus busid pat = pF "button0" pat # pI "^button0" busid
button0recv :: Pattern p => p Int -> p ValueMap
button0recv busid = pI "^button0" busid
-- |
button1 :: Pattern p => p Double -> p ValueMap
button1 = pF "button1"
button1Take :: Pattern p => String -> [Double] -> p ValueMap
button1Take name xs = pStateListF "button1" name xs
button1Count :: Pattern p => String -> p ValueMap
button1Count name = pStateF "button1" name (maybe 0 (+1))
button1CountTo :: Pattern p => String -> p Double -> p ValueMap
button1CountTo name ipat = innerJoin $ (\i -> pStateF "button1" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button1bus :: Pattern p => p Int -> p Double -> p ValueMap
button1bus busid pat = pF "button1" pat # pI "^button1" busid
button1recv :: Pattern p => p Int -> p ValueMap
button1recv busid = pI "^button1" busid
-- |
button10 :: Pattern p => p Double -> p ValueMap
button10 = pF "button10"
button10Take :: Pattern p => String -> [Double] -> p ValueMap
button10Take name xs = pStateListF "button10" name xs
button10Count :: Pattern p => String -> p ValueMap
button10Count name = pStateF "button10" name (maybe 0 (+1))
button10CountTo :: Pattern p => String -> p Double -> p ValueMap
button10CountTo name ipat = innerJoin $ (\i -> pStateF "button10" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button10bus :: Pattern p => p Int -> p Double -> p ValueMap
button10bus busid pat = pF "button10" pat # pI "^button10" busid
button10recv :: Pattern p => p Int -> p ValueMap
button10recv busid = pI "^button10" busid
-- |
button11 :: Pattern p => p Double -> p ValueMap
button11 = pF "button11"
button11Take :: Pattern p => String -> [Double] -> p ValueMap
button11Take name xs = pStateListF "button11" name xs
button11Count :: Pattern p => String -> p ValueMap
button11Count name = pStateF "button11" name (maybe 0 (+1))
button11CountTo :: Pattern p => String -> p Double -> p ValueMap
button11CountTo name ipat = innerJoin $ (\i -> pStateF "button11" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button11bus :: Pattern p => p Int -> p Double -> p ValueMap
button11bus busid pat = pF "button11" pat # pI "^button11" busid
button11recv :: Pattern p => p Int -> p ValueMap
button11recv busid = pI "^button11" busid
-- |
button12 :: Pattern p => p Double -> p ValueMap
button12 = pF "button12"
button12Take :: Pattern p => String -> [Double] -> p ValueMap
button12Take name xs = pStateListF "button12" name xs
button12Count :: Pattern p => String -> p ValueMap
button12Count name = pStateF "button12" name (maybe 0 (+1))
button12CountTo :: Pattern p => String -> p Double -> p ValueMap
button12CountTo name ipat = innerJoin $ (\i -> pStateF "button12" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button12bus :: Pattern p => p Int -> p Double -> p ValueMap
button12bus busid pat = pF "button12" pat # pI "^button12" busid
button12recv :: Pattern p => p Int -> p ValueMap
button12recv busid = pI "^button12" busid
-- |
button13 :: Pattern p => p Double -> p ValueMap
button13 = pF "button13"
button13Take :: Pattern p => String -> [Double] -> p ValueMap
button13Take name xs = pStateListF "button13" name xs
button13Count :: Pattern p => String -> p ValueMap
button13Count name = pStateF "button13" name (maybe 0 (+1))
button13CountTo :: Pattern p => String -> p Double -> p ValueMap
button13CountTo name ipat = innerJoin $ (\i -> pStateF "button13" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button13bus :: Pattern p => p Int -> p Double -> p ValueMap
button13bus busid pat = pF "button13" pat # pI "^button13" busid
button13recv :: Pattern p => p Int -> p ValueMap
button13recv busid = pI "^button13" busid
-- |
button14 :: Pattern p => p Double -> p ValueMap
button14 = pF "button14"
button14Take :: Pattern p => String -> [Double] -> p ValueMap
button14Take name xs = pStateListF "button14" name xs
button14Count :: Pattern p => String -> p ValueMap
button14Count name = pStateF "button14" name (maybe 0 (+1))
button14CountTo :: Pattern p => String -> p Double -> p ValueMap
button14CountTo name ipat = innerJoin $ (\i -> pStateF "button14" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button14bus :: Pattern p => p Int -> p Double -> p ValueMap
button14bus busid pat = pF "button14" pat # pI "^button14" busid
button14recv :: Pattern p => p Int -> p ValueMap
button14recv busid = pI "^button14" busid
-- |
button15 :: Pattern p => p Double -> p ValueMap
button15 = pF "button15"
button15Take :: Pattern p => String -> [Double] -> p ValueMap
button15Take name xs = pStateListF "button15" name xs
button15Count :: Pattern p => String -> p ValueMap
button15Count name = pStateF "button15" name (maybe 0 (+1))
button15CountTo :: Pattern p => String -> p Double -> p ValueMap
button15CountTo name ipat = innerJoin $ (\i -> pStateF "button15" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button15bus :: Pattern p => p Int -> p Double -> p ValueMap
button15bus busid pat = pF "button15" pat # pI "^button15" busid
button15recv :: Pattern p => p Int -> p ValueMap
button15recv busid = pI "^button15" busid
-- |
button2 :: Pattern p => p Double -> p ValueMap
button2 = pF "button2"
button2Take :: Pattern p => String -> [Double] -> p ValueMap
button2Take name xs = pStateListF "button2" name xs
button2Count :: Pattern p => String -> p ValueMap
button2Count name = pStateF "button2" name (maybe 0 (+1))
button2CountTo :: Pattern p => String -> p Double -> p ValueMap
button2CountTo name ipat = innerJoin $ (\i -> pStateF "button2" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button2bus :: Pattern p => p Int -> p Double -> p ValueMap
button2bus busid pat = pF "button2" pat # pI "^button2" busid
button2recv :: Pattern p => p Int -> p ValueMap
button2recv busid = pI "^button2" busid
-- |
button3 :: Pattern p => p Double -> p ValueMap
button3 = pF "button3"
button3Take :: Pattern p => String -> [Double] -> p ValueMap
button3Take name xs = pStateListF "button3" name xs
button3Count :: Pattern p => String -> p ValueMap
button3Count name = pStateF "button3" name (maybe 0 (+1))
button3CountTo :: Pattern p => String -> p Double -> p ValueMap
button3CountTo name ipat = innerJoin $ (\i -> pStateF "button3" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button3bus :: Pattern p => p Int -> p Double -> p ValueMap
button3bus busid pat = pF "button3" pat # pI "^button3" busid
button3recv :: Pattern p => p Int -> p ValueMap
button3recv busid = pI "^button3" busid
-- |
button4 :: Pattern p => p Double -> p ValueMap
button4 = pF "button4"
button4Take :: Pattern p => String -> [Double] -> p ValueMap
button4Take name xs = pStateListF "button4" name xs
button4Count :: Pattern p => String -> p ValueMap
button4Count name = pStateF "button4" name (maybe 0 (+1))
button4CountTo :: Pattern p => String -> p Double -> p ValueMap
button4CountTo name ipat = innerJoin $ (\i -> pStateF "button4" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button4bus :: Pattern p => p Int -> p Double -> p ValueMap
button4bus busid pat = pF "button4" pat # pI "^button4" busid
button4recv :: Pattern p => p Int -> p ValueMap
button4recv busid = pI "^button4" busid
-- |
button5 :: Pattern p => p Double -> p ValueMap
button5 = pF "button5"
button5Take :: Pattern p => String -> [Double] -> p ValueMap
button5Take name xs = pStateListF "button5" name xs
button5Count :: Pattern p => String -> p ValueMap
button5Count name = pStateF "button5" name (maybe 0 (+1))
button5CountTo :: Pattern p => String -> p Double -> p ValueMap
button5CountTo name ipat = innerJoin $ (\i -> pStateF "button5" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button5bus :: Pattern p => p Int -> p Double -> p ValueMap
button5bus busid pat = pF "button5" pat # pI "^button5" busid
button5recv :: Pattern p => p Int -> p ValueMap
button5recv busid = pI "^button5" busid
-- |
button6 :: Pattern p => p Double -> p ValueMap
button6 = pF "button6"
button6Take :: Pattern p => String -> [Double] -> p ValueMap
button6Take name xs = pStateListF "button6" name xs
button6Count :: Pattern p => String -> p ValueMap
button6Count name = pStateF "button6" name (maybe 0 (+1))
button6CountTo :: Pattern p => String -> p Double -> p ValueMap
button6CountTo name ipat = innerJoin $ (\i -> pStateF "button6" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button6bus :: Pattern p => p Int -> p Double -> p ValueMap
button6bus busid pat = pF "button6" pat # pI "^button6" busid
button6recv :: Pattern p => p Int -> p ValueMap
button6recv busid = pI "^button6" busid
-- |
button7 :: Pattern p => p Double -> p ValueMap
button7 = pF "button7"
button7Take :: Pattern p => String -> [Double] -> p ValueMap
button7Take name xs = pStateListF "button7" name xs
button7Count :: Pattern p => String -> p ValueMap
button7Count name = pStateF "button7" name (maybe 0 (+1))
button7CountTo :: Pattern p => String -> p Double -> p ValueMap
button7CountTo name ipat = innerJoin $ (\i -> pStateF "button7" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button7bus :: Pattern p => p Int -> p Double -> p ValueMap
button7bus busid pat = pF "button7" pat # pI "^button7" busid
button7recv :: Pattern p => p Int -> p ValueMap
button7recv busid = pI "^button7" busid
-- |
button8 :: Pattern p => p Double -> p ValueMap
button8 = pF "button8"
button8Take :: Pattern p => String -> [Double] -> p ValueMap
button8Take name xs = pStateListF "button8" name xs
button8Count :: Pattern p => String -> p ValueMap
button8Count name = pStateF "button8" name (maybe 0 (+1))
button8CountTo :: Pattern p => String -> p Double -> p ValueMap
button8CountTo name ipat = innerJoin $ (\i -> pStateF "button8" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button8bus :: Pattern p => p Int -> p Double -> p ValueMap
button8bus busid pat = pF "button8" pat # pI "^button8" busid
button8recv :: Pattern p => p Int -> p ValueMap
button8recv busid = pI "^button8" busid
-- |
button9 :: Pattern p => p Double -> p ValueMap
button9 = pF "button9"
button9Take :: Pattern p => String -> [Double] -> p ValueMap
button9Take name xs = pStateListF "button9" name xs
button9Count :: Pattern p => String -> p ValueMap
button9Count name = pStateF "button9" name (maybe 0 (+1))
button9CountTo :: Pattern p => String -> p Double -> p ValueMap
button9CountTo name ipat = innerJoin $ (\i -> pStateF "button9" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
button9bus :: Pattern p => p Int -> p Double -> p ValueMap
button9bus busid pat = pF "button9" pat # pI "^button9" busid
button9recv :: Pattern p => p Int -> p ValueMap
button9recv busid = pI "^button9" busid
-- |
ccn :: Pattern p => p Double -> p ValueMap
ccn = pF "ccn"
ccnTake :: Pattern p => String -> [Double] -> p ValueMap
ccnTake name xs = pStateListF "ccn" name xs
ccnCount :: Pattern p => String -> p ValueMap
ccnCount name = pStateF "ccn" name (maybe 0 (+1))
ccnCountTo :: Pattern p => String -> p Double -> p ValueMap
ccnCountTo name ipat = innerJoin $ (\i -> pStateF "ccn" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
ccnbus :: Pattern p => p Int -> p Double -> p ValueMap
ccnbus _ _ = error "Control parameter 'ccn' can't be sent to a bus."
-- |
ccv :: Pattern p => p Double -> p ValueMap
ccv = pF "ccv"
ccvTake :: Pattern p => String -> [Double] -> p ValueMap
ccvTake name xs = pStateListF "ccv" name xs
ccvCount :: Pattern p => String -> p ValueMap
ccvCount name = pStateF "ccv" name (maybe 0 (+1))
ccvCountTo :: Pattern p => String -> p Double -> p ValueMap
ccvCountTo name ipat = innerJoin $ (\i -> pStateF "ccv" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
ccvbus :: Pattern p => p Int -> p Double -> p ValueMap
ccvbus _ _ = error "Control parameter 'ccv' can't be sent to a bus."
-- | choose the channel the pattern is sent to in superdirt
channel :: Pattern p => p Int -> p ValueMap
channel = pI "channel"
channelTake :: Pattern p => String -> [Double] -> p ValueMap
channelTake name xs = pStateListF "channel" name xs
channelCount :: Pattern p => String -> p ValueMap
channelCount name = pStateF "channel" name (maybe 0 (+1))
channelCountTo :: Pattern p => String -> p Double -> p ValueMap
channelCountTo name ipat = innerJoin $ (\i -> pStateF "channel" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
channelbus :: Pattern p => p Int -> p Int -> p ValueMap
channelbus _ _ = error "Control parameter 'channel' can't be sent to a bus."
-- |
clhatdecay :: Pattern p => p Double -> p ValueMap
clhatdecay = pF "clhatdecay"
clhatdecayTake :: Pattern p => String -> [Double] -> p ValueMap
clhatdecayTake name xs = pStateListF "clhatdecay" name xs
clhatdecayCount :: Pattern p => String -> p ValueMap
clhatdecayCount name = pStateF "clhatdecay" name (maybe 0 (+1))
clhatdecayCountTo :: Pattern p => String -> p Double -> p ValueMap
clhatdecayCountTo name ipat = innerJoin $ (\i -> pStateF "clhatdecay" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
clhatdecaybus :: Pattern p => p Int -> p Double -> p ValueMap
clhatdecaybus busid pat = pF "clhatdecay" pat # pI "^clhatdecay" busid
clhatdecayrecv :: Pattern p => p Int -> p ValueMap
clhatdecayrecv busid = pI "^clhatdecay" busid
-- | fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on.
coarse :: Pattern p => p Double -> p ValueMap
coarse = pF "coarse"
coarseTake :: Pattern p => String -> [Double] -> p ValueMap
coarseTake name xs = pStateListF "coarse" name xs
coarseCount :: Pattern p => String -> p ValueMap
coarseCount name = pStateF "coarse" name (maybe 0 (+1))
coarseCountTo :: Pattern p => String -> p Double -> p ValueMap
coarseCountTo name ipat = innerJoin $ (\i -> pStateF "coarse" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
coarsebus :: Pattern p => p Int -> p Double -> p ValueMap
coarsebus busid pat = pF "coarse" pat # pI "^coarse" busid
coarserecv :: Pattern p => p Int -> p ValueMap
coarserecv busid = pI "^coarse" busid
-- | Spectral comb
comb :: Pattern p => p Double -> p ValueMap
comb = pF "comb"
combTake :: Pattern p => String -> [Double] -> p ValueMap
combTake name xs = pStateListF "comb" name xs
combCount :: Pattern p => String -> p ValueMap
combCount name = pStateF "comb" name (maybe 0 (+1))
combCountTo :: Pattern p => String -> p Double -> p ValueMap
combCountTo name ipat = innerJoin $ (\i -> pStateF "comb" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
combbus :: Pattern p => p Int -> p Double -> p ValueMap
combbus busid pat = pF "comb" pat # pI "^comb" busid
combrecv :: Pattern p => p Int -> p ValueMap
combrecv busid = pI "^comb" busid
-- |
control :: Pattern p => p Double -> p ValueMap
control = pF "control"
controlTake :: Pattern p => String -> [Double] -> p ValueMap
controlTake name xs = pStateListF "control" name xs
controlCount :: Pattern p => String -> p ValueMap
controlCount name = pStateF "control" name (maybe 0 (+1))
controlCountTo :: Pattern p => String -> p Double -> p ValueMap
controlCountTo name ipat = innerJoin $ (\i -> pStateF "control" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
controlbus :: Pattern p => p Int -> p Double -> p ValueMap
controlbus _ _ = error "Control parameter 'control' can't be sent to a bus."
-- |
cps :: Pattern p => p Double -> p ValueMap
cps = pF "cps"
cpsTake :: Pattern p => String -> [Double] -> p ValueMap
cpsTake name xs = pStateListF "cps" name xs
cpsCount :: Pattern p => String -> p ValueMap
cpsCount name = pStateF "cps" name (maybe 0 (+1))
cpsCountTo :: Pattern p => String -> p Double -> p ValueMap
cpsCountTo name ipat = innerJoin $ (\i -> pStateF "cps" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
cpsbus :: Pattern p => p Int -> p Double -> p ValueMap
cpsbus busid pat = pF "cps" pat # pI "^cps" busid
cpsrecv :: Pattern p => p Int -> p ValueMap
cpsrecv busid = pI "^cps" busid
-- | bit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).
crush :: Pattern p => p Double -> p ValueMap
crush = pF "crush"
crushTake :: Pattern p => String -> [Double] -> p ValueMap
crushTake name xs = pStateListF "crush" name xs
crushCount :: Pattern p => String -> p ValueMap
crushCount name = pStateF "crush" name (maybe 0 (+1))
crushCountTo :: Pattern p => String -> p Double -> p ValueMap
crushCountTo name ipat = innerJoin $ (\i -> pStateF "crush" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
crushbus :: Pattern p => p Int -> p Double -> p ValueMap
crushbus busid pat = pF "crush" pat # pI "^crush" busid
crushrecv :: Pattern p => p Int -> p ValueMap
crushrecv busid = pI "^crush" busid
-- |
ctlNum :: Pattern p => p Double -> p ValueMap
ctlNum = pF "ctlNum"
ctlNumTake :: Pattern p => String -> [Double] -> p ValueMap
ctlNumTake name xs = pStateListF "ctlNum" name xs
ctlNumCount :: Pattern p => String -> p ValueMap
ctlNumCount name = pStateF "ctlNum" name (maybe 0 (+1))
ctlNumCountTo :: Pattern p => String -> p Double -> p ValueMap
ctlNumCountTo name ipat = innerJoin $ (\i -> pStateF "ctlNum" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
ctlNumbus :: Pattern p => p Int -> p Double -> p ValueMap
ctlNumbus _ _ = error "Control parameter 'ctlNum' can't be sent to a bus."
-- |
ctranspose :: Pattern p => p Double -> p ValueMap
ctranspose = pF "ctranspose"
ctransposeTake :: Pattern p => String -> [Double] -> p ValueMap
ctransposeTake name xs = pStateListF "ctranspose" name xs
ctransposeCount :: Pattern p => String -> p ValueMap
ctransposeCount name = pStateF "ctranspose" name (maybe 0 (+1))
ctransposeCountTo :: Pattern p => String -> p Double -> p ValueMap
ctransposeCountTo name ipat = innerJoin $ (\i -> pStateF "ctranspose" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
ctransposebus :: Pattern p => p Int -> p Double -> p ValueMap
ctransposebus busid pat = pF "ctranspose" pat # pI "^ctranspose" busid
ctransposerecv :: Pattern p => p Int -> p ValueMap
ctransposerecv busid = pI "^ctranspose" busid
-- | In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open.
cut :: Pattern p => p Int -> p ValueMap
cut = pI "cut"
cutTake :: Pattern p => String -> [Double] -> p ValueMap
cutTake name xs = pStateListF "cut" name xs
cutCount :: Pattern p => String -> p ValueMap
cutCount name = pStateF "cut" name (maybe 0 (+1))
cutCountTo :: Pattern p => String -> p Double -> p ValueMap
cutCountTo name ipat = innerJoin $ (\i -> pStateF "cut" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
cutbus :: Pattern p => p Int -> p Int -> p ValueMap
cutbus busid pat = pI "cut" pat # pI "^cut" busid
cutrecv :: Pattern p => p Int -> p ValueMap
cutrecv busid = pI "^cut" busid
-- | a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter.
cutoff :: Pattern p => p Double -> p ValueMap
cutoff = pF "cutoff"
cutoffTake :: Pattern p => String -> [Double] -> p ValueMap
cutoffTake name xs = pStateListF "cutoff" name xs
cutoffCount :: Pattern p => String -> p ValueMap
cutoffCount name = pStateF "cutoff" name (maybe 0 (+1))
cutoffCountTo :: Pattern p => String -> p Double -> p ValueMap
cutoffCountTo name ipat = innerJoin $ (\i -> pStateF "cutoff" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
cutoffbus :: Pattern p => p Int -> p Double -> p ValueMap
cutoffbus busid pat = pF "cutoff" pat # pI "^cutoff" busid
cutoffrecv :: Pattern p => p Int -> p ValueMap
cutoffrecv busid = pI "^cutoff" busid
-- |
cutoffegint :: Pattern p => p Double -> p ValueMap
cutoffegint = pF "cutoffegint"
cutoffegintTake :: Pattern p => String -> [Double] -> p ValueMap
cutoffegintTake name xs = pStateListF "cutoffegint" name xs
cutoffegintCount :: Pattern p => String -> p ValueMap
cutoffegintCount name = pStateF "cutoffegint" name (maybe 0 (+1))
cutoffegintCountTo :: Pattern p => String -> p Double -> p ValueMap
cutoffegintCountTo name ipat = innerJoin $ (\i -> pStateF "cutoffegint" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
cutoffegintbus :: Pattern p => p Int -> p Double -> p ValueMap
cutoffegintbus busid pat = pF "cutoffegint" pat # pI "^cutoffegint" busid
cutoffegintrecv :: Pattern p => p Int -> p ValueMap
cutoffegintrecv busid = pI "^cutoffegint" busid
-- |
decay :: Pattern p => p Double -> p ValueMap
decay = pF "decay"
decayTake :: Pattern p => String -> [Double] -> p ValueMap
decayTake name xs = pStateListF "decay" name xs
decayCount :: Pattern p => String -> p ValueMap
decayCount name = pStateF "decay" name (maybe 0 (+1))
decayCountTo :: Pattern p => String -> p Double -> p ValueMap
decayCountTo name ipat = innerJoin $ (\i -> pStateF "decay" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
decaybus :: Pattern p => p Int -> p Double -> p ValueMap
decaybus busid pat = pF "decay" pat # pI "^decay" busid
decayrecv :: Pattern p => p Int -> p ValueMap
decayrecv busid = pI "^decay" busid
-- |
degree :: Pattern p => p Double -> p ValueMap
degree = pF "degree"
degreeTake :: Pattern p => String -> [Double] -> p ValueMap
degreeTake name xs = pStateListF "degree" name xs
degreeCount :: Pattern p => String -> p ValueMap
degreeCount name = pStateF "degree" name (maybe 0 (+1))
degreeCountTo :: Pattern p => String -> p Double -> p ValueMap
degreeCountTo name ipat = innerJoin $ (\i -> pStateF "degree" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
degreebus :: Pattern p => p Int -> p Double -> p ValueMap
degreebus busid pat = pF "degree" pat # pI "^degree" busid
degreerecv :: Pattern p => p Int -> p ValueMap
degreerecv busid = pI "^degree" busid
-- | a pattern of numbers from 0 to 1. Sets the level of the delay signal.
delay :: Pattern p => p Double -> p ValueMap
delay = pF "delay"
delayTake :: Pattern p => String -> [Double] -> p ValueMap
delayTake name xs = pStateListF "delay" name xs
delayCount :: Pattern p => String -> p ValueMap
delayCount name = pStateF "delay" name (maybe 0 (+1))
delayCountTo :: Pattern p => String -> p Double -> p ValueMap
delayCountTo name ipat = innerJoin $ (\i -> pStateF "delay" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
delaybus :: Pattern p => p Int -> p Double -> p ValueMap
delaybus busid pat = pF "delay" pat # pI "^delay" busid
delayrecv :: Pattern p => p Int -> p ValueMap
delayrecv busid = pI "^delay" busid
-- | a pattern of numbers from 0 to 1. Sets the amount of delay feedback.
delayfeedback :: Pattern p => p Double -> p ValueMap
delayfeedback = pF "delayfeedback"
delayfeedbackTake :: Pattern p => String -> [Double] -> p ValueMap
delayfeedbackTake name xs = pStateListF "delayfeedback" name xs
delayfeedbackCount :: Pattern p => String -> p ValueMap
delayfeedbackCount name = pStateF "delayfeedback" name (maybe 0 (+1))
delayfeedbackCountTo :: Pattern p => String -> p Double -> p ValueMap
delayfeedbackCountTo name ipat = innerJoin $ (\i -> pStateF "delayfeedback" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
delayfeedbackbus :: Pattern p => p Int -> p Double -> p ValueMap
delayfeedbackbus busid pat = pF "delayfeedback" pat # pI "^delayfeedback" busid
delayfeedbackrecv :: Pattern p => p Int -> p ValueMap
delayfeedbackrecv busid = pI "^delayfeedback" busid
-- | a pattern of numbers from 0 to 1. Sets the length of the delay.
delaytime :: Pattern p => p Double -> p ValueMap
delaytime = pF "delaytime"
delaytimeTake :: Pattern p => String -> [Double] -> p ValueMap
delaytimeTake name xs = pStateListF "delaytime" name xs
delaytimeCount :: Pattern p => String -> p ValueMap
delaytimeCount name = pStateF "delaytime" name (maybe 0 (+1))
delaytimeCountTo :: Pattern p => String -> p Double -> p ValueMap
delaytimeCountTo name ipat = innerJoin $ (\i -> pStateF "delaytime" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
delaytimebus :: Pattern p => p Int -> p Double -> p ValueMap
delaytimebus busid pat = pF "delaytime" pat # pI "^delaytime" busid
delaytimerecv :: Pattern p => p Int -> p ValueMap
delaytimerecv busid = pI "^delaytime" busid
-- |
detune :: Pattern p => p Double -> p ValueMap
detune = pF "detune"
detuneTake :: Pattern p => String -> [Double] -> p ValueMap
detuneTake name xs = pStateListF "detune" name xs
detuneCount :: Pattern p => String -> p ValueMap
detuneCount name = pStateF "detune" name (maybe 0 (+1))
detuneCountTo :: Pattern p => String -> p Double -> p ValueMap
detuneCountTo name ipat = innerJoin $ (\i -> pStateF "detune" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
detunebus :: Pattern p => p Int -> p Double -> p ValueMap
detunebus busid pat = pF "detune" pat # pI "^detune" busid
detunerecv :: Pattern p => p Int -> p ValueMap
detunerecv busid = pI "^detune" busid
-- | noisy fuzzy distortion
distort :: Pattern p => p Double -> p ValueMap
distort = pF "distort"
distortTake :: Pattern p => String -> [Double] -> p ValueMap
distortTake name xs = pStateListF "distort" name xs
distortCount :: Pattern p => String -> p ValueMap
distortCount name = pStateF "distort" name (maybe 0 (+1))
distortCountTo :: Pattern p => String -> p Double -> p ValueMap
distortCountTo name ipat = innerJoin $ (\i -> pStateF "distort" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
distortbus :: Pattern p => p Int -> p Double -> p ValueMap
distortbus busid pat = pF "distort" pat # pI "^distort" busid
distortrecv :: Pattern p => p Int -> p ValueMap
distortrecv busid = pI "^distort" busid
-- | DJ filter, below 0.5 is low pass filter, above is high pass filter.
djf :: Pattern p => p Double -> p ValueMap
djf = pF "djf"
djfTake :: Pattern p => String -> [Double] -> p ValueMap
djfTake name xs = pStateListF "djf" name xs
djfCount :: Pattern p => String -> p ValueMap
djfCount name = pStateF "djf" name (maybe 0 (+1))
djfCountTo :: Pattern p => String -> p Double -> p ValueMap
djfCountTo name ipat = innerJoin $ (\i -> pStateF "djf" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
djfbus :: Pattern p => p Int -> p Double -> p ValueMap
djfbus busid pat = pF "djf" pat # pI "^djf" busid
djfrecv :: Pattern p => p Int -> p ValueMap
djfrecv busid = pI "^djf" busid
-- | when set to `1` will disable all reverb for this pattern. See `room` and `size` for more information about reverb.
dry :: Pattern p => p Double -> p ValueMap
dry = pF "dry"
dryTake :: Pattern p => String -> [Double] -> p ValueMap
dryTake name xs = pStateListF "dry" name xs
dryCount :: Pattern p => String -> p ValueMap
dryCount name = pStateF "dry" name (maybe 0 (+1))
dryCountTo :: Pattern p => String -> p Double -> p ValueMap
dryCountTo name ipat = innerJoin $ (\i -> pStateF "dry" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
drybus :: Pattern p => p Int -> p Double -> p ValueMap
drybus busid pat = pF "dry" pat # pI "^dry" busid
dryrecv :: Pattern p => p Int -> p ValueMap
dryrecv busid = pI "^dry" busid
-- |
dur :: Pattern p => p Double -> p ValueMap
dur = pF "dur"
durTake :: Pattern p => String -> [Double] -> p ValueMap
durTake name xs = pStateListF "dur" name xs
durCount :: Pattern p => String -> p ValueMap
durCount name = pStateF "dur" name (maybe 0 (+1))
durCountTo :: Pattern p => String -> p Double -> p ValueMap
durCountTo name ipat = innerJoin $ (\i -> pStateF "dur" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
durbus :: Pattern p => p Int -> p Double -> p ValueMap
durbus busid pat = pF "dur" pat # pI "^dur" busid
durrecv :: Pattern p => p Int -> p ValueMap
durrecv busid = pI "^dur" busid
-- | the same as `begin`, but cuts the end off samples, shortening them; e.g. `0.75` to cut off the last quarter of each sample.
end :: Pattern p => p Double -> p ValueMap
end = pF "end"
endTake :: Pattern p => String -> [Double] -> p ValueMap
endTake name xs = pStateListF "end" name xs
endCount :: Pattern p => String -> p ValueMap
endCount name = pStateF "end" name (maybe 0 (+1))
endCountTo :: Pattern p => String -> p Double -> p ValueMap
endCountTo name ipat = innerJoin $ (\i -> pStateF "end" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
endbus :: Pattern p => p Int -> p Double -> p ValueMap
endbus _ _ = error "Control parameter 'end' can't be sent to a bus."
-- | Spectral enhance
enhance :: Pattern p => p Double -> p ValueMap
enhance = pF "enhance"
enhanceTake :: Pattern p => String -> [Double] -> p ValueMap
enhanceTake name xs = pStateListF "enhance" name xs
enhanceCount :: Pattern p => String -> p ValueMap
enhanceCount name = pStateF "enhance" name (maybe 0 (+1))
enhanceCountTo :: Pattern p => String -> p Double -> p ValueMap
enhanceCountTo name ipat = innerJoin $ (\i -> pStateF "enhance" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
enhancebus :: Pattern p => p Int -> p Double -> p ValueMap
enhancebus busid pat = pF "enhance" pat # pI "^enhance" busid
enhancerecv :: Pattern p => p Int -> p ValueMap
enhancerecv busid = pI "^enhance" busid
-- |
expression :: Pattern p => p Double -> p ValueMap
expression = pF "expression"
expressionTake :: Pattern p => String -> [Double] -> p ValueMap
expressionTake name xs = pStateListF "expression" name xs
expressionCount :: Pattern p => String -> p ValueMap
expressionCount name = pStateF "expression" name (maybe 0 (+1))
expressionCountTo :: Pattern p => String -> p Double -> p ValueMap
expressionCountTo name ipat = innerJoin $ (\i -> pStateF "expression" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
expressionbus :: Pattern p => p Int -> p Double -> p ValueMap
expressionbus busid pat = pF "expression" pat # pI "^expression" busid
expressionrecv :: Pattern p => p Int -> p ValueMap
expressionrecv busid = pI "^expression" busid
-- | As with fadeTime, but controls the fade in time of the grain envelope. Not used if the grain begins at position 0 in the sample.
fadeInTime :: Pattern p => p Double -> p ValueMap
fadeInTime = pF "fadeInTime"
fadeInTimeTake :: Pattern p => String -> [Double] -> p ValueMap
fadeInTimeTake name xs = pStateListF "fadeInTime" name xs
fadeInTimeCount :: Pattern p => String -> p ValueMap
fadeInTimeCount name = pStateF "fadeInTime" name (maybe 0 (+1))
fadeInTimeCountTo :: Pattern p => String -> p Double -> p ValueMap
fadeInTimeCountTo name ipat = innerJoin $ (\i -> pStateF "fadeInTime" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
fadeInTimebus :: Pattern p => p Int -> p Double -> p ValueMap
fadeInTimebus _ _ = error "Control parameter 'fadeInTime' can't be sent to a bus."
-- | Used when using begin/end or chop/striate and friends, to change the fade out time of the 'grain' envelope.
fadeTime :: Pattern p => p Double -> p ValueMap
fadeTime = pF "fadeTime"
fadeTimeTake :: Pattern p => String -> [Double] -> p ValueMap
fadeTimeTake name xs = pStateListF "fadeTime" name xs
fadeTimeCount :: Pattern p => String -> p ValueMap
fadeTimeCount name = pStateF "fadeTime" name (maybe 0 (+1))
fadeTimeCountTo :: Pattern p => String -> p Double -> p ValueMap
fadeTimeCountTo name ipat = innerJoin $ (\i -> pStateF "fadeTime" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
fadeTimebus :: Pattern p => p Int -> p Double -> p ValueMap
fadeTimebus _ _ = error "Control parameter 'fadeTime' can't be sent to a bus."
-- |
frameRate :: Pattern p => p Double -> p ValueMap
frameRate = pF "frameRate"
frameRateTake :: Pattern p => String -> [Double] -> p ValueMap
frameRateTake name xs = pStateListF "frameRate" name xs
frameRateCount :: Pattern p => String -> p ValueMap
frameRateCount name = pStateF "frameRate" name (maybe 0 (+1))
frameRateCountTo :: Pattern p => String -> p Double -> p ValueMap
frameRateCountTo name ipat = innerJoin $ (\i -> pStateF "frameRate" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
frameRatebus :: Pattern p => p Int -> p Double -> p ValueMap
frameRatebus _ _ = error "Control parameter 'frameRate' can't be sent to a bus."
-- |
frames :: Pattern p => p Double -> p ValueMap
frames = pF "frames"
framesTake :: Pattern p => String -> [Double] -> p ValueMap
framesTake name xs = pStateListF "frames" name xs
framesCount :: Pattern p => String -> p ValueMap
framesCount name = pStateF "frames" name (maybe 0 (+1))
framesCountTo :: Pattern p => String -> p Double -> p ValueMap
framesCountTo name ipat = innerJoin $ (\i -> pStateF "frames" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
framesbus :: Pattern p => p Int -> p Double -> p ValueMap
framesbus _ _ = error "Control parameter 'frames' can't be sent to a bus."
-- | Spectral freeze
freeze :: Pattern p => p Double -> p ValueMap
freeze = pF "freeze"
freezeTake :: Pattern p => String -> [Double] -> p ValueMap
freezeTake name xs = pStateListF "freeze" name xs
freezeCount :: Pattern p => String -> p ValueMap
freezeCount name = pStateF "freeze" name (maybe 0 (+1))
freezeCountTo :: Pattern p => String -> p Double -> p ValueMap
freezeCountTo name ipat = innerJoin $ (\i -> pStateF "freeze" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
freezebus :: Pattern p => p Int -> p Double -> p ValueMap