-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmutate.py
More file actions
518 lines (407 loc) · 22.3 KB
/
mutate.py
File metadata and controls
518 lines (407 loc) · 22.3 KB
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
"""
mutate.py
This file is part of phelix.
Copyright 2024 Tim Barrass
phelix is licensed under the GNU General Public Licence (GPL) Version 3 or later.
"""
import itertools
import random
import debug
import process_preset
import var
import file
import util
import choose
def is_specific_model_type(preset, dsp, slot):
return util.get_default_dsp_slot(preset, dsp, slot)["@model"].startswith(("HD2_Reverb", "VIC", "Victoria"))
def is_reverb(preset, dsp, slot):
return util.get_default_dsp_slot(preset, dsp, slot)["@model"].startswith(("HD2_Reverb", "VIC", "Victoria"))
def random_triangle(pmin, pmax, mode_fraction, lowest_fraction):
lowest = ((pmax - pmin) * lowest_fraction) + pmin
mode = ((pmax - pmin) * mode_fraction) + pmin
return random.triangular(lowest, pmax, mode)
def get_mutated_level(pmin, pmax, slot):
if util.is_block_or_cab_slot(slot):
return random_triangle(pmin, pmax, 0.8, 0.0)
else:
return random.uniform(pmin, pmax)
def get_mutated_decay(pmin, pmax, preset, dsp, slot):
if is_reverb(preset, dsp, slot):
return random_triangle(pmin, pmax, 0.05, 0.0)
else:
return random.uniform(pmin, pmax)
def get_mutated_time(pmax):
return min(pmax, random.expovariate(0.95 + (0.75 - 0.95) * (pmax - 2) / (8 - 2)))
def get_mutated_mix(pmin, pmax):
return random_triangle(pmin, pmax, 0.5, 0.0)
def get_mutated_feedback(pmin, pmax):
return random_triangle(pmin, pmax, 0.5, 0.0)
def get_mutated_param_value(preset, dsp, slot, param, pmin, pmax):
if isinstance(pmin, bool):
return random.choice([True, False])
if param == "Level":
return get_mutated_level(pmin, pmax, slot)
elif param == "Decay":
return get_mutated_decay(pmin, pmax, preset, dsp, slot)
elif param == "Time":
return get_mutated_time(pmax)
elif param == "Mix":
return get_mutated_mix(pmin, pmax)
elif param == "Feedback":
return get_mutated_feedback(pmin, pmax)
else:
return random.uniform(pmin, pmax)
def mutate_param_values_for_one_snapshot_slot(preset, snap_num, dsp, slot, fraction_new):
# Skip if DSP doesn't exist in controller
controller = util.get_controller(preset)
if dsp not in controller:
return
if slot not in util.get_controller_dsp(preset, dsp):
return
raw_controllers = file.reload_raw_block_dictionary(preset, dsp, slot)["Controller_Dict"]
# print("mutate_param_values_for_one_snapshot_slot", dsp, slot, util.get_default_dsp_slot(preset, dsp, slot)["@model"])
for param in util.get_controller_dsp_slot(preset, dsp, slot):
if util.get_controller_dsp_slot_param(preset, dsp, slot, param)["@controller"] == var.CONTROLLER_SNAPSHOT:
pmin = raw_controllers[param]["@min"]
pmax = raw_controllers[param]["@max"]
result = get_mutated_param_value(preset, dsp, slot, param, pmin, pmax)
prev_result = util.get_snapshot_controllers_dsp_slot_param_value(preset, snap_num, dsp, slot, param)
result_mix = mix_values(fraction_new, pmin, pmax, result, prev_result)
# print("mutate", dsp, slot, parameter, pmin, pmax, result, prev_result, result_mix)
util.get_snapshot_controllers_dsp_slot_param(preset, snap_num, dsp, slot, param)["@value"] = result_mix
def mutate_param_values_for_all_snapshots(preset, fraction_new):
print("\nmutate_param_values_for_all_snapshots")
# debug.save_debug_hlx(preset)
for snapshot_num in range(var.NUM_SNAPSHOTS):
for dsp in util.get_snapshot_controllers(preset, snapshot_num):
# Skip non-dsp entries
if not dsp.startswith("dsp"):
continue
for slot in util.get_snapshot_controllers_dsp(preset, snapshot_num, dsp):
# Skip if slot doesn't exist in defaults or isn't a block/split/cab
if slot not in util.get_default_dsp(preset, dsp):
continue
if not slot.startswith(("block", "split", "cab")):
continue
# Skip if slot has no controller data
controller = util.get_controller(preset)
if dsp not in controller or slot not in util.get_controller_dsp(preset, dsp):
continue
mutate_param_values_for_one_snapshot_slot(preset, snapshot_num, dsp, slot, fraction_new)
def mutate_values_in_default_block(preset, dsp, slot, fraction_new):
raw_controllers = file.reload_raw_block_dictionary(preset, dsp, slot)["Controller_Dict"]
print("mutate_values_in_default_block", dsp, slot, util.get_model_name(preset, dsp, slot))
for param in raw_controllers: # not all default params can be changed on the helix
pmin = raw_controllers[param]["@min"]
pmax = raw_controllers[param]["@max"]
result = get_mutated_param_value(preset, dsp, slot, param, pmin, pmax)
prev_result = util.get_default_dsp_slot_param_value(preset, dsp, slot, param)
util.get_default_dsp_slot(preset, dsp, slot)[param] = mix_values(
fraction_new, pmin, pmax, result, prev_result
)
def mix_values(fraction_new, pmin, pmax, result, prev_result):
if isinstance(result, bool):
return result
fraction_prev = 1.0 - fraction_new
result_mix = result * fraction_new + prev_result * fraction_prev
return max(pmin, min(result_mix, pmax))
def mutate_values_in_all_default_blocks(preset, fraction_new):
print("Mutating values in preset default")
for dsp in util.get_available_default_dsp_names(preset):
for slot in util.get_default_dsp(preset, dsp):
if slot.startswith(("cab", "split", "block")):
mutate_values_in_default_block(preset, dsp, slot, fraction_new)
def mutate_parameter_value(mean, p_min, p_max):
p_range = p_max - p_min
sigma = p_range / 4
p = random.normalvariate(mean, sigma)
while not p_min <= p <= p_max:
p = random.normalvariate(mean, sigma)
return p
def remove_some_controllers_and_assign_new_ones_to_snapshot(preset, from_control_type, max_changes):
print("\nremove_some_controllers_and_assign_new_ones_to_snapshot...")
num_changes = random.randint(0, max_changes)
choose.remove_random_controls_of_type(preset, from_control_type, num_changes)
for _ in range(num_changes):
choose.assign_random_parameter_controller_to_snapshot_and_randomise_range(preset)
def change_some_controller_types(preset, controller_type, number_of_changes):
print("\nchange_some_controller_types to controller "+str(controller_type))
for _ in range(number_of_changes):
choose.assign_random_parameter_to_controller_type_and_randomise_range(preset, controller_type)
def toggle_block_state(preset, dsp, slot):
current_state = util.get_default_dsp_slot_param_value(preset, dsp, slot, "@enabled")
util.get_default_dsp_slot(preset, dsp, slot)["@enabled"] = not current_state
def toggle_some_block_states(preset, change_fraction):
for dsp in util.get_available_default_dsp_names(preset):
for slot in util.get_default_dsp(preset, dsp):
if slot.startswith("block") and random.uniform(0, 1) < change_fraction:
toggle_block_state(preset, dsp, slot)
for snapshot_num in range(var.NUM_SNAPSHOTS):
snapshot_blocks = util.get_snapshot_blocks(preset, snapshot_num)
for dsp in snapshot_blocks:
for slot in snapshot_blocks[dsp]:
if slot.startswith("block") and random.uniform(0, 1) < change_fraction:
current_state = snapshot_blocks[dsp][slot]
snapshot_blocks[dsp][slot] = not current_state
def toggle_series_or_parallel_dsps(preset, change_fraction):
if random.uniform(0, 1) < change_fraction: # change state
print("toggling series or parallel dsps")
current = preset["data"]["tone"]["dsp0"]["outputA"]["@output"]
preset["data"]["tone"]["dsp0"]["outputA"]["@output"] = 2 if current == 1 else 1
def find_used_default_block_slots(preset):
dsp_slot = []
for dsp in util.get_available_default_dsp_names(preset):
dsp_slot.extend([dsp, slot] for slot in util.get_default_dsp(preset, dsp) if slot.startswith("block"))
return dsp_slot
def find_unused_default_block_slots(preset):
dsp_slot = []
for dsp in util.get_available_default_dsp_names(preset):
for block_num in range(var.NUM_BLOCKS_PER_DSP):
slot = f"block{block_num}"
if slot not in util.get_default_dsp(preset, dsp):
dsp_slot.append([dsp, slot])
return list(reversed(dsp_slot))
def find_used_default_dsp_path_pos(preset):
dsp_path_pos = {}
for dsp in util.get_available_default_dsp_names(preset):
dsp_path_pos[dsp] = []
for slot in util.get_default_dsp(preset, dsp):
if slot.startswith("block"):
slot_dict = util.get_default_dsp_slot(preset, dsp, slot)
dsp_path_pos[dsp].append((slot_dict["@path"], slot_dict["@position"]))
return dsp_path_pos
def find_unused_dsp_path_positions(preset):
used_dsp_path_positions = find_used_default_dsp_path_pos(preset)
unused_dsp_path_positions = {}
for dsp in util.get_available_default_dsp_names(preset):
unused_dsp_path_positions[dsp] = []
for path, pos in itertools.product(range(var.NUM_PATHS_PER_DSP), range(var.NUM_POSITIONS_PER_PATH)):
if (path, pos) not in used_dsp_path_positions[dsp]:
unused_dsp_path_positions[dsp].append((path, pos))
return unused_dsp_path_positions
def find_used_default_dsp_cab_slots(preset):
used_dsp_cab_slots = {}
for dsp in util.get_available_default_dsp_names(preset):
used_dsp_cab_slots[dsp] = []
for slot in util.get_default_dsp(preset, dsp):
if slot.startswith("cab"):
used_dsp_cab_slots[dsp].append(slot)
return used_dsp_cab_slots
def find_unused_default_dsp_cab_slots(preset):
used_dsp_cab_slots = find_used_default_dsp_cab_slots(preset)
unused_dsp_cab_slots = {}
for dsp in util.get_available_default_dsp_names(preset):
unused_dsp_cab_slots[dsp] = []
for cab_num in range(var.NUM_CABS_PER_DSP):
slot = f"cab{cab_num}"
if slot not in used_dsp_cab_slots[dsp]:
unused_dsp_cab_slots[dsp].append(slot)
unused_dsp_cab_slots[dsp] = list(reversed(unused_dsp_cab_slots[dsp]))
return unused_dsp_cab_slots
def count_blocks_on_each_dsp(preset):
blocks_on_dsp0 = 0
blocks_on_dsp1 = 0
for dsp in util.get_available_default_dsp_names(preset):
for slot in util.get_default_dsp(preset, dsp):
if slot.startswith("block"):
blocks_on_dsp0 += 1 if dsp == "dsp0" else 0
blocks_on_dsp1 += 1 if dsp == "dsp1" else 0
return blocks_on_dsp0, blocks_on_dsp1
def which_dsp_to_move_to(preset):
blocks_on_dsp0, blocks_on_dsp1 = count_blocks_on_each_dsp(preset)
print("blocks_on_dsp0, blocks_on_dsp1", blocks_on_dsp0, blocks_on_dsp1)
choice_list = ["dsp0"] * blocks_on_dsp1 + ["dsp1"] * blocks_on_dsp0 # note reversed probability
return random.choice(choice_list)
def get_unused_block_slot(unused_block_slots, to_dsp):
"""Finds and returns an unused block slot in the specified DSP."""
for to_dsp_slot in unused_block_slots:
if to_dsp_slot[0] == to_dsp:
to_slot = to_dsp_slot[1]
unused_block_slots.remove([to_dsp, to_slot])
return to_dsp, to_slot
return None, None # No unused slot found in the specified DSP
def is_amp_slot(preset, to_dsp, model_name):
return model_name.startswith("HD2_Amp") and util.count_amps(preset, to_dsp) > 0
def rearrange_blocks(preset, fraction_move):
print("\nrearrange_blocks")
used_block_slots = find_used_default_block_slots(preset)
unused_block_slots = find_unused_default_block_slots(preset)
used_dsp_path_positions = find_used_default_dsp_path_pos(preset)
unused_dsp_path_positions = find_unused_dsp_path_positions(preset)
used_dsp_cab_slots = find_used_default_dsp_cab_slots(preset)
unused_dsp_cab_slots = find_unused_default_dsp_cab_slots(preset)
unused_block_slots.reverse() # so we find low slots first
# print(used_slots, unused_slots)
for dsp, slot in used_block_slots:
if random.uniform(0, 1) < fraction_move:
model_name = util.get_model_name(preset, dsp, slot)
# update slot arrays
# to_dsp, to_slot = unused_block_slots.pop()
to_dsp = which_dsp_to_move_to(preset)
to_slot = None
for to_dsp_slot in unused_block_slots:
if to_dsp_slot[0] == to_dsp:
to_slot = to_dsp_slot[1]
unused_block_slots.remove([to_dsp, to_slot])
break
# skip if no unused slot available in the target dsp
if to_slot is None:
continue
# wastes unused slot this turn if there is already an amp in to_dsp
if model_name.startswith("HD2_Amp") and dsp != to_dsp and util.count_amps(preset, to_dsp) > 0:
return
unused_block_slots.append([dsp, slot])
# get new unused path and position on to_dsp
from_path = util.get_default_dsp_slot(preset, dsp, slot)["@path"]
from_pos = util.get_default_dsp_slot(preset, dsp, slot)["@position"]
used_dsp_path_positions[dsp].remove((from_path, from_pos))
random.shuffle(unused_dsp_path_positions[to_dsp])
to_path, to_pos = unused_dsp_path_positions[to_dsp].pop()
used_dsp_path_positions[to_dsp].append((to_path, to_pos))
# actually move the block
util.move_slot(preset, dsp, slot, to_dsp, to_slot, "block")
# set new path, position
util.get_default_dsp_slot(preset, to_dsp, to_slot)["@path"] = to_path
util.get_default_dsp_slot(preset, to_dsp, to_slot)["@position"] = to_pos
print(" moved", model_name, "from", dsp, slot, "to", to_dsp, to_slot)
# if it's an amp, find an unused cab slot on to_dsp, and move it there
if model_name.startswith("HD2_Amp"):
rearrange_cab(preset, used_dsp_cab_slots, unused_dsp_cab_slots, dsp, to_dsp, to_slot)
def rearrange_cab(preset, used_dsp_cab_slots, unused_dsp_cab_slots, dsp, amp_dsp, amp_slot):
if dsp != amp_dsp:
old_cab_slot = util.get_default_dsp_slot(preset, amp_dsp, amp_slot).get("@cab")
if old_cab_slot is None:
print(f" WARNING: amp {amp_slot} has no @cab field, skipping cab rearrangement")
return
if old_cab_slot not in used_dsp_cab_slots[dsp]:
print(f" WARNING: cab {old_cab_slot} not found in used slots, skipping cab rearrangement")
return
# print("rearrange_cab old_cab_slot", dsp, old_cab_slot)
# Move cab_from_slot from used to unused list
used_dsp_cab_slots[dsp].remove(old_cab_slot)
unused_dsp_cab_slots[dsp].append(old_cab_slot)
new_cab_slot = unused_dsp_cab_slots[amp_dsp].pop()
used_dsp_cab_slots[amp_dsp].append(new_cab_slot)
util.move_slot(preset, dsp, old_cab_slot, amp_dsp, new_cab_slot, "cab")
# register the cab with its amp
util.get_default_dsp_slot(preset, amp_dsp, amp_slot)["@cab"] = new_cab_slot
print(" moved cab from", dsp, old_cab_slot, "to", amp_dsp, new_cab_slot)
def swap_some_blocks_and_splits_from_file(preset, change_fraction):
print("Swapping some blocks and splits from file")
for dsp in util.get_available_default_dsp_names(preset):
for slot in list(util.get_default_dsp(preset, dsp)): # Copy keys to avoid mutation during iteration
if random.uniform(0, 1) < change_fraction:
util.remove_controller_dsp_slot_if_present(preset, dsp, slot)
util.remove_snapshots_controllers_dsp_slot_if_present(preset, dsp, slot)
if slot.startswith("block"):
swap_block_from_file_using_probabilities(preset, dsp, slot)
if slot.startswith("split") and random.uniform(0, 1) < change_fraction:
swap_with_random_split_from_file(preset, dsp, slot)
# TODO : fix swap_with_random_cab_from_file
# if slot.startswith("cab") and random.uniform(0, 1) < change_fraction:
# swap_with_random_cab_from_file(preset, dsp, slot)
def swap_block_from_file_using_probabilities(preset, dsp, slot):
print("swap_block_from_file_using_probabilities")
path = util.get_default_dsp_slot(preset, dsp, slot)["@path"]
pos = util.get_default_dsp_slot(preset, dsp, slot)["@position"]
# Check if the old block was an amp - if so, remove its cab
old_model = util.get_model_name(preset, dsp, slot)
if old_model.startswith("HD2_Amp"):
old_cab_slot = util.get_default_dsp_slot(preset, dsp, slot).get("@cab")
if old_cab_slot and old_cab_slot in util.get_default_dsp(preset, dsp):
print(f" removing orphaned cab {old_cab_slot} from old amp")
del preset["data"]["tone"][dsp][old_cab_slot]
util.remove_controller_dsp_slot_if_present(preset, dsp, old_cab_slot)
util.remove_snapshots_controllers_dsp_slot_if_present(preset, dsp, old_cab_slot)
raw_block_dict = file.load_block_dictionary(choose.probabilities_block_file_excluding_cab_or_split())
util.add_raw_block_to_default_and_controller_and_snapshots(preset, dsp, slot, raw_block_dict)
util.get_default_dsp_slot(preset, dsp, slot)["@path"] = path
util.get_default_dsp_slot(preset, dsp, slot)["@position"] = pos
# Check if the new block is an amp - if so, add a cab for it
new_model = raw_block_dict["Defaults"]["@model"]
if new_model.startswith("HD2_Amp"):
unused_cab_slots = find_unused_default_dsp_cab_slots(preset)
if unused_cab_slots[dsp]:
cab_slot = unused_cab_slots[dsp].pop()
print(f" adding cab {cab_slot} for new amp {new_model}")
util.get_default_dsp_slot(preset, dsp, slot)["@cab"] = cab_slot
raw_cab_dict = file.load_block_dictionary(choose.random_block_file_in_category("Cab"))
util.add_raw_block_to_default_and_controller_and_snapshots(preset, dsp, cab_slot, raw_cab_dict)
else:
print(f" WARNING: no cab slot available for new amp {new_model}")
for snapshot_num in range(var.NUM_SNAPSHOTS):
mutate_param_values_for_one_snapshot_slot(preset, snapshot_num, dsp, slot, 1.0)
def swap_with_random_split_from_file(preset, dsp, slot):
print("swap_with_random_split_from_file")
keep_position = util.get_default_dsp_slot(preset, dsp, slot)["@position"]
split_dict = file.load_block_dictionary(choose.random_block_file_in_category("Split"))
util.add_raw_block_to_default_and_controller_and_snapshots(preset, dsp, slot, split_dict)
util.get_default_dsp_slot(preset, dsp, slot)["@position"] = keep_position
def mutate_all_control_ranges(preset, controller):
for dsp in util.get_controller(preset):
# Skip non-dsp entries like 'variax'
if not dsp.startswith("dsp"):
continue
for slot in util.get_controller_dsp(preset, dsp):
# Skip if slot doesn't exist in default DSP
if slot not in util.get_default_dsp(preset, dsp):
continue
block = util.get_controller_dsp(preset, dsp)[slot]
if any(block[param]["@controller"] == controller for param in block):
for parameter in block:
if block[parameter]["@controller"] == controller:
mutate_one_set_of_control_ranges(preset, dsp, slot, parameter)
break
def mutate_one_set_of_control_ranges(preset, dsp, slot, parameter):
param = util.get_controller_dsp(preset, dsp)[slot][parameter]
if not isinstance(param["@min"], bool): # don't want to pedal bools
# get original ranges from file
raw_block_dict = file.reload_raw_block_dictionary(preset, dsp, slot)
pmin = raw_block_dict["Controller_Dict"][parameter]["@min"]
pmax = raw_block_dict["Controller_Dict"][parameter]["@max"]
# print(pedalParam["@min"], pmin, pmax)
if param["@min"] == pmin and param["@max"] == pmax:
new_max = random.uniform(param["@min"], param["@max"])
new_min = random.uniform(param["@min"], param["@max"])
else:
new_min = mutate_parameter_value(param["@min"], pmin, pmax) # (mean, pmin, pmax)
new_max = mutate_parameter_value(param["@max"], pmin, pmax)
param["@min"] = new_min
param["@max"] = new_max
def change_topology(preset):
rearrange_blocks(preset, var.FRACTION_MOVE)
choose.move_splits_and_joins(preset)
toggle_series_or_parallel_dsps(preset, var.TOGGLE_RATE)
def mutate_values_ranges_and_states(preset, mutation_rate, block_toggle_rate):
mutate_param_values_for_all_snapshots(preset, mutation_rate)
mutate_all_control_ranges(preset, var.CONTROLLER_PEDAL2)
mutate_all_control_ranges(preset, var.CONTROLLER_MIDICC)
mutate_values_in_all_default_blocks(preset, mutation_rate)
toggle_some_block_states(preset, block_toggle_rate)
def mutate_preset_processor(preset, args, postfix_num):
snapshot_src_num_str = args.get("snapshot_src_num")
if snapshot_src_num_str == "":
snapshot_src_num_str = "default"
util.set_preset_name_for_mutate(preset, args, postfix_num)
util.copy_snapshot_values_to_default(preset, snapshot_src_num_str)
util.copy_all_default_values_to_all_snapshots(preset)
# util.add_dsp_controller_splits_and_snapshot_keys_if_missing(preset)
util.set_led_colours(preset)
util.add_splits_if_missing(preset)
if args.get("change_topology") is True:
util.set_topologies_to_SABJ(preset)
util.set_dsp1_input_to_multi(preset)
change_topology(preset)
swap_some_blocks_and_splits_from_file(preset, var.MUTATION_RATE)
if args.get("change_controllers") is True:
choose.remove_some_random_controllers(preset)
util.remove_empty_controller_dsp_slots(preset)
choose.grow_SNAPSHOT_controllers(preset)
choose.grow_PEDAL2_controllers(preset)
choose.grow_MIDICC_controllers(preset)
mutate_values_ranges_and_states(preset, var.MUTATION_RATE, var.MUTATION_RATE)
return preset
def main():
process_preset.main(mutate_preset_processor)
if __name__ == "__main__":
main()