-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PakettiLoaders.lua
2742 lines (2357 loc) · 128 KB
/
PakettiLoaders.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
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
-------------------------------------------------------------------------------------------------
-- Dump list of plugins, fx available to Terminal
renoise.tool():add_keybinding{name="Global:Paketti:AU/VST/VST3/Native Plugins/Effects Lister Dump", invoke=function()
local plugins = renoise.song().selected_instrument.plugin_properties.available_plugins
for key, value in ipairs(plugins) do
print(key, value)
end
local devices = renoise.song().tracks[renoise.song().selected_track_index].available_devices
for key, value in ipairs (devices) do
print(key, value)
end end}
renoise.tool():add_keybinding{name="Global:Paketti:Dump Current Instrument parameters", invoke=function()
local instpara = renoise.song().instruments[renoise.song().selected_instrument_index].plugin_properties.plugin_device.parameters
--oprint (renoise.song().instruments[renoise.song().selected_instrument_index].plugin_properties.plugin_device.parameters[26].name)
for key, value in ipairs (instpara) do
print(key, value)
end
for i =1,712 do
oprint (i .. " " .. renoise.song().instruments[renoise.song().selected_instrument_index].plugin_properties.plugin_device.parameters[i].name)
end
end}
-- Open Instrument External Editor
function inst_open_editor()
local pd=renoise.song().selected_instrument.plugin_properties.plugin_device
local w=renoise.app().window
if renoise.song().selected_instrument.plugin_properties.plugin_loaded==false then
w.pattern_matrix_is_visible = false
w.sample_record_dialog_is_visible = false
w.upper_frame_is_visible = true
w.lower_frame_is_visible = true
w.active_upper_frame = 1
w.active_middle_frame= 4
w.active_lower_frame = 1 -- TrackDSP
w.lock_keyboard_focus=true
else
if pd.external_editor_visible==false then pd.external_editor_visible=true else pd.external_editor_visible=false end
end
end
renoise.tool():add_keybinding{name="Global:Paketti:Open External Editor for Plugin",invoke=function() inst_open_editor() end}
renoise.tool():add_keybinding{name="Global:Paketti:Open External Editor for Plugin (2nd)",invoke=function() inst_open_editor() end}
----------------------------------------------------------------------------------------------------
-- This sets up an AutoFilter - i.e. a LFO followed by a Filter, with the LFO affecting the Cutoff filter.
-- Simple, but effective.
function AutoFilter()
local ss=renoise.song().selected_track
local raw=renoise.app().window
raw.active_lower_frame=1
raw.lower_frame_is_visible=true
loadnative("Audio/Effects/Native/Filter")
loadnative("Audio/Effects/Native/*LFO")
-- TODO: but you see, if you have anything before it, it's just not gonna work. you need to make sure those are the ones that
-- were added.
ss.devices[2].parameters[2].value=2
ss.devices[2].parameters[3].value=1
end
renoise.tool():add_keybinding{name="Global:Paketti:Add Filter & LFO (AutoFilter)", invoke=function() AutoFilter() end}
----------------
function read_file(path)
local file = io.open(path, "r") -- Open the file in read mode
if not file then
error("File not found: " .. path)
end
local content = file:read("*a") -- Read the entire content of the file into a string
file:close()
return content
end
-----------------------------------------------------------------------------------------------------------------------------------
function checkline(effect)
end
function instrument_is_empty(instrument)
local s=renoise.song()
local inst = s.instruments[instrument]
local has_sample_data = false
for sample in ipairs(inst.samples) do
has_sample_data = has_sample_data or inst.samples[sample].sample_buffer.has_sample_data
end
if inst.plugin_properties.plugin_loaded or inst.midi_output_properties.device_name ~= "" or has_sample_data then return false else return true end
end
function search_empty_instrument()
local proc = renoise.song()
for empty_instrument = 1, #proc.instruments do
local samples = false
for i = 1,#proc.instruments[empty_instrument].samples do
local temp_buffer = proc.instruments[empty_instrument].samples[i].sample_buffer
if temp_buffer.has_sample_data then samples = true break
end
end
local plugin = proc.instruments[empty_instrument].plugin_properties.plugin_loaded
local midi_device = proc.instruments[empty_instrument].midi_output_properties.device_name
if ((samples == false) and (plugin == false) and
(midi_device == nil or midi_device == "")) then
return empty_instrument
end
end
proc:insert_instrument_at(#proc.instruments+1)
return #proc.instruments
end
------------------------------------------------------------------------------------------------------------
function LoadRhino()
local s=renoise.song()
s.selected_instrument_index = search_empty_instrument()
s.selected_instrument.plugin_properties:load_plugin("Audio/Generators/AU/aumu:RNB4:VSTA")
if s.selected_instrument.plugin_properties.plugin_loaded
then
local pd=s.selected_instrument.plugin_properties.plugin_device
if pd.external_editor_visible==false then pd.external_editor_visible=true else pd.external_editor_visible=false end
end
renoise.app().window.active_lower_frame=3
s.selected_instrument.active_tab=2
end
renoise.tool():add_keybinding{name="Global:Paketti:Load Rhino 2.1 AU", invoke=function() LoadRhino() end}
------------------------------------------------------------------------------------------------------------
renoise.tool():add_keybinding{name="Global:Paketti:Load FabFilter One", invoke=function() renoise.song().instruments[renoise.song().selected_instrument_index].plugin_properties:load_plugin("Audio/Generators/AU/aumu:FOne:FabF")
local pd=renoise.song().selected_instrument.plugin_properties.plugin_device
if pd.external_editor_visible==false then pd.external_editor_visible=true end end}
------------------------------------------------------------------------------------------------------------
renoise.tool():add_keybinding{name="Global:Paketti:Load Surge (VST)", invoke=function() renoise.song().instruments[renoise.song().selected_instrument_index].plugin_properties:load_plugin("Audio/Generators/VST/Surge")
local pd=renoise.song().selected_instrument.plugin_properties.plugin_device
if pd.external_editor_visible==false then pd.external_editor_visible=true end
renoise.app().window.active_middle_frame=renoise.ApplicationWindow.MIDDLE_FRAME_PATTERN_EDITOR
renoise.app().window.lock_keyboard_focus=true
end}
------------------------------------------------------------------------------------------------------------
function LoadZebra()
local s=renoise.song()
s.selected_instrument_index = search_empty_instrument()
s.selected_instrument.plugin_properties:load_plugin("Audio/Generators/VST/Zebra2")
if s.selected_instrument.plugin_properties.plugin_loaded then
local pd=s.selected_instrument.plugin_properties.plugin_device
if pd.external_editor_visible==false then pd.external_editor_visible=true else pd.external_editor_visible=false end
end
--renoise.app().window.active_lower_frame=3
renoise.app().window.active_middle_frame=3
s.selected_instrument.active_tab=2 end
renoise.tool():add_keybinding{name="Global:Paketti:Load U-He Zebra (VST)", invoke=function() LoadZebra() end}
------------------------------------------------------------------------------------------------------------
-- Function to read XML file contents
function readXMLfile(file_path)
local file = io.open(file_path, "r")
if not file then
return nil
end
local content = file:read("*all")
file:close()
return content
end
-- Function to read the preset XML from the provided file path and return its contents
function providePresetXML(preset_file_path)
local preset_xml = readXMLfile(preset_file_path)
-- Check if the XML file was read successfully
if not preset_xml or preset_xml == "" then
renoise.app():show_warning("Failed to read preset XML or file is empty: " .. preset_file_path)
return nil
end
return preset_xml
end
-- Example usage
function LoadPPG()
local s = renoise.song()
local currentView = renoise.app().window.active_middle_frame
-- Ensure an empty instrument slot is selected
s.selected_instrument_index = search_empty_instrument()
-- Load the plugin
s.selected_instrument.plugin_properties:load_plugin("Audio/Generators/VST/PPG Wave 2.V")
-- Check if the plugin is loaded and toggle the external editor visibility
if s.selected_instrument.plugin_properties.plugin_loaded then
local pd = s.selected_instrument.plugin_properties.plugin_device
pd.external_editor_visible = not pd.external_editor_visible
-- Load the preset XML file into the plugin device
local preset_xml = providePresetXML("Presets/PPG_Arpeg.xml")
if preset_xml then
pd.active_preset_data = preset_xml
renoise.app():show_status("Preset successfully loaded from: Presets/PPG_Arpeg.xml")
else
renoise.app():show_warning("Preset loading failed.")
return
end
else
renoise.app():show_warning("Failed to load the plugin.")
return
end
-- Set the active frame and tab for the UI
-- renoise.app().window.active_lower_frame = 3
-- renoise.app().window.active_middle_frame = 3
renoise.app().window.active_middle_frame = currentView
-- s.selected_instrument.active_tab = storedTab
-- Example commented code
-- renoise.song().selected_track.devices[checkline].parameters[1].value = 0.474 -- Mix
-- Example commented code
-- loadnative("Audio/Effects/Native/*Instr. Automation")
-- s.selected_track.devices[2].parameters[2].value = 0.0 -- delay
end
renoise.tool():add_keybinding{name="Global:Paketti:Load Waldorf PPG v2 (VST)",invoke=function() LoadPPG() end}
-----------------------------------------------------------------------------------------------------
function LoadAttack()
local s=renoise.song()
s.selected_instrument_index = search_empty_instrument()
s.selected_instrument.plugin_properties:load_plugin("Audio/Generators/VST/Attack")
if s.selected_instrument.plugin_properties.plugin_loaded
then
local pd=s.selected_instrument.plugin_properties.plugin_device
if pd.external_editor_visible==false then pd.external_editor_visible=true else pd.external_editor_visible=false end
end
renoise.app().window.active_middle_frame=3
s.selected_instrument.active_tab=2
end
renoise.tool():add_keybinding{name="Global:Paketti:Load Waldorf Attack (VST)",invoke=function() LoadAttack() end}
-----------------------------------------------------------------------------------------------------
function loadnative(effect,name)
local checkline=nil
local s=renoise.song()
local w=renoise.app().window
-- Define blacklists for different track types
local master_blacklist={"Audio/Effects/Native/*Key Tracker", "Audio/Effects/Native/*Velocity Tracker", "Audio/Effects/Native/#Send", "Audio/Effects/Native/#Multiband Send", "Audio/Effects/Native/#Sidechain"}
local send_blacklist={"Audio/Effects/Native/*Key Tracker", "Audio/Effects/Native/*Velocity Tracker"}
local group_blacklist={"Audio/Effects/Native/*Key Tracker", "Audio/Effects/Native/*Velocity Tracker"}
local samplefx_blacklist={"Audio/Effects/Native/#ReWire Input", "Audio/Effects/Native/*Instr. Macros", "Audio/Effects/Native/*Instr. MIDI Control", "Audio/Effects/Native/*Instr. Automation"}
-- Helper function to extract device name from the effect string
local function get_device_name(effect)
return effect:match("([^/]+)$")
end
-- Helper function to check if a device is in the blacklist
local function is_blacklisted(effect, blacklist)
for _, blacklisted in ipairs(blacklist) do
if effect == blacklisted then
return true
end
end
return false
end
if w.active_middle_frame == 6 then
w.active_middle_frame = 7
end
if w.active_middle_frame == 7 then
local chain = s.selected_sample_device_chain
local chain_index = s.selected_sample_device_chain_index
if chain == nil or chain_index == 0 then
s.selected_instrument:insert_sample_device_chain_at(1)
chain = s.selected_sample_device_chain
chain_index = 1
end
if chain then
local sample_devices = chain.devices
checkline = (table.count(sample_devices)) < 2 and 2 or (sample_devices[2] and sample_devices[2].name == "#Line Input" and 3 or 2)
checkline = math.min(checkline, #sample_devices + 1)
if is_blacklisted(effect, samplefx_blacklist) then
renoise.app():show_status("The device " .. get_device_name(effect) .. " cannot be added to a Sample FX chain.")
return
end
-- Adjust checkline for #Send and #Multiband Send devices
local device_name = get_device_name(effect)
if device_name == "#Send" or device_name == "#Multiband Send" then
checkline = #sample_devices + 1
end
chain:insert_device_at(effect, checkline)
sample_devices = chain.devices
if sample_devices[checkline] then
local device = sample_devices[checkline]
if device.name == "Maximizer" then device.parameters[1].show_in_mixer = true end
if device.name == "DC Offset" then device.parameters[2].value = 1 end
if device.name == "#Multiband Send" then
device.parameters[1].show_in_mixer = false
device.parameters[3].show_in_mixer = false
device.parameters[5].show_in_mixer = false
device.active_preset_data = read_file("Presets/PakettiMultiSend.xml")
end
if device.name == "#Line Input" then device.parameters[2].show_in_mixer = true end
if device.name == "#Send" then
device.parameters[2].show_in_mixer = false
device.active_preset_data = read_file("Presets/PakettiSend.xml")
end
renoise.song().selected_sample_device_index = checkline
if name ~= nil then
sample_devices[checkline].display_name = name else end
end
else
renoise.app():show_status("No sample selected.")
end
else
local sdevices = s.selected_track.devices
checkline = (table.count(sdevices)) < 2 and 2 or (sdevices[2] and sdevices[2].name == "#Line Input" and 3 or 2)
checkline = math.min(checkline, #sdevices + 1)
w.lower_frame_is_visible = true
w.active_lower_frame = 1
local track_type = renoise.song().selected_track.type
local device_name = get_device_name(effect)
if track_type == 2 and is_blacklisted(effect, master_blacklist) then
renoise.app():show_status("The device " .. device_name .. " cannot be added to a Master track.")
return
elseif track_type == 3 and is_blacklisted(effect, send_blacklist) then
renoise.app():show_status("The device " .. device_name .. " cannot be added to a Send track.")
return
elseif track_type == 4 and is_blacklisted(effect, group_blacklist) then
renoise.app():show_status("The device " .. device_name .. " cannot be added to a Group track.")
return
end
-- Adjust checkline for #Send and #Multiband Send devices
if device_name == "#Send" or device_name == "#Multiband Send" then
checkline = #sdevices + 1
end
s.selected_track:insert_device_at(effect, checkline)
s.selected_device_index = checkline
sdevices = s.selected_track.devices
if sdevices[checkline] then
local device = sdevices[checkline]
if device.name == "DC Offset" then device.parameters[2].value = 1 end
if device.name == "Maximizer" then device.parameters[1].show_in_mixer = true end
if device.name == "#Multiband Send" then
device.parameters[1].show_in_mixer = false
device.parameters[3].show_in_mixer = false
device.parameters[5].show_in_mixer = false
device.active_preset_data = read_file("Presets/PakettiMultiSend.xml")
end
if device.name == "#Line Input" then device.parameters[2].show_in_mixer = true end
if device.name == "#Send" then
device.parameters[2].show_in_mixer = false
device.active_preset_data = read_file("Presets/PakettiSend.xml")
end
if name ~= nil then
sdevices[checkline].display_name = name else end
end
end
end
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Analog Filter",
invoke=function() loadnative("Audio/Effects/Native/Analog Filter") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Bus Compressor",
invoke=function() loadnative("Audio/Effects/Native/Bus Compressor") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Cabinet Simulator",
invoke=function() loadnative("Audio/Effects/Native/Cabinet Simulator") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Chorus",
invoke=function() loadnative("Audio/Effects/Native/Chorus") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Chorus 2",
invoke=function() loadnative("Audio/Effects/Native/Chorus 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Comb Filter 2",
invoke=function() loadnative("Audio/Effects/Native/Comb Filter 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Compressor",
invoke=function() loadnative("Audio/Effects/Native/Compressor") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Convolver",
invoke=function() loadnative("Audio/Effects/Native/Convolver") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise DC Offset",
invoke=function() loadnative("Audio/Effects/Native/DC Offset") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Delay",
invoke=function() loadnative("Audio/Effects/Native/Delay") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Digital Filter",
invoke=function() loadnative("Audio/Effects/Native/Digital Filter") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Distortion 2",
invoke=function() loadnative("Audio/Effects/Native/Distortion 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Doofer",
invoke=function() loadnative("Audio/Effects/Native/Doofer") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise EQ 5",
invoke=function() loadnative("Audio/Effects/Native/EQ 5") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise EQ 10",
invoke=function() loadnative("Audio/Effects/Native/EQ 10") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Exciter",
invoke=function() loadnative("Audio/Effects/Native/Exciter") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Flanger 2",
invoke=function() loadnative("Audio/Effects/Native/Flanger 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Gainer",
invoke=function() loadnative("Audio/Effects/Native/Gainer","BLA") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Gate 2",
invoke=function() loadnative("Audio/Effects/Native/Gate 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise LofiMat 2",
invoke=function() loadnative("Audio/Effects/Native/LofiMat 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Maximizer",
invoke=function() loadnative("Audio/Effects/Native/Maximizer") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Mixer EQ",
invoke=function() loadnative("Audio/Effects/Native/Mixer EQ") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise mpReverb 2",
invoke=function() loadnative("Audio/Effects/Native/mpReverb 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Multitap",
invoke=function() loadnative("Audio/Effects/Native/Multitap") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Phaser 2",
invoke=function() loadnative("Audio/Effects/Native/Phaser 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Repeater",
invoke=function() loadnative("Audio/Effects/Native/Repeater") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Reverb",
invoke=function() loadnative("Audio/Effects/Native/Reverb") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise RingMod 2",
invoke=function() loadnative("Audio/Effects/Native/RingMod 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise Stereo Expander",
invoke=function() loadnative("Audio/Effects/Native/Stereo Expander") end}
------- #
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise #Line Input",
invoke=function() loadnative("Audio/Effects/Native/#Line Input") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise #Multiband Send",
invoke=function() loadnative("Audio/Effects/Native/#Multiband Send") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise #ReWire Input",
invoke=function() loadnative("Audio/Effects/Native/#ReWire Input") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise #Send",
invoke=function() loadnative("Audio/Effects/Native/#Send") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise #Sidechain", invoke=function() loadnative("Audio/Effects/Native/#Sidechain") end}
-------- *
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *Formula",
invoke=function() loadnative("Audio/Effects/Native/*Formula") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *Hydra",
invoke=function() loadnative("Audio/Effects/Native/*Hydra") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *Instr. Automation",
invoke=function() loadnative("Audio/Effects/Native/*Instr. Automation") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *Instr. Macros",
invoke=function() loadnative("Audio/Effects/Native/*Instr. Macros") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *Instr. MIDI Control",
invoke=function() loadnative("Audio/Effects/Native/*Instr. MIDI Control") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *Key Tracker",
invoke=function() loadnative("Audio/Effects/Native/*Key Tracker") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *LFO",
invoke=function() loadnative("Audio/Effects/Native/*LFO") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *Meta Mixer",
invoke=function() loadnative("Audio/Effects/Native/*Meta Mixer") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *Signal Follower",
invoke=function() loadnative("Audio/Effects/Native/*Signal Follower") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *Velocity Tracker",
invoke=function() loadnative("Audio/Effects/Native/*Velocity Tracker") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise *XY Pad",
invoke=function() loadnative("Audio/Effects/Native/*XY Pad") end}
--- Hidden / Deprecated Renoise Native Devices
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Chorus",invoke=function() loadnative("Audio/Effects/Native/Chorus") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Comb Filter",invoke=function() loadnative("Audio/Effects/Native/Comb Filter") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Distortion",invoke=function() loadnative("Audio/Effects/Native/Distortion") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Filter",invoke=function() loadnative("Audio/Effects/Native/Filter") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Filter 2",invoke=function() loadnative("Audio/Effects/Native/Filter 2") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Filter 3",invoke=function() loadnative("Audio/Effects/Native/Filter 3") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Flanger",invoke=function() loadnative("Audio/Effects/Native/Flanger") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Gate",invoke=function() loadnative("Audio/Effects/Native/Gate") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) LofiMat",invoke=function() loadnative("Audio/Effects/Native/LofiMat") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) mpReverb",invoke=function() loadnative("Audio/Effects/Native/mpReverb") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Phaser",invoke=function() loadnative("Audio/Effects/Native/Phaser") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) RingMod",invoke=function() loadnative("Audio/Effects/Native/RingMod") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Scream Filter",invoke=function() loadnative("Audio/Effects/Native/Scream Filter") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Shaper",invoke=function() loadnative("Audio/Effects/Native/Shaper") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Renoise (Hidden) Stutter",invoke=function() loadnative("Audio/Effects/Native/Stutter") end}
------------------------------------------------------------------------------------------------------
-- Paketti-specific VST/AU EFX loading. Specific parameters set, such as:
-- Pro-Q always boots up with Pre-Post visualization on
-- TAL Reverb 4 Plugin opens with massive-ish Reverb
-- ValhallaDSP ValhallaVintageVerb opens with 50% Wet instead of 100% Wet, and a long tail
-- And each line input will become first.
function loadvst(vstname)
local checkline=nil
local s=renoise.song()
local slt=s.selected_track
local raw=renoise.app().window
local devices=s.selected_track.devices
if (table.count(s.selected_track.devices))<2 then checkline=2
else
if s.selected_track.devices[2].name=="#Line Input" then checkline=3
else checkline=2
end
end
if raw.lower_frame_is_visible==false then raw.lower_frame_is_visible=false
else raw.lower_frame_is_visible=true end
if raw.active_middle_frame == 6 then
raw.active_middle_frame = 7 end
if raw.active_middle_frame==7 then
-- Check if the selected sample device chain exists, and create one if it doesn't
local chain=s.selected_sample_device_chain
local chain_index=s.selected_sample_device_chain_index
if chain==nil or chain_index==0 then
local instrument=s.selected_instrument
instrument:insert_sample_device_chain_at(1)
chain=s.selected_sample_device_chain
chain_index=1
end
if chain then
-- Determine the valid index for inserting the device
if (table.count(chain.devices))<2 then checkline=2
else
if chain.devices[2].name=="#Line Input" then checkline=3
else checkline=2
end
end
-- Ensure checkline is within the valid range
checkline=math.min(checkline, #chain.devices + 1)
chain:insert_device_at(vstname, checkline)
local inserted_device=chain.devices[checkline]
-- Insert the rest of your logic for handling the inserted device here
if inserted_device.name=="AU: Koen Tanghe @ Smartelectronix: KTGranulator" then
return
end
inserted_device.external_editor_visible=true
inserted_device.is_maximized=false
-- Additional device-specific parameter adjustments
if inserted_device.name=="AU: Schaack Audio Technologies: TransientShaper" then
inserted_device.parameters[1].show_in_mixer=true
inserted_device.parameters[2].show_in_mixer=true
inserted_device.parameters[4].show_in_mixer=true
inserted_device.parameters[7].show_in_mixer=true
inserted_device.is_maximized=false
end
if inserted_device.name=="VST: FabFilter: Pro-Q" then
inserted_device.parameters[206].value=1
end
if inserted_device.name=="AU: TAL-Togu Audio Line: TAL Reverb 4 Plugin" then
inserted_device.parameters[2].value=0.0
inserted_device.parameters[3].value=0.30
inserted_device.parameters[4].value=0.88
inserted_device.parameters[5].value=0.9
inserted_device.parameters[6].value=1
inserted_device.parameters[7].value=0.4
inserted_device.parameters[9].value=0.7
end
if inserted_device.name=="AU: Valhalla DSP, LLC: ValhallaVintageVerb" then
inserted_device.parameters[1].value=0.474
inserted_device.parameters[3].value=0.688
inserted_device.parameters[15].value=0.097
end
if inserted_device.name=="AU: Koen Tanghe @ Smartelectronix: KTGranulator" then
inserted_device.is_maximized=true
inserted_device.parameters[31].value=1
inserted_device.parameters[16].value=0.75
inserted_device.parameters[2].value=0.50
inserted_device.parameters[3].value=0.35
inserted_device.parameters[6].value=0.75
raw.lower_frame_is_visible=true
raw.active_lower_frame=1
end
if inserted_device.name=="AU: George Yohng: W1 Limiter" then
inserted_device.is_maximized=true
inserted_device.parameters[1].show_in_mixer=true
inserted_device.parameters[2].show_in_mixer=true
end
renoise.song().selected_sample_device_index=checkline
end
else
-- Original functionality for selected track
s.selected_track:insert_device_at(vstname, checkline)
local inserted_device=s.selected_track.devices[checkline]
if inserted_device.name=="AU: Koen Tanghe @ Smartelectronix: KTGranulator" then return
else inserted_device.external_editor_visible=true end
inserted_device.is_maximized=false
renoise.song().selected_device_index=checkline
-- Additional device-specific parameter adjustments
if inserted_device.name=="AU: Schaack Audio Technologies: TransientShaper" then
inserted_device.parameters[1].show_in_mixer=true
inserted_device.parameters[2].show_in_mixer=true
inserted_device.parameters[4].show_in_mixer=true
inserted_device.parameters[7].show_in_mixer=true
inserted_device.is_maximized=false
end
if inserted_device.name=="VST: FabFilter: Pro-Q" then
inserted_device.parameters[206].value=1
end
if inserted_device.name=="AU: TAL-Togu Audio Line: TAL Reverb 4 Plugin" then
inserted_device.parameters[2].value=0.0
inserted_device.parameters[3].value=0.30
inserted_device.parameters[4].value=0.88
inserted_device.parameters[5].value=0.9
inserted_device.parameters[6].value=1
inserted_device.parameters[7].value=0.4
inserted_device.parameters[9].value=0.7
end
if inserted_device.name=="AU: Valhalla DSP, LLC: ValhallaVintageVerb" then
inserted_device.parameters[1].value=0.474
inserted_device.parameters[3].value=0.688
inserted_device.parameters[15].value=0.097
end
if inserted_device.name=="AU: Koen Tanghe @ Smartelectronix: KTGranulator" then
inserted_device.is_maximized=true
inserted_device.parameters[31].value=1
inserted_device.parameters[16].value=0.75
inserted_device.parameters[2].value=0.50
inserted_device.parameters[3].value=0.35
inserted_device.parameters[6].value=0.75
raw.lower_frame_is_visible=true
raw.active_lower_frame=1
end
if inserted_device.name=="AU: George Yohng: W1 Limiter" then
inserted_device.is_maximized=true
inserted_device.parameters[1].show_in_mixer=true
inserted_device.parameters[2].show_in_mixer=true
end
end
end
--Audio/Effects/AU/aufx:cHL1:TOGU
--Audio/Effects/AU/aumf:58h8:TOGU
--73 Audio/Effects/AU/aumf:676v:TOGU
--- AU
-- Audio/Effects/AU/aufx:sdly:appl
renoise.tool():add_keybinding{name="Global:Track Devices:Load U-He Colour Copy", invoke=function() loadvst("Audio/Effects/AU/aumf:uLyr:UHfX") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Koen KTGranulator (AU)", invoke=function() loadvst("Audio/Effects/AU/aufx:KTGr:KTfx") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Uhbik U-He Runciter", invoke=function() loadvst("Audio/Effects/AU/aumf:Rc17:UHfX") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load SphereDelay Maybe?", invoke=function() loadvst("Audio/Effects/AU/aufx:SpDl:No1z") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load D16 Syntorus 2", invoke=function() loadvst("Audio/Effects/AU/aumf:Sn8R:d16g") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load D16 Toraverb", invoke=function() loadvst("Audio/Effects/AU/aufx:T4V8:d16g") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load D16 Frontier", invoke=function() loadvst("Audio/Effects/AU/aumf:FRn7:d16g") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load D16 Toraverb 2", invoke=function() loadvst("Audio/Effects/AU/aumf:T4V9:d16g") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load D16 Repeater", invoke=function() loadvst("Audio/Effects/AU/aumf:RP78:d16g") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load D16 Repeater (2nd)", invoke=function() loadvst("Audio/Effects/AU/aumf:RP78:d16g") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load George Yohng's W1 1", invoke=function() loadvst("Audio/Effects/AU/aufx:4Fwl:Yhng") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load George Yohng's W1 2", invoke=function() loadvst("Audio/Effects/AU/aufx:4FwL:4FNT") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load OhmForce Predatohm", invoke=function() loadvst("Audio/Effects/AU/aumf:Opdh:OmFo") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load OhmForce Hematohm", invoke=function() loadvst("Audio/Effects/AU/aumf:OHmt:OmFo") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load OhmForce OhmBoyz", invoke=function() loadvst("Audio/Effects/AU/aumf:OByZ:OmFo") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load QuikQuak FusionField", invoke=function() loadvst("Audio/Effects/AU/aumf:FuFi:QkQk") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load Schaack Transient Shaper (VST)", invoke=function() loadvst("Audio/Effects/VST/TransientShaper") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load FabFilter Pro-Q 3", invoke=function() loadvst("Audio/Effects/AU/aumf:FQ3p:FabF") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load FabFilter Pro-Q 3 (VST)", invoke=function() loadvst("Audio/Effects/VST/FabFilter Pro-Q 3") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load TAL-Reverb 4", invoke=function() loadvst("Audio/Effects/AU/aufx:reV4:TOGU") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load TAL-Dub 3 AU", invoke=function() loadvst("Audio/Effects/AU/aumf:xg70:TOGU") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load TAL-Chorus LX", invoke=function() loadvst("Audio/Effects/AU/aufx:cHL1:TOGU") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load TAL-Chorus", invoke=function() loadvst("Audio/Effects/AU/aufx:Chor:Togu") end}
-- ValhallaDSP (AU)
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaRoom", invoke=function() loadvst("Audio/Effects/AU/aufx:Ruum:oDin") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaShimmer", invoke=function() loadvst("Audio/Effects/AU/aufx:shmr:oDin") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaFreqEchoMkI", invoke=function() loadvst("Audio/Effects/AU/aufx:FqEh:oDin") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaDelay", invoke=function() loadvst("Audio/Effects/AU/aufx:dLay:oDin") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaVintageVerb", invoke=function() loadvst("Audio/Effects/AU/aufx:vee3:oDin") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaSpaceModulator (AU)", invoke=function() loadvst("Audio/Effects/AU/aufx:SpMd:oDi") end}
-- ValhallaDSP (VST)
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaRoom (VST)", invoke=function() loadvst("Audio/Effects/VST/ValhallaRoom") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaShimmer (VST)", invoke=function() loadvst("Audio/Effects/VST/ValhallaShimmer") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaFreqEchoMkI (VST)", invoke=function() loadvst("Audio/Effects/VST/ValhallaFreqEcho") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaDelay (VST)", invoke=function() loadvst("Audio/Effects/VST/ValhallaDelay") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaVintageVerb (VST)", invoke=function() loadvst("Audio/Effects/VST/ValhallaVintageVerb") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load ValhallaSpaceModulator (VST)", invoke=function() loadvst("Audio/Effects/VST/ValhallaSpaceModulator") end}
----------------------------------------------------------------------------------------------------------------------------------------------- VST
renoise.tool():add_keybinding{name="Global:Track Devices:Load FabFilter Pro-Q (VST)", invoke=function() loadvst("Audio/Effects/VST/FabFilter Pro-Q") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load GRM PitchAccum Stereo (VST)", invoke=function() loadvst("Audio/Effects/VST/GRM PitchAccum Stereo") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load GRM Delays Stereo (VST)", invoke=function() loadvst("Audio/Effects/VST/GRM Delays Stereo") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load GRM Reson Stereo (VST)", invoke=function() loadvst("Audio/Effects/VST/GRM Reson Stereo") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load TAL-Dub 3 (VST)", invoke=function() loadvst("Audio/Effects/VST/TAL-Dub-3") end}
renoise.tool():add_keybinding{name="Global:Track Devices:Load WatKat (VST)", invoke=function() loadvst("Audio/Effects/VST/WatKat") end}
---------------------------------------------------------------------------------------
--- Combinations
renoise.tool():add_keybinding{name="Global:Track Devices:Load EQ10+Schaack Transient Shaper (VST)", invoke=function()
loadvst("Audio/Effects/VST/TransientShaper")
loadnative("Audio/Effects/Native/EQ 10") end}
renoise.tool():add_midi_mapping{name="Track Devices:Paketti:Load DC Offset", invoke=function(message) if message:is_trigger() then
renoise.app().window.lower_frame_is_visible=true
renoise.app().window.active_lower_frame=1
renoise.song().selected_track:insert_device_at("Audio/Effects/Native/DC Offset",2)
renoise.song().selected_device_index=2
renoise.song().selected_track.devices[2].parameters[2].value=1
end end}
nativeDevices = {
"Analog Filter", "Bus Compressor", "Cabinet Simulator", "Chorus", "Chorus 2",
"Comb Filter 2", "Compressor", "Convolver", "DC Offset", "Delay", "Digital Filter",
"Distortion 2", "Doofer", "EQ 5", "EQ 10", "Exciter", "Flanger 2", "Gainer",
"Gate 2", "LofiMat 2", "Maximizer", "Mixer EQ", "mpReverb 2", "Multitap",
"Phaser 2", "Repeater", "Reverb", "RingMod 2", "Stereo Expander", "#Line Input",
"#Multiband Send", "#ReWire Input", "#Send", "*Formula", "*Hydra", "*Instr. Automation",
"*Instr. Macros", "*Instr. MIDI Control", "*Key Tracker", "*LFO", "*Meta Mixer",
"*Signal Follower", "*Velocity Tracker", "*XY Pad"
}
nativeDeprecatedDevices = {
"Chorus", "Comb Filter", "Distortion", "Filter", "Filter 2", "Filter 3",
"Flanger", "Gate", "LofiMat", "mpReverb", "Phaser", "RingMod", "Scream Filter",
"Shaper", "Stutter"
}
-- Generate menu entries for native devices
for i, device in ipairs(nativeDevices) do
local device_path = "Audio/Effects/Native/" .. device:gsub(" ", " ")
renoise.tool():add_menu_entry{
name = "DSP Device:Paketti..:Load Renoise Native:" .. device,
invoke = function() loadnative(device_path) end
}
end
for i, device in ipairs(nativeDevices) do
local device_path = "Audio/Effects/Native/" .. device:gsub(" ", " ")
renoise.tool():add_menu_entry{
name = "Mixer:Paketti..:Load Renoise Native:" .. device,
invoke = function() loadnative(device_path) end
}
end
-- Generate menu entries for deprecated devices
for i, device in ipairs(nativeDeprecatedDevices) do
local device_path = "Audio/Effects/Native/" .. device:gsub(" ", " ")
local separator = i == 1 and "-- " or ""
renoise.tool():add_menu_entry{
name = separator .. "DSP Device:Paketti..:Load Renoise Native:(Hidden) " .. device,
invoke = function() loadnative(device_path) end
}
end
for i, device in ipairs(nativeDeprecatedDevices) do
local device_path = "Audio/Effects/Native/" .. device:gsub(" ", " ")
local separator = i == 1 and "-- " or ""
renoise.tool():add_menu_entry{
name = separator .. "Mixer:Paketti..:Load Renoise Native:(Hidden) " .. device,
invoke = function() loadnative(device_path) end
}
end
--renoise.tool():add_menu_entry{name="Instrument Box:Paketti..:writeToClipboard",invoke=function()
--writeToClipboard(for key, value in ipairs (devices) do print(key, value)
--end}
--renoise.tool():add_menu_entry{name="--Main Menu:Tools:Paketti..:Dump VST/AU/Native Effects to Clipboard", invoke=function()
--) end}
----------------------
function OpenSelectedEffectExternalEditor()
local s=renoise.song()
local devices=s.selected_track.devices
if not devices[s.selected_device_index].external_editor_visible then
devices[s.selected_device_index].external_editor_visible=true
else devices[s.selected_device_index].external_editor_visible=false
end
end
renoise.tool():add_keybinding{name="Global:Paketti:Open External Editor of Selected Effect",invoke=function() OpenSelectedEffectExternalEditor() end}
-----------------------------------------------------------------------------------------------------
renoise.tool():add_keybinding{name="Global:Paketti:Hide Track DSP Device External Editors",invoke=function()
-- Function to hide all devices in a given device chain
local function hide_devices(device_chain)
if #device_chain.devices > 1 then
for i = 2, #device_chain.devices do
if device_chain.devices[i].external_editor_available == true then
device_chain.devices[i].external_editor_visible = false
end
end
end
end
-- Hide track devices if there are any
if renoise.song().selected_track and #renoise.song().selected_track.devices > 1 then
hide_devices(renoise.song().selected_track)
end
-- Hide sample effect chains for the selected instrument if there are any
local instrument = renoise.song().selected_instrument
if instrument and #instrument.sample_device_chains > 0 then
for _, device_chain in ipairs(instrument.sample_device_chains) do
if #device_chain.devices > 1 then
hide_devices(device_chain)
end
end
end
-- Hide plugin device editor if present
if instrument and instrument.plugin_properties.plugin_device then
local pd = instrument.plugin_properties.plugin_device
if pd.external_editor_available == true then
pd.external_editor_visible = false
end
end
end}
--------------------------
-- Function to inspect the selected plugin
function inspectPlugin()
local s = renoise.song()
local plugin = s.selected_instrument.plugin_properties.plugin_device
-- Check if there is a plugin in the selected instrument
if not plugin then
renoise.app():show_status("No plugin in this instrument")
return
end
-- Iterate over the plugin parameters and print their details
for i = 1, #plugin.parameters do
oprint(
plugin.name .. ": " .. i .. ": " .. plugin.parameters[i].name .. ": " ..
"renoise.song().selected_instrument.plugin_properties.plugin_device.parameters[" .. i .. "].value=" .. plugin.parameters[i].value
)
end
end
-- Adding keybinding for the inspectPlugin function
renoise.tool():add_keybinding{name="Global:Paketti:Inspect Plugin", invoke=function() inspectPlugin() end}
-- Function to inspect the effect in device slot 2
function inspectEffect()
local devices = renoise.song().selected_track.devices
-- Check if there is an effect in device slot 2
if not devices[2] then
renoise.app():show_status("No effect in device slot 2")
return
end
-- Print details of the effect in device slot 2
oprint("Effect Displayname: " .. devices[2].display_name)
oprint("Effect Name: " .. devices[2].name)
oprint("Effect Path: " .. devices[2].device_path)
-- Iterate over the effect parameters and print their details
for i = 1, #devices[2].parameters do
oprint(
devices[2].name .. ": " .. i .. ": " .. devices[2].parameters[i].name .. ": " ..
"renoise.song().selected_track.devices[2].parameters[" .. i .. "].value=" .. devices[2].parameters[i].value
)
end
end
-- Adding keybinding for the inspectEffect function
renoise.tool():add_keybinding{name="Global:Paketti:Inspect Device in Slot 2", invoke=function() inspectEffect() end}
------------------------------------------------------------------------------------------------------
-- Add the menu entry to show plugin details
-- Add the menu entry to show plugin details
renoise.tool():add_menu_entry{name="--Main Menu:Tools:Paketti..:Plugins/Devices..:Debug..:Show Plugin Details",invoke=function() show_plugin_details_gui() end}
-- Declare the customdialog variable at the beginning
customdialog = nil
-- Utility function to fetch, sort, and group available plugins by type
function get_sorted_and_grouped_plugin_infos()
local audio_units = {}
local vsts = {}
local vst3s = {}
local instrument = renoise.song().instruments[renoise.song().selected_instrument_index]
if instrument.plugin_properties and #instrument.plugin_properties.available_plugin_infos > 0 then
for _, plugin_info in ipairs(instrument.plugin_properties.available_plugin_infos) do
local plugin_type = determine_plugin_type(plugin_info.path)
local entry = {
name=plugin_type .. ": " .. (plugin_info.name or "Unnamed Plugin"),
details = plugin_info
}
if plugin_type == "AU" then
table.insert(audio_units, entry)
elseif plugin_type == "VST3" then
table.insert(vst3s, entry)
else
table.insert(vsts, entry)
end
end
end
-- Sort each group alphabetically by name
local sorter = function(a, b) return a.name < b.name end
table.sort(audio_units, sorter)
table.sort(vsts, sorter)
table.sort(vst3s, sorter)
-- Combine groups in order: Audio Units, VSTs, VST3s
return table_concat(audio_units, vsts, vst3s)
end
-- Utility function to determine plugin type from path
function determine_plugin_type(path)
if path and path:lower():find("/au/") then
return "AU"
elseif path and path:lower():find("/vst3/") then
return "VST3"
elseif path and path:lower():find("/vst/") then
return "VST"
else
return "Unknown Type"
end
end
-- Utility function to concatenate tables
function table_concat(...)
local result = {}
for _, list in ipairs({...}) do
for _, v in ipairs(list) do
table.insert(result, v)
end
end
return result
end
-- Function to display selected plugin details
function display_selected_plugin_details(index, available_plugin_infos)
local plugin_info = available_plugin_infos[index - 1] -- Adjust for the placeholder
if plugin_info then
local details = {
"Name: " .. plugin_info.details.name,
"Path: " .. plugin_info.details.path,
"Favorite: " .. (plugin_info.details.is_favorite and "Yes" or "No")
}
return table.concat(details, "\n")
else
return "Please select a plugin to see details."
end
end
-- Function to show the plugin details GUI
function show_plugin_details_gui()
local vb = renoise.ViewBuilder()
local available_plugin_infos = get_sorted_and_grouped_plugin_infos()
local dialog_content = vb:column {
margin = 10,
spacing = 5,
vb:row {
vb:column {
width = 300,
vb:text {
text = "Available Plugins:"
},
vb:popup {
id = "plugins_list",
items = {"--Select a Plugin--"}, -- Placeholder at index 1
width = 300,
notifier = function(index)
vb.views.plugin_details.text = display_selected_plugin_details(index, available_plugin_infos)
end
}
},
vb:column {
spacing = 5,