~nasser/8fl

8fl/api.fnl -rw-r--r-- 1.2 KiB
2934f9e8Ramsey Nasser Use negative track numbers for fx columns a month ago
                                                                                
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
(local core (require :core))
(local seq (require :seq))
(local rn (require :renoise))
(local patterns (require :patterns))

;; to support <> macro
(set _G._CYCLES {})

;; (fn $> [...]
;;   (let [args [...]]
;;     (onpattern (fn [p] (rn.balance-and-render! p args)))))

(fn $>!! [...]
  (onpattern nil)
  (let [args [...]
        p (. (renoise.song) :selected_pattern_index)]
    (rn.balance-and-render! p args)))

(fn $>! [...]
  (let [p (. (renoise.song) :selected_pattern_index)]
    (rn.balance-and-render! p [...])))

(fn $>1 [...]
  (let [args [...]]
    (onpattern
      (fn [p]
        (rn.balance-and-render! p args)
        (onpattern nil)))))

(fn samp [ins frag n]
  (let [n (or n 1)]
    (seq.nth (core.samples ins frag) n)))

(fn same [x] x)

{ : $>! : $>!! : $>1 : same 
  :fxfmt core.fxfmt
  :euc patterns.make-euclid
  :samps core.samples
  :cyc seq.cycle
  :cat seq.concat
  :rot patterns.rotate
  :rep seq.repeat
  :rev seq.reverse
  :ling seq.linger
  :fnote patterns.fill-notes
  :frest patterns.fill-rests
  :ins core.instrument 
  :vol core.volume
  :pan core.pan
  :dly core.delay
  :fx core.fx
  :fol patterns.follow
  :bef patterns.before
  :melo patterns.melody
  :samp samp
  :** patterns.product
  :++ seq.concat }