diff options
Diffstat (limited to 'src/clipboard.c')
-rw-r--r-- | src/clipboard.c | 135 |
1 files changed, 92 insertions, 43 deletions
diff --git a/src/clipboard.c b/src/clipboard.c index d82f576..e92d4c5 100644 --- a/src/clipboard.c +++ b/src/clipboard.c | |||
@@ -37,20 +37,25 @@ clipboard_paste(void) { | |||
37 | case 0: { | 37 | case 0: { |
38 | pat_dst->ch1.notes[trig_selection_loc] = pat_src->ch1.notes[clipboard.src_trig]; | 38 | pat_dst->ch1.notes[trig_selection_loc] = pat_src->ch1.notes[clipboard.src_trig]; |
39 | pat_dst->ch1.params[trig_selection_loc] = pat_src->ch1.params[clipboard.src_trig]; | 39 | pat_dst->ch1.params[trig_selection_loc] = pat_src->ch1.params[clipboard.src_trig]; |
40 | send_notif("PASTED NOTE & PARAMS"); | ||
41 | } break; | 40 | } break; |
42 | case 1: { | 41 | case 1: { |
43 | pat_dst->ch2.notes[trig_selection_loc] = pat_src->ch1.notes[clipboard.src_trig]; | 42 | pat_dst->ch2.notes[trig_selection_loc] = pat_src->ch1.notes[clipboard.src_trig]; |
44 | pat_dst->ch2.params[trig_selection_loc] = pat_src->ch1.params[clipboard.src_trig]; | 43 | pat_dst->ch2.params[trig_selection_loc].env_volume = pat_src->ch1.params[clipboard.src_trig].env_volume; |
45 | send_notif("PASTED NOTE & PARAMS"); | 44 | pat_dst->ch2.params[trig_selection_loc].env_time = pat_src->ch1.params[clipboard.src_trig].env_time; |
45 | pat_dst->ch2.params[trig_selection_loc].env_direction = pat_src->ch1.params[clipboard.src_trig].env_direction; | ||
46 | pat_dst->ch2.params[trig_selection_loc].duty_cycle = pat_src->ch1.params[clipboard.src_trig].duty_cycle; | ||
47 | pat_dst->ch2.params[trig_selection_loc].prob = pat_src->ch1.params[clipboard.src_trig].prob; | ||
48 | pat_dst->ch2.params[trig_selection_loc].pan = pat_src->ch1.params[clipboard.src_trig].pan; | ||
46 | } break; | 49 | } break; |
47 | case 2: { | 50 | case 2: { |
48 | pat_dst->ch3.notes[trig_selection_loc] = pat_src->ch1.notes[clipboard.src_trig]; | 51 | pat_dst->ch3.notes[trig_selection_loc] = pat_src->ch1.notes[clipboard.src_trig]; |
49 | send_notif("PASTED NOTE"); | 52 | pat_dst->ch3.params[trig_selection_loc].prob = pat_src->ch1.params[clipboard.src_trig].prob; |
53 | pat_dst->ch3.params[trig_selection_loc].pan = pat_src->ch1.params[clipboard.src_trig].pan; | ||
50 | } break; | 54 | } break; |
51 | case 3: { | 55 | case 3: { |
52 | pat_dst->ch4.notes[trig_selection_loc] = pat_src->ch1.notes[clipboard.src_trig]; | 56 | pat_dst->ch4.notes[trig_selection_loc] = pat_src->ch1.notes[clipboard.src_trig]; |
53 | send_notif("PASTED NOTE"); | 57 | pat_dst->ch4.params[trig_selection_loc].prob = pat_src->ch1.params[clipboard.src_trig].prob; |
58 | pat_dst->ch4.params[trig_selection_loc].pan = pat_src->ch1.params[clipboard.src_trig].pan; | ||
54 | } break; | 59 | } break; |
55 | } | 60 | } |
56 | } break; | 61 | } break; |
@@ -62,20 +67,22 @@ clipboard_paste(void) { | |||
62 | pat_dst->ch1.params[trig_selection_loc].env_time = pat_src->ch2.params[clipboard.src_trig].env_time; | 67 | pat_dst->ch1.params[trig_selection_loc].env_time = pat_src->ch2.params[clipboard.src_trig].env_time; |
63 | pat_dst->ch1.params[trig_selection_loc].env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; | 68 | pat_dst->ch1.params[trig_selection_loc].env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; |
64 | pat_dst->ch1.params[trig_selection_loc].duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; | 69 | pat_dst->ch1.params[trig_selection_loc].duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; |
65 | send_notif("PASTED NOTE & PARAMS"); | 70 | pat_dst->ch1.params[trig_selection_loc].prob = pat_src->ch2.params[clipboard.src_trig].prob; |
71 | pat_dst->ch1.params[trig_selection_loc].pan = pat_src->ch2.params[clipboard.src_trig].pan; | ||
66 | } break; | 72 | } break; |
67 | case 1: { | 73 | case 1: { |
68 | pat_dst->ch2.notes[trig_selection_loc] = pat_src->ch2.notes[clipboard.src_trig]; | 74 | pat_dst->ch2.notes[trig_selection_loc] = pat_src->ch2.notes[clipboard.src_trig]; |
69 | pat_dst->ch2.params[trig_selection_loc] = pat_src->ch2.params[clipboard.src_trig]; | 75 | pat_dst->ch2.params[trig_selection_loc] = pat_src->ch2.params[clipboard.src_trig]; |
70 | send_notif("PASTED NOTE & PARAMS"); | ||
71 | } break; | 76 | } break; |
72 | case 2: { | 77 | case 2: { |
73 | pat_dst->ch3.notes[trig_selection_loc] = pat_src->ch2.notes[clipboard.src_trig]; | 78 | pat_dst->ch3.notes[trig_selection_loc] = pat_src->ch2.notes[clipboard.src_trig]; |
74 | send_notif("PASTED NOTE"); | 79 | pat_dst->ch3.params[trig_selection_loc].prob = pat_src->ch2.params[clipboard.src_trig].prob; |
80 | pat_dst->ch3.params[trig_selection_loc].pan = pat_src->ch2.params[clipboard.src_trig].pan; | ||
75 | } break; | 81 | } break; |
76 | case 3: { | 82 | case 3: { |
77 | pat_dst->ch4.notes[trig_selection_loc] = pat_src->ch2.notes[clipboard.src_trig]; | 83 | pat_dst->ch4.notes[trig_selection_loc] = pat_src->ch2.notes[clipboard.src_trig]; |
78 | send_notif("PASTED NOTE"); | 84 | pat_dst->ch4.params[trig_selection_loc].prob = pat_src->ch2.params[clipboard.src_trig].prob; |
85 | pat_dst->ch4.params[trig_selection_loc].pan = pat_src->ch2.params[clipboard.src_trig].pan; | ||
79 | } break; | 86 | } break; |
80 | } | 87 | } |
81 | } break; | 88 | } break; |
@@ -83,20 +90,22 @@ clipboard_paste(void) { | |||
83 | switch (channel_selection_loc) { | 90 | switch (channel_selection_loc) { |
84 | case 0: { | 91 | case 0: { |
85 | pat_dst->ch1.notes[trig_selection_loc] = pat_src->ch3.notes[clipboard.src_trig]; | 92 | pat_dst->ch1.notes[trig_selection_loc] = pat_src->ch3.notes[clipboard.src_trig]; |
86 | send_notif("PASTED NOTE"); | 93 | pat_dst->ch1.params[trig_selection_loc].prob = pat_src->ch3.params[clipboard.src_trig].prob; |
94 | pat_dst->ch1.params[trig_selection_loc].pan = pat_src->ch3.params[clipboard.src_trig].pan; | ||
87 | } break; | 95 | } break; |
88 | case 1: { | 96 | case 1: { |
89 | pat_dst->ch2.notes[trig_selection_loc] = pat_src->ch3.notes[clipboard.src_trig]; | 97 | pat_dst->ch2.notes[trig_selection_loc] = pat_src->ch3.notes[clipboard.src_trig]; |
90 | send_notif("PASTED NOTE"); | 98 | pat_dst->ch2.params[trig_selection_loc].prob = pat_src->ch3.params[clipboard.src_trig].prob; |
99 | pat_dst->ch2.params[trig_selection_loc].pan = pat_src->ch3.params[clipboard.src_trig].pan; | ||
91 | } break; | 100 | } break; |
92 | case 2: { | 101 | case 2: { |
93 | pat_dst->ch3.notes[trig_selection_loc] = pat_src->ch3.notes[clipboard.src_trig]; | 102 | pat_dst->ch3.notes[trig_selection_loc] = pat_src->ch3.notes[clipboard.src_trig]; |
94 | pat_dst->ch3.params[trig_selection_loc] = pat_src->ch3.params[clipboard.src_trig]; | 103 | pat_dst->ch3.params[trig_selection_loc] = pat_src->ch3.params[clipboard.src_trig]; |
95 | send_notif("PASTED NOTE & PARAMS"); | ||
96 | } break; | 104 | } break; |
97 | case 3: { | 105 | case 3: { |
98 | pat_dst->ch4.notes[trig_selection_loc] = pat_src->ch3.notes[clipboard.src_trig]; | 106 | pat_dst->ch4.notes[trig_selection_loc] = pat_src->ch3.notes[clipboard.src_trig]; |
99 | send_notif("PASTED NOTE"); | 107 | pat_dst->ch4.params[trig_selection_loc].prob = pat_src->ch3.params[clipboard.src_trig].prob; |
108 | pat_dst->ch4.params[trig_selection_loc].pan = pat_src->ch3.params[clipboard.src_trig].pan; | ||
100 | } break; | 109 | } break; |
101 | } | 110 | } |
102 | } break; | 111 | } break; |
@@ -104,37 +113,44 @@ clipboard_paste(void) { | |||
104 | switch (channel_selection_loc) { | 113 | switch (channel_selection_loc) { |
105 | case 0: { | 114 | case 0: { |
106 | pat_dst->ch1.notes[trig_selection_loc] = pat_src->ch4.notes[clipboard.src_trig]; | 115 | pat_dst->ch1.notes[trig_selection_loc] = pat_src->ch4.notes[clipboard.src_trig]; |
107 | send_notif("PASTED NOTE"); | 116 | pat_dst->ch1.params[trig_selection_loc].prob = pat_src->ch4.params[clipboard.src_trig].prob; |
117 | pat_dst->ch1.params[trig_selection_loc].pan = pat_src->ch4.params[clipboard.src_trig].pan; | ||
108 | } break; | 118 | } break; |
109 | case 1: { | 119 | case 1: { |
110 | pat_dst->ch2.notes[trig_selection_loc] = pat_src->ch4.notes[clipboard.src_trig]; | 120 | pat_dst->ch2.notes[trig_selection_loc] = pat_src->ch4.notes[clipboard.src_trig]; |
111 | send_notif("PASTED NOTE"); | 121 | pat_dst->ch2.params[trig_selection_loc].prob = pat_src->ch4.params[clipboard.src_trig].prob; |
122 | pat_dst->ch2.params[trig_selection_loc].pan = pat_src->ch4.params[clipboard.src_trig].pan; | ||
112 | } break; | 123 | } break; |
113 | case 2: { | 124 | case 2: { |
114 | pat_dst->ch3.notes[trig_selection_loc] = pat_src->ch4.notes[clipboard.src_trig]; | 125 | pat_dst->ch3.notes[trig_selection_loc] = pat_src->ch4.notes[clipboard.src_trig]; |
115 | send_notif("PASTED NOTE"); | 126 | pat_dst->ch3.params[trig_selection_loc].prob = pat_src->ch4.params[clipboard.src_trig].prob; |
127 | pat_dst->ch3.params[trig_selection_loc].pan = pat_src->ch4.params[clipboard.src_trig].pan; | ||
116 | } break; | 128 | } break; |
117 | case 3: { | 129 | case 3: { |
118 | pat_dst->ch4.notes[trig_selection_loc] = pat_src->ch4.notes[clipboard.src_trig]; | 130 | pat_dst->ch4.notes[trig_selection_loc] = pat_src->ch4.notes[clipboard.src_trig]; |
119 | pat_dst->ch4.params[trig_selection_loc] = pat_src->ch4.params[clipboard.src_trig]; | 131 | pat_dst->ch4.params[trig_selection_loc] = pat_src->ch4.params[clipboard.src_trig]; |
120 | send_notif("PASTED NOTE & PARAMS"); | ||
121 | } break; | 132 | } break; |
122 | } | 133 | } |
123 | } break; | 134 | } break; |
124 | } | 135 | } |
136 | send_notif("PASTED NOTE & PARAMS"); | ||
125 | } | 137 | } |
126 | // Only paste the params for the respective trigger. | 138 | // Only paste the params for the respective trigger. |
127 | if (clipboard.type == CLIP_PARAM_CH1) { | 139 | if (clipboard.type == CLIP_PARAM_CH1) { |
128 | switch (channel_selection_loc) { | 140 | switch (channel_selection_loc) { |
129 | case 0: { | 141 | case 0: { |
130 | pat_dst->ch1.params[trig_selection_loc] = pat_src->ch1.params[clipboard.src_trig]; | 142 | pat_dst->ch1.params[trig_selection_loc] = pat_src->ch1.params[clipboard.src_trig]; |
131 | send_notif("PASTED PARAMS"); | ||
132 | } break; | 143 | } break; |
133 | case 1: { | 144 | case 1: { |
134 | pat_dst->ch2.params[trig_selection_loc] = pat_src->ch1.params[clipboard.src_trig]; | 145 | pat_dst->ch2.params[trig_selection_loc].env_volume = pat_src->ch1.params[clipboard.src_trig].env_volume; |
135 | send_notif("PASTED PARAMS"); | 146 | pat_dst->ch2.params[trig_selection_loc].env_time = pat_src->ch1.params[clipboard.src_trig].env_time; |
147 | pat_dst->ch2.params[trig_selection_loc].env_direction = pat_src->ch1.params[clipboard.src_trig].env_direction; | ||
148 | pat_dst->ch2.params[trig_selection_loc].duty_cycle = pat_src->ch1.params[clipboard.src_trig].duty_cycle; | ||
149 | pat_dst->ch2.params[trig_selection_loc].prob = pat_src->ch1.params[clipboard.src_trig].prob; | ||
150 | pat_dst->ch2.params[trig_selection_loc].pan = pat_src->ch1.params[clipboard.src_trig].pan; | ||
136 | } break; | 151 | } break; |
137 | } | 152 | } |
153 | send_notif("PASTED PARAMS"); | ||
138 | } | 154 | } |
139 | if (clipboard.type == CLIP_PARAM_CH2) { | 155 | if (clipboard.type == CLIP_PARAM_CH2) { |
140 | switch (channel_selection_loc) { | 156 | switch (channel_selection_loc) { |
@@ -143,13 +159,14 @@ clipboard_paste(void) { | |||
143 | pat_dst->ch1.params[trig_selection_loc].env_time = pat_src->ch2.params[clipboard.src_trig].env_time; | 159 | pat_dst->ch1.params[trig_selection_loc].env_time = pat_src->ch2.params[clipboard.src_trig].env_time; |
144 | pat_dst->ch1.params[trig_selection_loc].env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; | 160 | pat_dst->ch1.params[trig_selection_loc].env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; |
145 | pat_dst->ch1.params[trig_selection_loc].duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; | 161 | pat_dst->ch1.params[trig_selection_loc].duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; |
146 | send_notif("PASTED PARAMS"); | 162 | pat_dst->ch1.params[trig_selection_loc].prob = pat_src->ch2.params[clipboard.src_trig].prob; |
163 | pat_dst->ch1.params[trig_selection_loc].pan = pat_src->ch2.params[clipboard.src_trig].pan; | ||
147 | } break; | 164 | } break; |
148 | case 1: { | 165 | case 1: { |
149 | pat_dst->ch2.params[trig_selection_loc] = pat_src->ch2.params[clipboard.src_trig]; | 166 | pat_dst->ch2.params[trig_selection_loc] = pat_src->ch2.params[clipboard.src_trig]; |
150 | send_notif("PASTED PARAMS"); | ||
151 | } break; | 167 | } break; |
152 | } | 168 | } |
169 | send_notif("PASTED PARAMS"); | ||
153 | } | 170 | } |
154 | if (clipboard.type == CLIP_PARAM_CH3 && channel_selection_loc == clipboard.src_chan) { | 171 | if (clipboard.type == CLIP_PARAM_CH3 && channel_selection_loc == clipboard.src_chan) { |
155 | pat_dst->ch3.params[trig_selection_loc] = pat_src->ch3.params[clipboard.src_trig]; | 172 | pat_dst->ch3.params[trig_selection_loc] = pat_src->ch3.params[clipboard.src_trig]; |
@@ -170,6 +187,8 @@ clipboard_paste(void) { | |||
170 | pat_dst->ch1.params[trig_selection_loc].env_time = pat_src->ch2.params[clipboard.src_trig].env_time; | 187 | pat_dst->ch1.params[trig_selection_loc].env_time = pat_src->ch2.params[clipboard.src_trig].env_time; |
171 | pat_dst->ch1.params[trig_selection_loc].env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; | 188 | pat_dst->ch1.params[trig_selection_loc].env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; |
172 | pat_dst->ch1.params[trig_selection_loc].duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; | 189 | pat_dst->ch1.params[trig_selection_loc].duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; |
190 | pat_dst->ch1.params[trig_selection_loc].prob = pat_src->ch2.params[clipboard.src_trig].prob; | ||
191 | pat_dst->ch1.params[trig_selection_loc].pan = pat_src->ch2.params[clipboard.src_trig].pan; | ||
173 | send_notif("PASTED PARAMS"); | 192 | send_notif("PASTED PARAMS"); |
174 | draw_parameters(); | 193 | draw_parameters(); |
175 | } else if (input_handler == handle_param_selection_sq2 && clipboard.type == CLIP_PARAM_CH2) { | 194 | } else if (input_handler == handle_param_selection_sq2 && clipboard.type == CLIP_PARAM_CH2) { |
@@ -177,7 +196,12 @@ clipboard_paste(void) { | |||
177 | send_notif("PASTED PARAMS"); | 196 | send_notif("PASTED PARAMS"); |
178 | draw_parameters(); | 197 | draw_parameters(); |
179 | } else if (input_handler == handle_param_selection_sq2 && clipboard.type == CLIP_PARAM_CH1) { | 198 | } else if (input_handler == handle_param_selection_sq2 && clipboard.type == CLIP_PARAM_CH1) { |
180 | pat_dst->ch2.params[trig_selection_loc] = pat_src->ch1.params[clipboard.src_trig]; | 199 | pat_dst->ch2.params[trig_selection_loc].env_volume = pat_src->ch1.params[clipboard.src_trig].env_volume; |
200 | pat_dst->ch2.params[trig_selection_loc].env_time = pat_src->ch1.params[clipboard.src_trig].env_time; | ||
201 | pat_dst->ch2.params[trig_selection_loc].env_direction = pat_src->ch1.params[clipboard.src_trig].env_direction; | ||
202 | pat_dst->ch2.params[trig_selection_loc].duty_cycle = pat_src->ch1.params[clipboard.src_trig].duty_cycle; | ||
203 | pat_dst->ch2.params[trig_selection_loc].prob = pat_src->ch1.params[clipboard.src_trig].prob; | ||
204 | pat_dst->ch2.params[trig_selection_loc].pan = pat_src->ch1.params[clipboard.src_trig].pan; | ||
181 | send_notif("PASTED PARAMS"); | 205 | send_notif("PASTED PARAMS"); |
182 | draw_parameters(); | 206 | draw_parameters(); |
183 | } else if (input_handler == handle_param_selection_wave && clipboard.type == CLIP_PARAM_CH3) { | 207 | } else if (input_handler == handle_param_selection_wave && clipboard.type == CLIP_PARAM_CH3) { |
@@ -198,7 +222,6 @@ clipboard_paste(void) { | |||
198 | case 2: { pat_dst->ch3 = pat_src->ch3; } break; | 222 | case 2: { pat_dst->ch3 = pat_src->ch3; } break; |
199 | case 3: { pat_dst->ch4 = pat_src->ch4; } break; | 223 | case 3: { pat_dst->ch4 = pat_src->ch4; } break; |
200 | } | 224 | } |
201 | send_notif("PASTED NOTES & PARAMS"); | ||
202 | } else { | 225 | } else { |
203 | switch (clipboard.src_chan) { | 226 | switch (clipboard.src_chan) { |
204 | case 0: { | 227 | case 0: { |
@@ -208,26 +231,31 @@ clipboard_paste(void) { | |||
208 | pat_dst->ch1.notes[i] = pat_src->ch1.notes[i]; | 231 | pat_dst->ch1.notes[i] = pat_src->ch1.notes[i]; |
209 | pat_dst->ch1.params[i] = pat_src->ch1.params[i]; | 232 | pat_dst->ch1.params[i] = pat_src->ch1.params[i]; |
210 | } | 233 | } |
211 | send_notif("PASTED NOTES & PARAMS"); | ||
212 | } break; | 234 | } break; |
213 | case 1: { | 235 | case 1: { |
214 | for (size_t i = 0; i < 16; i++) { | 236 | for (size_t i = 0; i < 16; i++) { |
215 | pat_dst->ch2.notes[i] = pat_src->ch1.notes[i]; | 237 | pat_dst->ch2.notes[i] = pat_src->ch1.notes[i]; |
216 | pat_dst->ch2.params[i] = pat_src->ch1.params[i]; | 238 | pat_dst->ch2.params[i].env_volume = pat_src->ch1.params[i].env_volume; |
239 | pat_dst->ch2.params[i].env_time = pat_src->ch1.params[i].env_time; | ||
240 | pat_dst->ch2.params[i].env_direction = pat_src->ch1.params[i].env_direction; | ||
241 | pat_dst->ch2.params[i].duty_cycle = pat_src->ch1.params[i].duty_cycle; | ||
242 | pat_dst->ch2.params[i].prob = pat_src->ch1.params[i].prob; | ||
243 | pat_dst->ch2.params[i].pan = pat_src->ch1.params[i].pan; | ||
217 | } | 244 | } |
218 | send_notif("PASTED NOTES & PARAMS"); | ||
219 | } break; | 245 | } break; |
220 | case 2: { | 246 | case 2: { |
221 | for (size_t i = 0; i < 16; i++) { | 247 | for (size_t i = 0; i < 16; i++) { |
222 | pat_dst->ch3.notes[i] = pat_src->ch1.notes[i]; | 248 | pat_dst->ch3.notes[i] = pat_src->ch1.notes[i]; |
249 | pat_dst->ch3.params[i].prob = pat_src->ch1.params[i].prob; | ||
250 | pat_dst->ch3.params[i].pan = pat_src->ch1.params[i].pan; | ||
223 | } | 251 | } |
224 | send_notif("PASTED NOTES"); | ||
225 | } break; | 252 | } break; |
226 | case 3: { | 253 | case 3: { |
227 | for (size_t i = 0; i < 16; i++) { | 254 | for (size_t i = 0; i < 16; i++) { |
228 | pat_dst->ch4.notes[i] = pat_src->ch1.notes[i]; | 255 | pat_dst->ch4.notes[i] = pat_src->ch1.notes[i]; |
256 | pat_dst->ch4.params[i].prob = pat_src->ch1.params[i].prob; | ||
257 | pat_dst->ch4.params[i].pan = pat_src->ch1.params[i].pan; | ||
229 | } | 258 | } |
230 | send_notif("PASTED NOTES"); | ||
231 | } break; | 259 | } break; |
232 | } | 260 | } |
233 | } break; | 261 | } break; |
@@ -240,27 +268,29 @@ clipboard_paste(void) { | |||
240 | pat_dst->ch1.params[i].env_time = pat_src->ch2.params[i].env_time; | 268 | pat_dst->ch1.params[i].env_time = pat_src->ch2.params[i].env_time; |
241 | pat_dst->ch1.params[i].env_direction = pat_src->ch2.params[i].env_direction; | 269 | pat_dst->ch1.params[i].env_direction = pat_src->ch2.params[i].env_direction; |
242 | pat_dst->ch1.params[i].duty_cycle = pat_src->ch2.params[i].duty_cycle; | 270 | pat_dst->ch1.params[i].duty_cycle = pat_src->ch2.params[i].duty_cycle; |
271 | pat_dst->ch1.params[i].prob = pat_src->ch2.params[i].prob; | ||
272 | pat_dst->ch1.params[i].pan = pat_src->ch2.params[i].pan; | ||
243 | } | 273 | } |
244 | send_notif("PASTED NOTES & PARAMS"); | ||
245 | } break; | 274 | } break; |
246 | case 1: { | 275 | case 1: { |
247 | for (size_t i = 0; i < 16; i++) { | 276 | for (size_t i = 0; i < 16; i++) { |
248 | pat_dst->ch2.notes[i] = pat_src->ch2.notes[i]; | 277 | pat_dst->ch2.notes[i] = pat_src->ch2.notes[i]; |
249 | pat_dst->ch2.params[i] = pat_src->ch2.params[i]; | 278 | pat_dst->ch2.params[i] = pat_src->ch2.params[i]; |
250 | } | 279 | } |
251 | send_notif("PASTED NOTES & PARAMS"); | ||
252 | } break; | 280 | } break; |
253 | case 2: { | 281 | case 2: { |
254 | for (size_t i = 0; i < 16; i++) { | 282 | for (size_t i = 0; i < 16; i++) { |
255 | pat_dst->ch3.notes[i] = pat_src->ch2.notes[i]; | 283 | pat_dst->ch3.notes[i] = pat_src->ch2.notes[i]; |
284 | pat_dst->ch3.params[i].prob = pat_src->ch2.params[i].prob; | ||
285 | pat_dst->ch3.params[i].pan = pat_src->ch2.params[i].pan; | ||
256 | } | 286 | } |
257 | send_notif("PASTED NOTES"); | ||
258 | } break; | 287 | } break; |
259 | case 3: { | 288 | case 3: { |
260 | for (size_t i = 0; i < 16; i++) { | 289 | for (size_t i = 0; i < 16; i++) { |
261 | pat_dst->ch4.notes[i] = pat_src->ch2.notes[i]; | 290 | pat_dst->ch4.notes[i] = pat_src->ch2.notes[i]; |
291 | pat_dst->ch4.params[i].prob = pat_src->ch2.params[i].prob; | ||
292 | pat_dst->ch4.params[i].pan = pat_src->ch2.params[i].pan; | ||
262 | } | 293 | } |
263 | send_notif("PASTED NOTES"); | ||
264 | } break; | 294 | } break; |
265 | } | 295 | } |
266 | } break; | 296 | } break; |
@@ -269,27 +299,29 @@ clipboard_paste(void) { | |||
269 | case 0: { | 299 | case 0: { |
270 | for (size_t i = 0; i < 16; i++) { | 300 | for (size_t i = 0; i < 16; i++) { |
271 | pat_dst->ch1.notes[i] = pat_src->ch3.notes[i]; | 301 | pat_dst->ch1.notes[i] = pat_src->ch3.notes[i]; |
302 | pat_dst->ch1.params[i].prob = pat_src->ch3.params[i].prob; | ||
303 | pat_dst->ch1.params[i].pan = pat_src->ch3.params[i].pan; | ||
272 | } | 304 | } |
273 | send_notif("PASTED NOTES"); | ||
274 | } break; | 305 | } break; |
275 | case 1: { | 306 | case 1: { |
276 | for (size_t i = 0; i < 16; i++) { | 307 | for (size_t i = 0; i < 16; i++) { |
277 | pat_dst->ch2.notes[i] = pat_src->ch3.notes[i]; | 308 | pat_dst->ch2.notes[i] = pat_src->ch3.notes[i]; |
309 | pat_dst->ch2.params[i].prob = pat_src->ch3.params[i].prob; | ||
310 | pat_dst->ch2.params[i].pan = pat_src->ch3.params[i].pan; | ||
278 | } | 311 | } |
279 | send_notif("PASTED NOTES"); | ||
280 | } break; | 312 | } break; |
281 | case 2: { | 313 | case 2: { |
282 | for (size_t i = 0; i < 16; i++) { | 314 | for (size_t i = 0; i < 16; i++) { |
283 | pat_dst->ch3.notes[i] = pat_src->ch3.notes[i]; | 315 | pat_dst->ch3.notes[i] = pat_src->ch3.notes[i]; |
284 | pat_dst->ch3.params[i] = pat_src->ch3.params[i]; | 316 | pat_dst->ch3.params[i] = pat_src->ch3.params[i]; |
285 | } | 317 | } |
286 | send_notif("PASTED NOTES & PARAMS"); | ||
287 | } break; | 318 | } break; |
288 | case 3: { | 319 | case 3: { |
289 | for (size_t i = 0; i < 16; i++) { | 320 | for (size_t i = 0; i < 16; i++) { |
290 | pat_dst->ch4.notes[i] = pat_src->ch3.notes[i]; | 321 | pat_dst->ch4.notes[i] = pat_src->ch3.notes[i]; |
322 | pat_dst->ch4.params[i].prob = pat_src->ch3.params[i].prob; | ||
323 | pat_dst->ch4.params[i].pan = pat_src->ch3.params[i].pan; | ||
291 | } | 324 | } |
292 | send_notif("PASTED NOTES"); | ||
293 | } break; | 325 | } break; |
294 | } | 326 | } |
295 | } break; | 327 | } break; |
@@ -298,32 +330,35 @@ clipboard_paste(void) { | |||
298 | case 0: { | 330 | case 0: { |
299 | for (size_t i = 0; i < 16; i++) { | 331 | for (size_t i = 0; i < 16; i++) { |
300 | pat_dst->ch1.notes[i] = pat_src->ch4.notes[i]; | 332 | pat_dst->ch1.notes[i] = pat_src->ch4.notes[i]; |
333 | pat_dst->ch1.params[i].prob = pat_src->ch4.params[i].prob; | ||
334 | pat_dst->ch1.params[i].pan = pat_src->ch4.params[i].pan; | ||
301 | } | 335 | } |
302 | send_notif("PASTED NOTES"); | ||
303 | } break; | 336 | } break; |
304 | case 1: { | 337 | case 1: { |
305 | for (size_t i = 0; i < 16; i++) { | 338 | for (size_t i = 0; i < 16; i++) { |
306 | pat_dst->ch2.notes[i] = pat_src->ch4.notes[i]; | 339 | pat_dst->ch2.notes[i] = pat_src->ch4.notes[i]; |
340 | pat_dst->ch2.params[i].prob = pat_src->ch4.params[i].prob; | ||
341 | pat_dst->ch2.params[i].pan = pat_src->ch4.params[i].pan; | ||
307 | } | 342 | } |
308 | send_notif("PASTED NOTES"); | ||
309 | } break; | 343 | } break; |
310 | case 2: { | 344 | case 2: { |
311 | for (size_t i = 0; i < 16; i++) { | 345 | for (size_t i = 0; i < 16; i++) { |
312 | pat_dst->ch3.notes[i] = pat_src->ch4.notes[i]; | 346 | pat_dst->ch3.notes[i] = pat_src->ch4.notes[i]; |
347 | pat_dst->ch3.params[i].prob = pat_src->ch4.params[i].prob; | ||
348 | pat_dst->ch3.params[i].pan = pat_src->ch4.params[i].pan; | ||
313 | } | 349 | } |
314 | send_notif("PASTED NOTES"); | ||
315 | } break; | 350 | } break; |
316 | case 3: { | 351 | case 3: { |
317 | for (size_t i = 0; i < 16; i++) { | 352 | for (size_t i = 0; i < 16; i++) { |
318 | pat_dst->ch4.notes[i] = pat_src->ch4.notes[i]; | 353 | pat_dst->ch4.notes[i] = pat_src->ch4.notes[i]; |
319 | pat_dst->ch4.params[i] = pat_src->ch4.params[i]; | 354 | pat_dst->ch4.params[i] = pat_src->ch4.params[i]; |
320 | } | 355 | } |
321 | send_notif("PASTED NOTES & PARAMS"); | ||
322 | } break; | 356 | } break; |
323 | } | 357 | } |
324 | } break; | 358 | } break; |
325 | } | 359 | } |
326 | } | 360 | } |
361 | send_notif("PASTED NOTES & PARAMS"); | ||
327 | draw_channels(); | 362 | draw_channels(); |
328 | draw_triggers(); | 363 | draw_triggers(); |
329 | } else if (input_handler == handle_channel_selection) { | 364 | } else if (input_handler == handle_channel_selection) { |
@@ -344,11 +379,15 @@ clipboard_paste(void) { | |||
344 | ch1_params.env_time = pat_src->ch2.params[clipboard.src_trig].env_time; | 379 | ch1_params.env_time = pat_src->ch2.params[clipboard.src_trig].env_time; |
345 | ch1_params.env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; | 380 | ch1_params.env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; |
346 | ch1_params.duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; | 381 | ch1_params.duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; |
382 | ch1_params.prob = pat_src->ch2.params[clipboard.src_trig].prob; | ||
383 | ch1_params.pan = pat_src->ch2.params[clipboard.src_trig].pan; | ||
347 | for (size_t i = 0; i < 16; i++) { | 384 | for (size_t i = 0; i < 16; i++) { |
348 | pat_dst->ch1.params[i].env_volume = pat_src->ch2.params[clipboard.src_trig].env_volume; | 385 | pat_dst->ch1.params[i].env_volume = pat_src->ch2.params[clipboard.src_trig].env_volume; |
349 | pat_dst->ch1.params[i].env_time = pat_src->ch2.params[clipboard.src_trig].env_time; | 386 | pat_dst->ch1.params[i].env_time = pat_src->ch2.params[clipboard.src_trig].env_time; |
350 | pat_dst->ch1.params[i].env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; | 387 | pat_dst->ch1.params[i].env_direction = pat_src->ch2.params[clipboard.src_trig].env_direction; |
351 | pat_dst->ch1.params[i].duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; | 388 | pat_dst->ch1.params[i].duty_cycle = pat_src->ch2.params[clipboard.src_trig].duty_cycle; |
389 | pat_dst->ch1.params[i].prob = pat_src->ch2.params[clipboard.src_trig].prob; | ||
390 | pat_dst->ch1.params[i].pan = pat_src->ch2.params[clipboard.src_trig].pan; | ||
352 | } | 391 | } |
353 | send_notif("PASTED PARAMS"); | 392 | send_notif("PASTED PARAMS"); |
354 | } | 393 | } |
@@ -359,9 +398,19 @@ clipboard_paste(void) { | |||
359 | clipboard.type == CLIP_PARAM_CH1 || | 398 | clipboard.type == CLIP_PARAM_CH1 || |
360 | clipboard.type == CLIP_PARAM_CH2) { | 399 | clipboard.type == CLIP_PARAM_CH2) { |
361 | if (clipboard.src_chan == 0) { | 400 | if (clipboard.src_chan == 0) { |
362 | ch2_params = pat_src->ch1.params[clipboard.src_trig]; | 401 | ch2_params.env_volume = pat_src->ch1.params[clipboard.src_trig].env_volume; |
402 | ch2_params.env_time = pat_src->ch1.params[clipboard.src_trig].env_time; | ||
403 | ch2_params.env_direction = pat_src->ch1.params[clipboard.src_trig].env_direction; | ||
404 | ch2_params.duty_cycle = pat_src->ch1.params[clipboard.src_trig].duty_cycle; | ||
405 | ch2_params.prob = pat_src->ch1.params[clipboard.src_trig].prob; | ||
406 | ch2_params.pan = pat_src->ch1.params[clipboard.src_trig].pan; | ||
363 | for (size_t i = 0; i < 16; i++) { | 407 | for (size_t i = 0; i < 16; i++) { |
364 | pat_dst->ch2.params[i] = pat_src->ch1.params[clipboard.src_trig]; | 408 | pat_dst->ch2.params[i].env_volume = pat_src->ch1.params[clipboard.src_trig].env_volume; |
409 | pat_dst->ch2.params[i].env_time = pat_src->ch1.params[clipboard.src_trig].env_time; | ||
410 | pat_dst->ch2.params[i].env_direction = pat_src->ch1.params[clipboard.src_trig].env_direction; | ||
411 | pat_dst->ch2.params[i].duty_cycle = pat_src->ch1.params[clipboard.src_trig].duty_cycle; | ||
412 | pat_dst->ch2.params[i].prob = pat_src->ch1.params[clipboard.src_trig].prob; | ||
413 | pat_dst->ch2.params[i].pan = pat_src->ch1.params[clipboard.src_trig].pan; | ||
365 | } | 414 | } |
366 | send_notif("PASTED PARAMS"); | 415 | send_notif("PASTED PARAMS"); |
367 | } | 416 | } |