-
Notifications
You must be signed in to change notification settings - Fork 1
/
schicksalslied.lua
866 lines (821 loc) · 22.1 KB
/
schicksalslied.lua
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
---schicksalslied
---
---a poetry sequencer
---
---K1: crow sequencing
---K2: softcut sequencing
---K3: synth engine sequencing
---
---plug in a keyboard
---to add lines to your poem
---
---use grid to recall history
---
---version 1.0.9
local extensions = '/home/we/.local/share/SuperCollider/Extensions'
engine.name = util.file_exists(extensions .. '/FormantTriPTR/FormantTriPTR.sc') and 'LiedMotor' or nil
UI = require "ui"
LiedMotor = include 'lib/LiedMotor_engine'
MusicUtil = require 'musicutil'
Sequins = require 'sequins'
FileSelect = require 'fileselect'
_lfos = include 'lib/lied_lfo'
--mftconf = require 'mftconf/lib/mftconf'
--mft = midi.connect()
Selected_File = {}
File_Length = {}
Softcut_Levels = {}
for i=1,3 do
Selected_File[i] = nil
end
My_String = " "
History = {}
History_Index = 0
New_Line = false
Running = false
Going = false
Walking = false
Buffering = false
starter = 1
firstrate = 1
secondrate = 1
thirdrate = 1
function softcut_init()
softcut.buffer_clear()
for i=1,6 do
softcut.enable(i,1)
softcut.level(i,0)
softcut.buffer(i,i%2+1)
softcut.position(i,1)
softcut.level_slew_time(i,1.0)
softcut.phase_quant(i,0.5)
softcut.loop(i,1)
softcut.pan(i, i % 2 == 0 and 1 or -1)
softcut.play(i,1)
end
softcut.voice_sync(2,1,0)
softcut.voice_sync(4,3,0)
softcut.voice_sync(6,5,0)
end
local function Split()
for line in io.lines() do
if #line > 0 then
table.insert(History, line)
end
end
end
Step = {}
Divs = {}
Trig_Keys = {"trigsinsin", "trigtrisin", "trigringer", "trigtritri", "trigkarplu", "trigresonz"}
for i = 1, 6 do
Step[i] = function()
while true do
clock.sync((S:step(3*(i-1)+1)()/S:step(3*(i-1)+2)())*Divs[i])
if Running then
local note_num = S:step(3*i)()
local freq = MusicUtil.note_num_to_freq(note_num)
LiedMotor[Trig_Keys[i]](freq)
end
end
end
end
Soft = {}
Rate = {}
Rates = {}
Pans = {}
Reed = {}
Soft_Div = {}
for i=1,3 do
Soft[i] = function()
while true do
clock.sync((S:step(15*(i-1)+19)()/S:step(15*(i-1)+20)())*Soft_Div[i])
if Going and Selected_File[i] ~= nil then
if not Buffering then
local fade = (1/C:step(15*(i-1)+21)())+0.18
softcut.fade_time(2*i-1,fade)
softcut.fade_time(2*i,fade)
end
local length = get_len(Selected_File[i])
if length > 90 then
length = 90
else
length = length
end
local scstarter = 100*(i-1)
local position = util.linlin(49,80,scstarter,scstarter+length-0.5,S:step(15*(i-1)+22)())
softcut.position(2*i-1,position)
softcut.position(2*i,position)
local endpoint = util.linlin(49,80,scstarter,scstarter+length,S:step(15*(i-1)+23)())
local realend = position + endpoint
if realend > (scstarter+length) then
realend = scstarter+length
else
realend = realend
end
softcut.loop_start(2*i-1,position)
softcut.loop_start(2*i,position)
softcut.loop_end(2*i-1,realend)
softcut.loop_end(2*i,realend)
softcut.loop(2*i-1,1)
softcut.loop(2*i,1)
end
end
end
Rate[i] = function()
while true do
clock.sync((S:step(15*(i-1)+24)()/S:step(15*(i-1)+25)())*Soft_Div[i])
if Going and Selected_File[i] ~= nil then
local rate_slew = 1/C:step(15*(i-1)+26)()
Rates[i] = math.min(S:step(15*(i-1)+27)()/S:step(15*(i-1)+28)(), 16)
Rates[i] = C:step(15*(i-1)+29)() > 17 and Rates[i]*-1 or Rates[i]
for j = 1, 2 do
softcut.rate_slew_time(2*(i-1)+j, rate_slew)
softcut.rate(2*(i-1)+j, Rates[i])
end
end
end
end
Pans[i] = function()
while true do
clock.sync((S:step(15*(i-1)+30)()/S:step(15*(i-1)+31)())*Soft_Div[i])
if Going and Selected_File[i] ~= nil then
local pan = util.linlin(49,80,-1,1,S:step(15*(i-1)+32)())
local pan_slew = 1/J:step(15*(i-1)+33)()
for j = 1, 2 do
softcut.pan_slew_time(2*(i-1)+j,pan_slew)
softcut.pan(2*(i-1)+j,j==2 and -pan or pan)
end
end
end
end
end
function key(n, z)
if z == 0 then return end
if n == 2 then
Going = not Going
print(Going and 'going' or 'not going')
for i = 1,3 do
local fade = (1/C:step(15*(i-1)+21)())+0.18
softcut.fade_time(2*i-1,fade)
softcut.fade_time(2*i,fade)
softcut.level(2 * i - 1, Going and Softcut_Levels[i] or 0)
softcut.level(2 * i, Going and Softcut_Levels[i] or 0)
end
elseif n == 3 then
Running = not Running
print(Running and 'running' or 'not running')
elseif n == 1 then
Walking = not Walking
print(Walking and 'walking' or 'not walking')
end
end
local function remap(ascii)
return ascii % 32 + 49
end
local function crowmap(ascii)
return ascii % 32 + 1
end
local function jfmap(ascii)
return ascii % 5 + 1
end
local function process_string(c)
local tmp = {}
for i = 1, #c do
table.insert(tmp, remap(c:byte(i)))
end
return tmp
end
local function crow_string(c)
local tmp = {}
for i = 1, #c do
table.insert(tmp, crowmap(c:byte(i)))
end
return tmp
end
local function jf_string(c)
local tmp = {}
for i = 1, #c do
table.insert(tmp, jfmap(c:byte(i)))
end
return tmp
end
S = Sequins(process_string(My_String))
C = Sequins(crow_string(My_String))
J = Sequins(jf_string(My_String))
function get_len(x)
local _, samples, rate = audio.file_info(x)
return samples / rate
end
function update_softcut()
for i = 1,3 do
if Selected_File[i] ~= nil then
local filelength, starter, screader, scstarter
filelength = get_len(Selected_File[i])
starter = util.linlin(49,80,0,filelength,S:step(66+i)())
scstarter = 100*(i-1)
softcut.fade_time(2*i-1,0.06)
softcut.fade_time(2*i,0.06)
softcut.level(2 * i - 1,0)
softcut.level(2 * i,0)
Buffering = true
clock.sleep(0.07)
softcut.buffer_clear_region(scstarter,100)
softcut.buffer_read_stereo(Selected_File[i], starter, scstarter, 90, 0, 1)
clock.sleep(0.07)
Buffering = false
softcut.fade_time(2*i-1,0.06)
softcut.fade_time(2*i,0.06)
softcut.level(2 * i - 1, Going and Softcut_Levels[i] or 0)
softcut.level(2 * i, Going and Softcut_Levels[i] or 0)
end
end
end
local function set()
S:settable(process_string(My_String))
C:settable(crow_string(My_String))
J:settable(jf_string(My_String))
clock.run(update_softcut)
end
local function wcheck()
while true do
clock.sleep(1/30)
crow.ii.wtape.play(Walking and 1 or 0)
end
end
Notes_Event = {}
Crow_Div = {}
for i = 1, 2 do
Notes_Event[i] = function ()
while true do
clock.sync((C:step(6*i+59)()/C:step(6*i+60)())*Crow_Div[i])
if Walking then
crow.output[2*i-1].volts = C:step(6*i+61)()/12
crow.output[2*i-1].slew = C:step(6*i+62)()/300
crow.output[2*i].action = "{to(5,dyn{attack=1}), to(0,dyn{release=1})}"
crow.output[2*i].dyn.attack = C:step(6*i+63)()/40
crow.output[2*i].dyn.release = C:step(6*i+64)()/40
crow.output[2*i]()
end
end
end
end
JF = {}
JF_Div = {}
for i = 1, 6 do
JF[i] = function ()
while true do
clock.sync((C:step(4*i+73)()/C:step(4*i+74)())*JF_Div[i])
if Walking then
crow.ii.jf.play_voice(i,C:step(4*i+75)()/12,J:step(4*i+76)())
end
end
end
end
local function run_event()
while true do
clock.sync((C:step(101)()/C:step(102)())*JF_Div[7])
if Walking then
crow.ii.jf.run(J:step(103)())
end
end
end
local function quantize_event()
while true do
clock.sync((C:step(104)()/C:step(105)())*JF_Div[8])
if Walking then
crow.ii.jf.quantize(C:step(106)())
end
end
end
W_Div = {}
local function with_event()
while true do
clock.sync((C:step(107)()/C:step(108)())*W_Div[5])
if Walking then
crow.ii.wtape.speed(C:step(109)(), C:step(110)())
end
end
end
local function rev_event()
while true do
clock.sync((C:step(111)()/C:step(112)())*W_Div[5])
if Walking then
crow.ii.wtape.reverse(1)
end
end
end
local function looper()
while true do
clock.sync((C:step(113)()/C:step(114)())*W_Div[5])
if Walking then
crow.ii.wtape.loop_start(1)
clock.sync((C:step(115)()/C:step(116)())*W_Div[5])
crow.ii.wtape.loop_end(1)
if C:step(117)() < 17 then
for _ = 1,J:step(118)() do
clock.sync((C:step(119)()/C:step(120)())*W_Div[5])
crow.ii.wtape.loop_scale(C:step(121)()/C:step(122)())
for _ = 1, J:step(123)() do
clock.sync((C:step(124)()/C:step(125)())*W_Div[5])
crow.ii.wtape.loop_next(C:step(126)()-C:step(127)())
end
end
else
for _ = 1,J:step(128)() do
clock.sync((C:step(129)()/C:step(130)())*W_Div[5])
crow.ii.wtape.loop_next(C:step(131)()-C:step(132)())
for _ = 1, J:step(133)() do
clock.sync((C:step(134)()/C:step(135)())*W_Div[5])
crow.ii.wtape.loop_scale(C:step(136)()/C:step(137)())
end
end
end
clock.sync((C:step(138)()/C:step(139)())*W_Div[5])
crow.ii.wtape.loop_active(0)
for _ = 1,C:step(140)() do
clock.sync((C:step(141)()/C:step(142)())*W_Div[5])
crow.ii.wtape.seek((C:step(143)()-C:step(144)()) * 300)
end
for _ = 1,J:step(145)() do
clock.sync((C:step(146)()/C:step(147)())*W_Div[5])
crow.ii.wtape.loop_active(1)
if C:step(148)() < 17 then
for _ = 1,J:step(149)() do
clock.sync((C:step(150)()/C:step(151)())*W_Div[5])
crow.ii.wtape.loop_scale(C:step(152)()/C:step(153)())
for _ = 1, J:step(154)() do
clock.sync((C:step(155)()/C:step(156)())*W_Div[5])
crow.ii.wtape.loop_next(C:step(157)()-C:step(158)())
end
end
else
for _ = 1,J:step(159)() do
clock.sync((C:step(160)()/C:step(161)())*W_Div[5])
crow.ii.wtape.loop_next(C:step(162)()-C:step(163)())
for _ = 1,J:step(164)() do
clock.sync((C:step(165)()/C:step(166)())*W_Div[5])
crow.ii.wtape.loop_scale(C:step(167)()/C:step(168)())
end
end
end
clock.sync((C:step(169)()/C:step(170)())*W_Div[5])
crow.ii.wtape.loop_active(0)
for _ = 1,C:step(171)() do
clock.sync((C:step(172)()/C:step(173)())*W_Div[5])
crow.ii.wtape.seek((C:step(174)()-C:step(175)())*300)
end
end
end
end
end
WSyn = {}
for i = 1,4 do
WSyn[i] = function()
while true do
clock.sync((C:step(4*i+171)()/C:step(4*i+172)())*W_Div[i])
if Walking then
crow.ii.wsyn.play_voice(i, C:step(4*i+173)()/12, J:step(4*i+174)())
end
end
end
end
local function wdel_event()
while true do
clock.sync((C:step(192)()/C:step(193)())*W_Div[6])
if Walking then
crow.ii.wdel.time(0)
crow.ii.wdel.freq(C:step(194)()/12)
crow.ii.wdel.pluck(J:step(195)())
end
end
end
G = grid.connect()
G.key = function(x,y,z)
Momentary[x][y] = z == 1
if x + 16 * (y - 1) > #History then return end
if z == 1 then
My_String = My_String .. History[x + 16 * (y - 1)]
redraw()
Grid_Dirty = true
else
Grid_Dirty = true
local flag = false
for j = 1, 8 do
for k = 1, 16 do
if Momentary[k][j] then
flag = true
break
end
end
end
if flag then return end
if My_String == "" then return end
set()
My_String = ""
New_Line = true
redraw()
end
end
local function grid_redraw()
G:all(0)
-- i will be 1 for #History between 1 and 16, 2 for #History betwen 17 and 32...
local i = (#History - 1) // 16 + 1
-- j will be the leftover amount
local j = (#History - 1) % 16 + 1
for y = 1, i do
local k = y == i and j or 16
for x = 1, k do
G:led(x,y,4)
end
end
for x = 1, 16 do
for y = 1, 8 do
if Momentary[x][y] and x + 16 * (y - 1) <= #History then
G:led(x,y,15)
end
end
end
G:refresh()
end
local function grid_redraw_clock()
while true do
clock.sleep(1/30)
if Grid_Dirty then
grid_redraw()
Grid_Dirty = false
end
end
end
keyboard.char = function (character)
if #My_String < 20 then
My_String = My_String .. character
redraw()
end
end
keyboard.code = function (code, val)
if val == 0 then return end
if code == "BACKSPACE" then
My_String = My_String:sub(1, -2)
elseif code == "UP" then
if #History == 0 then return end
if New_Line then
History_Index = #History - 1
New_Line = false
else
History_Index = util.clamp(History_Index - 1, 0, #History)
end
My_String = History[History_Index + 1]
elseif code == "DOWN" then
if #History == 0 or History_Index == nil then return end
History_Index = util.clamp(History_Index + 1, 0, #History)
if History_Index == #History then
My_String = ""
New_Line = true
else
My_String = History[History_Index + 1]
end
elseif code == "ENTER" and #My_String > 0 then
set()
table.insert(History, My_String)
My_String = ""
History_Index = #History
New_Line = true
elseif keyboard.ctrl() then
table.remove(History,#History)
History_Index = #History
My_String = ""
end
redraw()
grid_redraw()
end
function redraw()
if Needs_Restart then
screen.clear()
Restart_Message:redraw()
screen.update()
return
end
screen.clear()
screen.level(10)
screen.rect(2, 50, 125, 14)
screen.stroke()
screen.move(5, 59)
screen.text("> " .. My_String)
for i = 1, 5 do
if not (History_Index - i >= 0) then break end
screen.move(5, 55 - 10 * i)
screen.text(History[History_Index - i + 1])
end
screen.update()
end
function init()
Needs_Restart = false
local formanttri_files = {"FormantTriPTR.sc", "FormantTriPTR_scsynth.so"}
for _, file in pairs(formanttri_files) do
if util.file_exists(extensions .. "/FormantTriPTR/" .. file) then goto continue end
util.os_capture("mkdir " .. extensions .. "/FormantTriPTR")
util.os_capture("cp " .. norns.state.path .. "/ignore/" .. file .. " " .. extensions .. "/FormantTriPTR/" .. file)
print("installed " .. file)
Needs_Restart = true
::continue::
end
Restart_Message = UI.Message.new{"please restart norns"}
if needs_restart then redraw() return end
LiedMotor.add_params()
local index = {index = {min = -24, max = 24}}
local modnum = {modnum = {min = 1, max = 100}}
local modeno = {modeno = {min = 1, max = 100}}
local width = {width = {min = 0, max = 1}}
local modwidth = {modwidth = {min = 0, max = 1}}
local phase = {phase = {min = -24, max = 24}}
local modphase = {modphase = {min = -24, max = 24}}
local attack = {attack = {min = 0.003, max = 8}}
local release = {release = {min = 0.003, max = 8}}
local amp = {amp = {min = 0, max = 1}}
local pan = {pan = {min = -1, max = 1}}
local LFOs = {
{sinsin = {index, modnum, modeno, phase, attack, release, amp, pan}},
{trisin = {index, modnum, modeno, phase, attack, release, amp, pan}},
{ringer = {index, amp, pan}},
{tritri = {index, modnum, modeno, width, modwidth, phase, modphase, attack, release, amp, pan}},
{karplu = {index, {coef = {min = -1, max = 1}}, amp, pan}},
{resonz = {index, amp, pan}},
{wdel = {{feedback = {min = -5, max = 5}}, {filter = {min = -5, max = 5}}}},
{wsyn = {{lpg_speed = {min = -5, max = 5}}, {lpg_symmetry = {min = -5, max = 5}}, {fm_num = {min = -5, max = 5}}, {fm_deno = {min = -5, max = 5}}, {fm_index = {min = -5, max = 5}}, {fm_envelope = {min = -5, max = 5}}}},
}
params:add_group('LFOs', 675)
for _, val in ipairs(LFOs) do
for key, vals in pairs(val) do
for _, lfo_param in ipairs(vals) do
for name, arg in pairs(lfo_param) do
local lfo = _lfos:add(arg)
lfo:add_params(key .. '_' .. name .. '_lfo', key .. ' ' .. name)
lfo:set('action', function(scaled, _)
params:set('LiedMotor_' .. key .. '_' .. name, scaled)
end)
end
end
end
end
screen.aa(0)
params:add_separator('clock_divs', 'clock divs')
local divs_params = {"sinsin", "trisin", "ringer", "tritri", "karplu", "resonz"}
for i, value in ipairs(divs_params) do
params:add{
type = 'control',
id = value,
name = value,
controlspec = controlspec.new(1, 256, 'lin', 1, 1, ''),
action = function (x)
Divs[i] = x
end
}
end
for i = 1, 3 do
params:add{
type = 'control',
id = 'softcut_voice_' .. i,
name = 'softcut voice ' ..i,
controlspec = controlspec.new(1, 256, 'lin', 1, 1, ''),
action = function (x)
Soft_Div[i] = x
end
}
end
params:add{
type = 'control',
id = 'crow_1_2',
name = 'crow outputs 1 & 2',
controlspec = controlspec.new(1,256,'lin',1,1,''),
action = function (x)
Crow_Div[1] = x
end
}
params:add{
type = 'control',
id = 'crow_3_4',
name = 'crow outputs 3 & 4',
controlspec = controlspec.new(1,256,'lin',1,1,''),
action = function (x)
Crow_Div[2] = x
end
}
for i = 1, 6 do
params:add{
type = 'control',
id = 'just_friends_voice_' .. i,
name = 'just friends voice ' .. i,
controlspec = controlspec.new(1,256,'lin',1,1,''),
action = function (x)
JF_Div[i] = x
end
}
end
params:add{
type = 'control',
id = 'just_friends_run',
name = 'just friends run',
controlspec = controlspec.new(1,256,'lin',1,1,''),
action = function (x)
JF_Div[7] = x
end
}
params:add{
type = 'control',
id = 'just_friends_quantize',
name = 'just friends quantize',
controlspec = controlspec.new(1,256,'lin',1,1,''),
action = function (x)
JF_Div[8] = x
end
}
params:add{
type = 'control',
id = 'w_tape',
name = 'w/tape',
controlspec = controlspec.new(1,256,'lin',1,1,''),
action = function (x)
W_Div[5] = x
end
}
params:add{
type = 'control',
id = 'w_del',
name = 'w/del',
controlspec = controlspec.new(1,256,'lin',1,1,''),
action = function (x)
W_Div[6] = x
end
}
for i = 1, 4 do
params:add{
type = 'control',
id = 'w_syn_' .. i,
name = 'w/syn voice ' .. i,
controlspec = controlspec.new(1,256,'lin',1,1,''),
action = function (x)
W_Div[i] = x
end
}
end
params:add_separator('softcut_voice_levels', 'softcut voice levels')
for i = 1, 3 do
params:add{
type = 'control',
id = 'voice_' .. i,
name = 'voice ' .. i,
controlspec = controlspec.new(0,1,'lin',0.01,1,''),
action = function (x)
Softcut_Levels[i] = x
if Going and not Buffering then
softcut.level(2 * i - 1, x)
softcut.level(2 * i, x)
end
end
}
end
params:add_separator('w_settings', 'w/ settings')
params:add{
type = 'control',
id = 'w_del_feeback',
name = 'w/del feedback',
controlspec = controlspec.new(-5, 5, 'lin', 0.01, 4.8, ''),
action = function (x)
crow.ii.wdel.feedback(x)
end
}
params:add{
type = 'control',
id = 'w_del_filter_cutoff',
name = 'w/del filter cutoff',
controlspec = controlspec.new(-5, 5, 'lin', 0.01, 4.8, ''),
action = function (x)
crow.ii.wdel.filter(x)
end
}
params:add{
type = 'control',
id = 'w_syn_lpg_speed',
name = 'w/syn lpg speed',
controlspec = controlspec.new(-5, 5, 'lin', 0.01, -3, ''),
action = function (x)
crow.ii.wsyn.lpg_time(x)
end
}
params:add{
type = 'control',
id = 'w_syn_lpg_symmetry',
name = 'w/syn lpg symmetry',
controlspec = controlspec.new(-5, 5, 'lin', 0.01, -1, ''),
action = function (x)
crow.ii.wsyn.lpg_symmetry(x)
end
}
params:add{
type = 'control',
id = 'w_syn_fm_num',
name = 'w/syn fm num',
controlspec = controlspec.new(-5, 5, 'lin', 0.01, 1, ''),
action = function (x)
crow.ii.wsyn.fm_ratio(x, params:get('w_syn_fm_deno'))
end
}
params:add{
type = 'control',
id = 'w_syn_fm_deno',
name = 'w/syn fm deno',
controlspec = controlspec.new(-5, 5, 'lin', 0.01, 1, ''),
action = function (x)
crow.ii.wsyn.fm_ratio(params:get('w_syn_fm_num'),x)
end
}
params:add{
type = 'control',
id = 'w_syn_fm_index',
name = 'w/syn fm index',
controlspec = controlspec.new(-5, 5, 'lin', 0.01, 0.1, ''),
action = function (x)
crow.ii.wsyn.fm_index(x)
end
}
params:add{
type = 'control',
id = 'w_syn_fm_envelope',
name = 'w/syn fm envelope',
controlspec = controlspec.new(-5, 5, 'lin', 0.01, -0.1, ''),
action = function (x)
crow.ii.wsyn.fm_env(x)
end
}
params:bang()
softcut_init()
params:add_separator('load_files','load files')
for i = 1, 3 do
params:add{
type = 'file',
id = 'audio_file_' .. i,
name = 'audio file ' .. i,
action = function (x)
Selected_File[i] = x
clock.run(update_softcut)
end
}
end
params:add{
type = 'file',
id = 'text_file',
name = 'text file',
action = function (x)
io.input(x)
Split()
grid_redraw()
end
}
Grid_Dirty = false
Momentary = {}
for x = 1, 16 do
Momentary[x] = {}
for y = 1, 8 do
Momentary[x][y] = false
end
end
print('Schicksalslied')
local bpm = clock.get_tempo()
for i = 1, 6 do
clock.run(Step[i])
clock.run(JF[i])
end
for i = 1, 4 do
clock.run(WSyn[i])
end
for i = 1, 3 do
clock.run(Soft[i])
clock.run(Rate[i])
clock.run(Pans[i])
end
for i = 1, 2 do
clock.run(Notes_Event[i])
end
clock.run(run_event)
clock.run(quantize_event)
clock.run(with_event)
clock.run(rev_event)
clock.run(looper)
clock.run(wdel_event)
clock.run(wcheck)
clock.run(grid_redraw_clock)
crow.input[1].mode('clock')
crow.ii.jf.mode(1)
crow.ii.jf.run_mode(1)
crow.ii.jf.tick(bpm)
crow.ii.wtape.timestamp(1)
crow.ii.wtape.freq(0)
crow.ii.wtape.play(0)
crow.ii.wdel.mod_rate(0)
crow.ii.wdel.mod_amount(0)
crow.ii.wsyn.ar_mode(1)
crow.ii.wsyn.voices(4)
crow.ii.wsyn.patch(1,1)
crow.ii.wsyn.patch(2,2)
--mftconf.load_conf(mft,_path.dust.."code/schicksalslied/lib/default.mfs")
end