summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-03-09 22:07:41 +0100
committerRobin Gareus <robin@gareus.org>2020-03-09 22:12:23 +0100
commit1d17993a292c914a630f460ce34c098bfa535226 (patch)
treeb28158678664078100fd418d1e61d7e83cf12842 /share
parent810b2fb78d89b24de7f35ca8429e384ab5125a22 (diff)
Revert failed experiment, scripted multiple MIDI outputs via dsp_run()
This reverts commit 8702ff2189665b473918ed60f34b6be4010a06f7, and b10d9cf09bf6150f0ba0eae5dc34fd8db8b2fa91. There was a misconception on the iterator (port vs message in sequence), besides Ardour's mixer-strip is preferably used with a single MIDI port. Most plugin-standards also only support one port. If need be LuaDSP run_map() can be used to handle multiple MIDI I/O ports already.
Diffstat (limited to 'share')
-rw-r--r--share/scripts/_midigenerator_multi_ports.lua48
1 files changed, 0 insertions, 48 deletions
diff --git a/share/scripts/_midigenerator_multi_ports.lua b/share/scripts/_midigenerator_multi_ports.lua
deleted file mode 100644
index a61db04e5a..0000000000
--- a/share/scripts/_midigenerator_multi_ports.lua
+++ /dev/null
@@ -1,48 +0,0 @@
-ardour {
- ["type"] = "dsp",
- name = "MIDI generator with multiple ports",
- category = "Example",
- license = "MIT",
- author = "R8000",
- description = [[An Example Midi Generator for prototyping.]]
-}
-
-function dsp_ioconfig () return { { midi_out = 5} } end
-
-local tme = 0 -- sample-counter
-local seq = 0 -- sequence-step
-local spb = 0 -- samples per beat
-
-local midi_sequence_one = {
- { 0x90, 64, 127 },
- { 0x80, 64, 0 },
-}
-local midi_sequence_two = {
- { 0x90, 60, 70 },
- { 0x80, 60, 0 },
-}
-
-local midi_sequences = { midi_sequence_one, midi_sequence_two }
-
-function dsp_init (rate)
- local bpm = 120
- spb = rate * 60 / bpm
- if spb < 2 then spb = 2 end
-end
-
-function dsp_run (_, _, n_samples)
- assert (type(midiout) == "table")
- assert (spb > 1)
-
- for time = 1,n_samples do -- not very efficient
- -- TODO, timestamp the sequence in beats, calc/skip to next event
- tme = tme + 1
- if tme >= spb then
- for m = 1, 5 do
- midiout[m] = {time = time, data = midi_sequences[m % 2 + 1][seq + 1]}
- end
- tme = 0
- seq = (seq + 1) % 2
- end
- end
-end