-
Notifications
You must be signed in to change notification settings - Fork 0
/
midi_crosstalk_fixer
131 lines (93 loc) · 15.4 KB
/
midi_crosstalk_fixer
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
/*
A Reaper JS plugin (MIDI effect).
MIDI Crosstalk Fixer:
The plugin cancels any low-velocity MIDI Note On and Note Off messages
that come right after a high-velocity other note Note On message (within
a specific time period). This is useful when mixing various drum MIDI
sources (e.g. several modules) which don't have shared crosstalk
cancellation support.
High- and low-velocity notes may be specified explicitly if the former
is most likely to trigger the latter.
Written in 2014 by Alexander Shaduri <ashaduri 'at' gmail.com>
Changelog:
1.0.1 - Added note names.
1.0.0 - First public release.
Copyright:
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to the
public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication
along with this software. If not, see:
http://creativecommons.org/publicdomain/zero/1.0/
*/
desc: MIDI cross-talk fixer
slider1:0<0,16,1{Any,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}>Input MIDI channel:
slider2:0<0,128,1{0 / 0x00 / C0,1 / 0x01 / C#0,2 / 0x02 / D0,3 / 0x03 / D#0,4 / 0x04 / E0,5 / 0x05 / F0,6 / 0x06 / F#0,7 / 0x07 / G0,8 / 0x08 / G#0,9 / 0x09 / A0,10 / 0x0A / A#0,11 / 0x0B / B0,12 / 0x0C / C1,13 / 0x0D / C#1,14 / 0x0E / D1,15 / 0x0F / D#1,16 / 0x10 / E1,17 / 0x11 / F1,18 / 0x12 / F#1,19 / 0x13 / G1,20 / 0x14 / G#1,21 / 0x15 / A1,22 / 0x16 / A#1,23 / 0x17 / B1,24 / 0x18 / C2,25 / 0x19 / C#2,26 / 0x1A / D2,27 / 0x1B / D#2,28 / 0x1C / E2,29 / 0x1D / F2,30 / 0x1E / F#2,31 / 0x1F / G2,32 / 0x20 / G#2,33 / 0x21 / A2,34 / 0x22 / A#2,35 / 0x23 / B2,36 / 0x24 / C3,37 / 0x25 / C#3,38 / 0x26 / D3,39 / 0x27 / D#3,40 / 0x28 / E3,41 / 0x29 / F3,42 / 0x2A / F#3,43 / 0x2B / G3,44 / 0x2C / G#3,45 / 0x2D / A3,46 / 0x2E / A#3,47 / 0x2F / B3,48 / 0x30 / C4,49 / 0x31 / C#4,50 / 0x32 / D4,51 / 0x33 / D#4,52 / 0x34 / E4,53 / 0x35 / F4,54 / 0x36 / F#4,55 / 0x37 / G4,56 / 0x38 / G#4,57 / 0x39 / A4,58 / 0x3A / A#4,59 / 0x3B / B4,60 / 0x3C / C5,61 / 0x3D / C#5,62 / 0x3E / D5,63 / 0x3F / D#5,64 / 0x40 / E5,65 / 0x41 / F5,66 / 0x42 / F#5,67 / 0x43 / G5,68 / 0x44 / G#5,69 / 0x45 / A5,70 / 0x46 / A#5,71 / 0x47 / B5,72 / 0x48 / C6,73 / 0x49 / C#6,74 / 0x4A / D6,75 / 0x4B / D#6,76 / 0x4C / E6,77 / 0x4D / F6,78 / 0x4E / F#6,79 / 0x4F / G6,80 / 0x50 / G#6,81 / 0x51 / A6,82 / 0x52 / A#6,83 / 0x53 / B6,84 / 0x54 / C7,85 / 0x55 / C#7,86 / 0x56 / D7,87 / 0x57 / D#7,88 / 0x58 / E7,89 / 0x59 / F7,90 / 0x5A / F#7,91 / 0x5B / G7,92 / 0x5C / G#7,93 / 0x5D / A7,94 / 0x5E / A#7,95 / 0x5F / B7,96 / 0x60 / C8,97 / 0x61 / C#8,98 / 0x62 / D8,99 / 0x63 / D#8,100 / 0x64 / E8,101 / 0x65 / F8,102 / 0x66 / F#8,103 / 0x67 / G8,104 / 0x68 / G#8,105 / 0x69 / A8,106 / 0x6A / A#8,107 / 0x6B / B8,108 / 0x6C / C9,109 / 0x6D / C#9,110 / 0x6E / D9,111 / 0x6F / D#9,112 / 0x70 / E9,113 / 0x71 / F9,114 / 0x72 / F#9,115 / 0x73 / G9,116 / 0x74 / G#9,117 / 0x75 / A9,118 / 0x76 / A#9,119 / 0x77 / B9,120 / 0x78 / C10,121 / 0x79 / C#10,122 / 0x7A / D10,123 / 0x7B / D#10,124 / 0x7C / E10,125 / 0x7D / F10,126 / 0x7E / F#10,127 / 0x7F / G10,Any}>High-velocity note:
slider3:0<0,128,1{0 / 0x00 / C0,1 / 0x01 / C#0,2 / 0x02 / D0,3 / 0x03 / D#0,4 / 0x04 / E0,5 / 0x05 / F0,6 / 0x06 / F#0,7 / 0x07 / G0,8 / 0x08 / G#0,9 / 0x09 / A0,10 / 0x0A / A#0,11 / 0x0B / B0,12 / 0x0C / C1,13 / 0x0D / C#1,14 / 0x0E / D1,15 / 0x0F / D#1,16 / 0x10 / E1,17 / 0x11 / F1,18 / 0x12 / F#1,19 / 0x13 / G1,20 / 0x14 / G#1,21 / 0x15 / A1,22 / 0x16 / A#1,23 / 0x17 / B1,24 / 0x18 / C2,25 / 0x19 / C#2,26 / 0x1A / D2,27 / 0x1B / D#2,28 / 0x1C / E2,29 / 0x1D / F2,30 / 0x1E / F#2,31 / 0x1F / G2,32 / 0x20 / G#2,33 / 0x21 / A2,34 / 0x22 / A#2,35 / 0x23 / B2,36 / 0x24 / C3,37 / 0x25 / C#3,38 / 0x26 / D3,39 / 0x27 / D#3,40 / 0x28 / E3,41 / 0x29 / F3,42 / 0x2A / F#3,43 / 0x2B / G3,44 / 0x2C / G#3,45 / 0x2D / A3,46 / 0x2E / A#3,47 / 0x2F / B3,48 / 0x30 / C4,49 / 0x31 / C#4,50 / 0x32 / D4,51 / 0x33 / D#4,52 / 0x34 / E4,53 / 0x35 / F4,54 / 0x36 / F#4,55 / 0x37 / G4,56 / 0x38 / G#4,57 / 0x39 / A4,58 / 0x3A / A#4,59 / 0x3B / B4,60 / 0x3C / C5,61 / 0x3D / C#5,62 / 0x3E / D5,63 / 0x3F / D#5,64 / 0x40 / E5,65 / 0x41 / F5,66 / 0x42 / F#5,67 / 0x43 / G5,68 / 0x44 / G#5,69 / 0x45 / A5,70 / 0x46 / A#5,71 / 0x47 / B5,72 / 0x48 / C6,73 / 0x49 / C#6,74 / 0x4A / D6,75 / 0x4B / D#6,76 / 0x4C / E6,77 / 0x4D / F6,78 / 0x4E / F#6,79 / 0x4F / G6,80 / 0x50 / G#6,81 / 0x51 / A6,82 / 0x52 / A#6,83 / 0x53 / B6,84 / 0x54 / C7,85 / 0x55 / C#7,86 / 0x56 / D7,87 / 0x57 / D#7,88 / 0x58 / E7,89 / 0x59 / F7,90 / 0x5A / F#7,91 / 0x5B / G7,92 / 0x5C / G#7,93 / 0x5D / A7,94 / 0x5E / A#7,95 / 0x5F / B7,96 / 0x60 / C8,97 / 0x61 / C#8,98 / 0x62 / D8,99 / 0x63 / D#8,100 / 0x64 / E8,101 / 0x65 / F8,102 / 0x66 / F#8,103 / 0x67 / G8,104 / 0x68 / G#8,105 / 0x69 / A8,106 / 0x6A / A#8,107 / 0x6B / B8,108 / 0x6C / C9,109 / 0x6D / C#9,110 / 0x6E / D9,111 / 0x6F / D#9,112 / 0x70 / E9,113 / 0x71 / F9,114 / 0x72 / F#9,115 / 0x73 / G9,116 / 0x74 / G#9,117 / 0x75 / A9,118 / 0x76 / A#9,119 / 0x77 / B9,120 / 0x78 / C10,121 / 0x79 / C#10,122 / 0x7A / D10,123 / 0x7B / D#10,124 / 0x7C / E10,125 / 0x7D / F10,126 / 0x7E / F#10,127 / 0x7F / G10,None}>High-velocity extra note 1:
slider4:0<0,128,1{0 / 0x00 / C0,1 / 0x01 / C#0,2 / 0x02 / D0,3 / 0x03 / D#0,4 / 0x04 / E0,5 / 0x05 / F0,6 / 0x06 / F#0,7 / 0x07 / G0,8 / 0x08 / G#0,9 / 0x09 / A0,10 / 0x0A / A#0,11 / 0x0B / B0,12 / 0x0C / C1,13 / 0x0D / C#1,14 / 0x0E / D1,15 / 0x0F / D#1,16 / 0x10 / E1,17 / 0x11 / F1,18 / 0x12 / F#1,19 / 0x13 / G1,20 / 0x14 / G#1,21 / 0x15 / A1,22 / 0x16 / A#1,23 / 0x17 / B1,24 / 0x18 / C2,25 / 0x19 / C#2,26 / 0x1A / D2,27 / 0x1B / D#2,28 / 0x1C / E2,29 / 0x1D / F2,30 / 0x1E / F#2,31 / 0x1F / G2,32 / 0x20 / G#2,33 / 0x21 / A2,34 / 0x22 / A#2,35 / 0x23 / B2,36 / 0x24 / C3,37 / 0x25 / C#3,38 / 0x26 / D3,39 / 0x27 / D#3,40 / 0x28 / E3,41 / 0x29 / F3,42 / 0x2A / F#3,43 / 0x2B / G3,44 / 0x2C / G#3,45 / 0x2D / A3,46 / 0x2E / A#3,47 / 0x2F / B3,48 / 0x30 / C4,49 / 0x31 / C#4,50 / 0x32 / D4,51 / 0x33 / D#4,52 / 0x34 / E4,53 / 0x35 / F4,54 / 0x36 / F#4,55 / 0x37 / G4,56 / 0x38 / G#4,57 / 0x39 / A4,58 / 0x3A / A#4,59 / 0x3B / B4,60 / 0x3C / C5,61 / 0x3D / C#5,62 / 0x3E / D5,63 / 0x3F / D#5,64 / 0x40 / E5,65 / 0x41 / F5,66 / 0x42 / F#5,67 / 0x43 / G5,68 / 0x44 / G#5,69 / 0x45 / A5,70 / 0x46 / A#5,71 / 0x47 / B5,72 / 0x48 / C6,73 / 0x49 / C#6,74 / 0x4A / D6,75 / 0x4B / D#6,76 / 0x4C / E6,77 / 0x4D / F6,78 / 0x4E / F#6,79 / 0x4F / G6,80 / 0x50 / G#6,81 / 0x51 / A6,82 / 0x52 / A#6,83 / 0x53 / B6,84 / 0x54 / C7,85 / 0x55 / C#7,86 / 0x56 / D7,87 / 0x57 / D#7,88 / 0x58 / E7,89 / 0x59 / F7,90 / 0x5A / F#7,91 / 0x5B / G7,92 / 0x5C / G#7,93 / 0x5D / A7,94 / 0x5E / A#7,95 / 0x5F / B7,96 / 0x60 / C8,97 / 0x61 / C#8,98 / 0x62 / D8,99 / 0x63 / D#8,100 / 0x64 / E8,101 / 0x65 / F8,102 / 0x66 / F#8,103 / 0x67 / G8,104 / 0x68 / G#8,105 / 0x69 / A8,106 / 0x6A / A#8,107 / 0x6B / B8,108 / 0x6C / C9,109 / 0x6D / C#9,110 / 0x6E / D9,111 / 0x6F / D#9,112 / 0x70 / E9,113 / 0x71 / F9,114 / 0x72 / F#9,115 / 0x73 / G9,116 / 0x74 / G#9,117 / 0x75 / A9,118 / 0x76 / A#9,119 / 0x77 / B9,120 / 0x78 / C10,121 / 0x79 / C#10,122 / 0x7A / D10,123 / 0x7B / D#10,124 / 0x7C / E10,125 / 0x7D / F10,126 / 0x7E / F#10,127 / 0x7F / G10,None}>High-velocity extra note 2:
slider5:0<0,128,1{0 / 0x00 / C0,1 / 0x01 / C#0,2 / 0x02 / D0,3 / 0x03 / D#0,4 / 0x04 / E0,5 / 0x05 / F0,6 / 0x06 / F#0,7 / 0x07 / G0,8 / 0x08 / G#0,9 / 0x09 / A0,10 / 0x0A / A#0,11 / 0x0B / B0,12 / 0x0C / C1,13 / 0x0D / C#1,14 / 0x0E / D1,15 / 0x0F / D#1,16 / 0x10 / E1,17 / 0x11 / F1,18 / 0x12 / F#1,19 / 0x13 / G1,20 / 0x14 / G#1,21 / 0x15 / A1,22 / 0x16 / A#1,23 / 0x17 / B1,24 / 0x18 / C2,25 / 0x19 / C#2,26 / 0x1A / D2,27 / 0x1B / D#2,28 / 0x1C / E2,29 / 0x1D / F2,30 / 0x1E / F#2,31 / 0x1F / G2,32 / 0x20 / G#2,33 / 0x21 / A2,34 / 0x22 / A#2,35 / 0x23 / B2,36 / 0x24 / C3,37 / 0x25 / C#3,38 / 0x26 / D3,39 / 0x27 / D#3,40 / 0x28 / E3,41 / 0x29 / F3,42 / 0x2A / F#3,43 / 0x2B / G3,44 / 0x2C / G#3,45 / 0x2D / A3,46 / 0x2E / A#3,47 / 0x2F / B3,48 / 0x30 / C4,49 / 0x31 / C#4,50 / 0x32 / D4,51 / 0x33 / D#4,52 / 0x34 / E4,53 / 0x35 / F4,54 / 0x36 / F#4,55 / 0x37 / G4,56 / 0x38 / G#4,57 / 0x39 / A4,58 / 0x3A / A#4,59 / 0x3B / B4,60 / 0x3C / C5,61 / 0x3D / C#5,62 / 0x3E / D5,63 / 0x3F / D#5,64 / 0x40 / E5,65 / 0x41 / F5,66 / 0x42 / F#5,67 / 0x43 / G5,68 / 0x44 / G#5,69 / 0x45 / A5,70 / 0x46 / A#5,71 / 0x47 / B5,72 / 0x48 / C6,73 / 0x49 / C#6,74 / 0x4A / D6,75 / 0x4B / D#6,76 / 0x4C / E6,77 / 0x4D / F6,78 / 0x4E / F#6,79 / 0x4F / G6,80 / 0x50 / G#6,81 / 0x51 / A6,82 / 0x52 / A#6,83 / 0x53 / B6,84 / 0x54 / C7,85 / 0x55 / C#7,86 / 0x56 / D7,87 / 0x57 / D#7,88 / 0x58 / E7,89 / 0x59 / F7,90 / 0x5A / F#7,91 / 0x5B / G7,92 / 0x5C / G#7,93 / 0x5D / A7,94 / 0x5E / A#7,95 / 0x5F / B7,96 / 0x60 / C8,97 / 0x61 / C#8,98 / 0x62 / D8,99 / 0x63 / D#8,100 / 0x64 / E8,101 / 0x65 / F8,102 / 0x66 / F#8,103 / 0x67 / G8,104 / 0x68 / G#8,105 / 0x69 / A8,106 / 0x6A / A#8,107 / 0x6B / B8,108 / 0x6C / C9,109 / 0x6D / C#9,110 / 0x6E / D9,111 / 0x6F / D#9,112 / 0x70 / E9,113 / 0x71 / F9,114 / 0x72 / F#9,115 / 0x73 / G9,116 / 0x74 / G#9,117 / 0x75 / A9,118 / 0x76 / A#9,119 / 0x77 / B9,120 / 0x78 / C10,121 / 0x79 / C#10,122 / 0x7A / D10,123 / 0x7B / D#10,124 / 0x7C / E10,125 / 0x7D / F10,126 / 0x7E / F#10,127 / 0x7F / G10,Any}>Low-velocity note:
slider6:0<0,128,1{0 / 0x00 / C0,1 / 0x01 / C#0,2 / 0x02 / D0,3 / 0x03 / D#0,4 / 0x04 / E0,5 / 0x05 / F0,6 / 0x06 / F#0,7 / 0x07 / G0,8 / 0x08 / G#0,9 / 0x09 / A0,10 / 0x0A / A#0,11 / 0x0B / B0,12 / 0x0C / C1,13 / 0x0D / C#1,14 / 0x0E / D1,15 / 0x0F / D#1,16 / 0x10 / E1,17 / 0x11 / F1,18 / 0x12 / F#1,19 / 0x13 / G1,20 / 0x14 / G#1,21 / 0x15 / A1,22 / 0x16 / A#1,23 / 0x17 / B1,24 / 0x18 / C2,25 / 0x19 / C#2,26 / 0x1A / D2,27 / 0x1B / D#2,28 / 0x1C / E2,29 / 0x1D / F2,30 / 0x1E / F#2,31 / 0x1F / G2,32 / 0x20 / G#2,33 / 0x21 / A2,34 / 0x22 / A#2,35 / 0x23 / B2,36 / 0x24 / C3,37 / 0x25 / C#3,38 / 0x26 / D3,39 / 0x27 / D#3,40 / 0x28 / E3,41 / 0x29 / F3,42 / 0x2A / F#3,43 / 0x2B / G3,44 / 0x2C / G#3,45 / 0x2D / A3,46 / 0x2E / A#3,47 / 0x2F / B3,48 / 0x30 / C4,49 / 0x31 / C#4,50 / 0x32 / D4,51 / 0x33 / D#4,52 / 0x34 / E4,53 / 0x35 / F4,54 / 0x36 / F#4,55 / 0x37 / G4,56 / 0x38 / G#4,57 / 0x39 / A4,58 / 0x3A / A#4,59 / 0x3B / B4,60 / 0x3C / C5,61 / 0x3D / C#5,62 / 0x3E / D5,63 / 0x3F / D#5,64 / 0x40 / E5,65 / 0x41 / F5,66 / 0x42 / F#5,67 / 0x43 / G5,68 / 0x44 / G#5,69 / 0x45 / A5,70 / 0x46 / A#5,71 / 0x47 / B5,72 / 0x48 / C6,73 / 0x49 / C#6,74 / 0x4A / D6,75 / 0x4B / D#6,76 / 0x4C / E6,77 / 0x4D / F6,78 / 0x4E / F#6,79 / 0x4F / G6,80 / 0x50 / G#6,81 / 0x51 / A6,82 / 0x52 / A#6,83 / 0x53 / B6,84 / 0x54 / C7,85 / 0x55 / C#7,86 / 0x56 / D7,87 / 0x57 / D#7,88 / 0x58 / E7,89 / 0x59 / F7,90 / 0x5A / F#7,91 / 0x5B / G7,92 / 0x5C / G#7,93 / 0x5D / A7,94 / 0x5E / A#7,95 / 0x5F / B7,96 / 0x60 / C8,97 / 0x61 / C#8,98 / 0x62 / D8,99 / 0x63 / D#8,100 / 0x64 / E8,101 / 0x65 / F8,102 / 0x66 / F#8,103 / 0x67 / G8,104 / 0x68 / G#8,105 / 0x69 / A8,106 / 0x6A / A#8,107 / 0x6B / B8,108 / 0x6C / C9,109 / 0x6D / C#9,110 / 0x6E / D9,111 / 0x6F / D#9,112 / 0x70 / E9,113 / 0x71 / F9,114 / 0x72 / F#9,115 / 0x73 / G9,116 / 0x74 / G#9,117 / 0x75 / A9,118 / 0x76 / A#9,119 / 0x77 / B9,120 / 0x78 / C10,121 / 0x79 / C#10,122 / 0x7A / D10,123 / 0x7B / D#10,124 / 0x7C / E10,125 / 0x7D / F10,126 / 0x7E / F#10,127 / 0x7F / G10,None}>Low-velocity extra note 1:
slider7:0<0,128,1{0 / 0x00 / C0,1 / 0x01 / C#0,2 / 0x02 / D0,3 / 0x03 / D#0,4 / 0x04 / E0,5 / 0x05 / F0,6 / 0x06 / F#0,7 / 0x07 / G0,8 / 0x08 / G#0,9 / 0x09 / A0,10 / 0x0A / A#0,11 / 0x0B / B0,12 / 0x0C / C1,13 / 0x0D / C#1,14 / 0x0E / D1,15 / 0x0F / D#1,16 / 0x10 / E1,17 / 0x11 / F1,18 / 0x12 / F#1,19 / 0x13 / G1,20 / 0x14 / G#1,21 / 0x15 / A1,22 / 0x16 / A#1,23 / 0x17 / B1,24 / 0x18 / C2,25 / 0x19 / C#2,26 / 0x1A / D2,27 / 0x1B / D#2,28 / 0x1C / E2,29 / 0x1D / F2,30 / 0x1E / F#2,31 / 0x1F / G2,32 / 0x20 / G#2,33 / 0x21 / A2,34 / 0x22 / A#2,35 / 0x23 / B2,36 / 0x24 / C3,37 / 0x25 / C#3,38 / 0x26 / D3,39 / 0x27 / D#3,40 / 0x28 / E3,41 / 0x29 / F3,42 / 0x2A / F#3,43 / 0x2B / G3,44 / 0x2C / G#3,45 / 0x2D / A3,46 / 0x2E / A#3,47 / 0x2F / B3,48 / 0x30 / C4,49 / 0x31 / C#4,50 / 0x32 / D4,51 / 0x33 / D#4,52 / 0x34 / E4,53 / 0x35 / F4,54 / 0x36 / F#4,55 / 0x37 / G4,56 / 0x38 / G#4,57 / 0x39 / A4,58 / 0x3A / A#4,59 / 0x3B / B4,60 / 0x3C / C5,61 / 0x3D / C#5,62 / 0x3E / D5,63 / 0x3F / D#5,64 / 0x40 / E5,65 / 0x41 / F5,66 / 0x42 / F#5,67 / 0x43 / G5,68 / 0x44 / G#5,69 / 0x45 / A5,70 / 0x46 / A#5,71 / 0x47 / B5,72 / 0x48 / C6,73 / 0x49 / C#6,74 / 0x4A / D6,75 / 0x4B / D#6,76 / 0x4C / E6,77 / 0x4D / F6,78 / 0x4E / F#6,79 / 0x4F / G6,80 / 0x50 / G#6,81 / 0x51 / A6,82 / 0x52 / A#6,83 / 0x53 / B6,84 / 0x54 / C7,85 / 0x55 / C#7,86 / 0x56 / D7,87 / 0x57 / D#7,88 / 0x58 / E7,89 / 0x59 / F7,90 / 0x5A / F#7,91 / 0x5B / G7,92 / 0x5C / G#7,93 / 0x5D / A7,94 / 0x5E / A#7,95 / 0x5F / B7,96 / 0x60 / C8,97 / 0x61 / C#8,98 / 0x62 / D8,99 / 0x63 / D#8,100 / 0x64 / E8,101 / 0x65 / F8,102 / 0x66 / F#8,103 / 0x67 / G8,104 / 0x68 / G#8,105 / 0x69 / A8,106 / 0x6A / A#8,107 / 0x6B / B8,108 / 0x6C / C9,109 / 0x6D / C#9,110 / 0x6E / D9,111 / 0x6F / D#9,112 / 0x70 / E9,113 / 0x71 / F9,114 / 0x72 / F#9,115 / 0x73 / G9,116 / 0x74 / G#9,117 / 0x75 / A9,118 / 0x76 / A#9,119 / 0x77 / B9,120 / 0x78 / C10,121 / 0x79 / C#10,122 / 0x7A / D10,123 / 0x7B / D#10,124 / 0x7C / E10,125 / 0x7D / F10,126 / 0x7E / F#10,127 / 0x7F / G10,None}>Low-velocity extra note 2:
slider8:100<0,127,1>Min. high note velocity:
slider9:10<0,127,1>Max. low note velocity:
slider10:0<0,1000,1>Max. delay amount (ms):
slider11:0<0,40000,1>Max. additional delay (samples):
// MIDI-only FX should always have these lines for optimization
in_pin:none
out_pin:none
@init
MSG_NOTE_OFF = 8 * 16;
MSG_NOTE_ON = 9 * 16;
@slider
user_in_channel = slider1 - 1;
user_high_velocity_note1 = slider2;
user_high_velocity_note2 = slider3;
user_high_velocity_note3 = slider4;
user_low_velocity_note1 = slider5;
user_low_velocity_note2 = slider6;
user_low_velocity_note3 = slider7;
user_min_high_velocity= slider8;
user_max_low_velocity= slider9;
user_delay_ms= slider10;
user_delay_samples = slider11;
delaylen = (user_delay_ms * srate * 0.001 + user_delay_samples) | 0;
@block
timer > 0 ? timer -= samplesblock;
while (
midirecv(offset,msg1,msg23) ? (
channel = msg1 & 15; // Low four bits is channel number (15 == 00001111)
// Is it on our channel or are we using all channels?
(channel == user_in_channel || user_in_channel == -1) ? (
msg_type = msg1 & 240; // High four bits is message type (240 == 11110000)
block_sending = 0;
high_note_matched = 0;
// If this is a high note event, store its time
(msg_type == MSG_NOTE_ON) ? (
note = msg23 & 127;
(note == user_high_velocity_note1 || user_high_velocity_note1 == -1
|| note == user_high_velocity_note2 || note == user_high_velocity_note3) ? (
velocity = (msg23 / 256) | 0;
(velocity >= user_min_high_velocity) ? (
timer = delaylen - (samplesblock - offset);
high_note_matched = 1;
);
);
);
// Maybe we should leave Note Off alone, since there may be
// an (On, On, Off, Off) situation.
(!high_note_matched && msg_type == MSG_NOTE_ON) ? ( // || msg_type == MSG_NOTE_OFF
(note == user_low_velocity_note1 || user_low_velocity_note1 == -1
|| note == user_low_velocity_note2 || note == user_low_velocity_note3) ? (
velocity = (msg23 / 256) | 0;
(velocity <= user_max_low_velocity && (timer - offset) >= 1) ? (
block_sending=1;
);
);
);
);
(!block_sending) ? (
midisend(offset,msg1,msg23); // Send the data
);
1; // Continue until all messages are processed
);
);