Skip to content

Commit

Permalink
new plugslots
Browse files Browse the repository at this point in the history
  • Loading branch information
SatyrDiamond committed Nov 16, 2024
1 parent 0d4955c commit d7091a9
Show file tree
Hide file tree
Showing 61 changed files with 318 additions and 284 deletions.
44 changes: 22 additions & 22 deletions functions_compat/fxchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def move_fx0_to_mastertrack(convproj_obj):
convproj_obj.automation.move(['fxmixer','0','pan'], ['master', 'pan'])
fxchannel_obj.params.move(convproj_obj.track_master.params, 'vol')
fxchannel_obj.params.move(convproj_obj.track_master.params, 'pan')
convproj_obj.track_master.fxslots_audio = fxchannel_obj.fxslots_audio.copy()
convproj_obj.track_master.fxslots_mixer = fxchannel_obj.fxslots_mixer.copy()
fxchannel_obj.fxslots_audio = []
fxchannel_obj.fxslots_mixer = []
convproj_obj.track_master.plugslots.slots_audio = fxchannel_obj.plugslots.slots_audio.copy()
convproj_obj.track_master.plugslots.slots_mixer = fxchannel_obj.plugslots.slots_mixer.copy()
fxchannel_obj.plugslots.slots_audio = []
fxchannel_obj.plugslots.slots_mixer = []
del convproj_obj.fxrack[0]

def track2fxrack(convproj_obj, data_obj, fxnum, defualtname, starttext, doboth, autoloc):
Expand All @@ -27,10 +27,10 @@ def track2fxrack(convproj_obj, data_obj, fxnum, defualtname, starttext, doboth,
fxchannel_obj = convproj_obj.fx__chan__add(fxnum)
fxchannel_obj.visual.name = fx_name
if data_obj.visual.color: fxchannel_obj.visual.color = data_obj.visual.color.copy()
fxchannel_obj.fxslots_audio = data_obj.fxslots_audio.copy()
fxchannel_obj.fxslots_mixer = data_obj.fxslots_mixer.copy()
data_obj.fxslots_audio = []
data_obj.fxslots_mixer = []
fxchannel_obj.plugslots.slots_audio = data_obj.plugslots.slots_audio.copy()
fxchannel_obj.plugslots.slots_mixer = data_obj.plugslots.slots_mixer.copy()
data_obj.plugslots.slots_audio = []
data_obj.plugslots.slots_mixer = []

vol = data_obj.params.get('vol', 1).value
data_obj.params.remove('vol')
Expand Down Expand Up @@ -82,10 +82,10 @@ def process(convproj_obj, in_dawinfo, out_dawinfo, out_type):
fxchannel_obj = convproj_obj.fx__chan__add(0)
fxchannel_obj.visual = copy.deepcopy(convproj_obj.track_master.visual)
fxchannel_obj.params = copy.deepcopy(convproj_obj.track_master.params)
fxchannel_obj.fxslots_audio = convproj_obj.track_master.fxslots_audio.copy()
fxchannel_obj.fxslots_mixer = convproj_obj.track_master.fxslots_mixer.copy()
convproj_obj.track_master.fxslots_audio = []
convproj_obj.track_master.fxslots_mixer = []
fxchannel_obj.plugslots.slots_audio = convproj_obj.track_master.plugslots.slots_audio.copy()
fxchannel_obj.plugslots.slots_mixer = convproj_obj.track_master.plugslots.slots_mixer.copy()
convproj_obj.track_master.plugslots.slots_audio = []
convproj_obj.track_master.plugslots.slots_mixer = []
convproj_obj.automation.move(['master','vol'], ['fxmixer','0','vol'])
convproj_obj.automation.move(['master','pan'], ['fxmixer','0','pan'])
for count, iterval in enumerate(convproj_obj.instrument__iter()):
Expand All @@ -94,10 +94,10 @@ def process(convproj_obj, in_dawinfo, out_dawinfo, out_type):
fxchannel_obj = convproj_obj.fx__chan__add(fxnum)
fxchannel_obj.visual = copy.deepcopy(inst_obj.visual)
fxchannel_obj.params = copy.deepcopy(inst_obj.params)
fxchannel_obj.fxslots_audio = inst_obj.fxslots_audio.copy()
fxchannel_obj.fxslots_mixer = inst_obj.fxslots_mixer.copy()
inst_obj.fxslots_audio = []
inst_obj.fxslots_mixer = []
fxchannel_obj.plugslots.slots_audio = inst_obj.plugslots.slots_audio.copy()
fxchannel_obj.plugslots.slots_mixer = inst_obj.plugslots.slots_mixer.copy()
inst_obj.plugslots.slots_audio = []
inst_obj.plugslots.slots_mixer = []
inst_obj.fxrack_channel = fxnum
fxchannel_obj.visual = inst_obj.visual.copy()
convproj_obj.automation.move(['track',inst_id,'vol'], ['fxmixer',str(fxnum),'vol'])
Expand Down Expand Up @@ -203,9 +203,9 @@ def process(convproj_obj, in_dawinfo, out_dawinfo, out_type):
convproj_obj.automation.move(['fxmixer',str(fx_num),'vol'], ['group',groupid,'vol'])
fxchannel_obj.params.move(group_obj.params, 'vol')
fxchannel_obj.params.move(group_obj.params, 'pan')
group_obj.fxslots_audio = fxchannel_obj.fxslots_audio.copy()
group_obj.fxslots_mixer = fxchannel_obj.fxslots_mixer.copy()
fxchannel_obj.fxslots_audio = []
group_obj.plugslots.slots_audio = fxchannel_obj.plugslots.slots_audio.copy()
group_obj.plugslots.slots_mixer = fxchannel_obj.plugslots.slots_mixer.copy()
fxchannel_obj.plugslots.slots_audio = []
fxtracks = fx_trackids[fx_num]
if fxchannel_obj.visual.name: group_obj.visual.name = fxchannel_obj.visual.name
elif len(fxtracks) == 1:
Expand Down Expand Up @@ -257,7 +257,7 @@ def process(convproj_obj, in_dawinfo, out_dawinfo, out_type):
is_fx_used = False
if fxdata.visual.name != None: is_fx_used = True
if fxdata.visual.color != None: is_fx_used = True
if fxdata.fxslots_audio != []: is_fx_used = True
if fxdata.plugslots.slots_audio != []: is_fx_used = True
if is_fx_used and (fxnum not in used_fxchans): used_fxchans.append(fxnum)

for target in fxdata.sends.data:
Expand All @@ -279,8 +279,8 @@ def process(convproj_obj, in_dawinfo, out_dawinfo, out_type):
fx_obj.params.move(track_obj.params, 'pan')
track_obj.visual = fx_obj.visual
track_obj.visual.name = '[FX '+str(fxnum)+'] '+(track_obj.visual.name if track_obj.visual.name else '')
track_obj.fxslots_audio = fx_obj.fxslots_audio.copy()
fx_obj.fxslots_audio = []
track_obj.plugslots.slots_audio = fx_obj.plugslots.slots_audio.copy()
fx_obj.plugslots.slots_audio = []

convproj_obj.trackroute['fxrack_'+str(fxnum)].to_master_active = fx_obj.sends.to_master_active

Expand Down
8 changes: 4 additions & 4 deletions functions_compat/removelanes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def process_r(convproj_obj, out_dawinfo):
track_obj.params.move(group_obj.params, paramid)
convproj_obj.automation.move(['track',trackid,paramid], ['group',trackid,paramid])
track_obj.params.move(group_obj.params, paramid)
group_obj.fxslots_notes = track_obj.fxslots_notes
group_obj.fxslots_audio = track_obj.fxslots_audio
track_obj.fxslots_notes = []
track_obj.fxslots_audio = []
group_obj.plugslots.slots_notes = track_obj.plugslots.slots_notes
group_obj.plugslots.slots_audio = track_obj.plugslots.slots_audio
track_obj.plugslots.slots_notes = []
track_obj.plugslots.slots_audio = []

for laneid, lane_obj in track_obj.lanes.items():
cvpj_trackid = trackid+'_lane_'+laneid
Expand Down
20 changes: 10 additions & 10 deletions functions_compat/trackfx2fxrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def list2fxrack(convproj_obj, data_obj, fxnum, defualtname, starttext, removebot
fxchannel_obj = convproj_obj.fx__chan__add(fxnum)
fxchannel_obj.visual.name = fx_name
if data_obj.visual.color: fxchannel_obj.visual.color = data_obj.visual.color.copy()
fxchannel_obj.fxslots_audio = data_obj.fxslots_audio.copy()
fxchannel_obj.fxslots_mixer = data_obj.fxslots_mixer.copy()
data_obj.fxslots_audio = []
data_obj.fxslots_mixer = []
fxchannel_obj.plugslots.slots_audio = data_obj.plugslots.slots_audio.copy()
fxchannel_obj.plugslots.slots_mixer = data_obj.plugslots.slots_mixer.copy()
data_obj.plugslots.slots_audio = []
data_obj.plugslots.slots_mixer = []

vol = data_obj.params.get('vol', 1).value
data_obj.params.remove('vol')
Expand Down Expand Up @@ -75,10 +75,10 @@ def process_m(convproj_obj):
fxchannel_obj = convproj_obj.fx__chan__add(0)
fxchannel_obj.visual = copy.deepcopy(convproj_obj.track_master.visual)
fxchannel_obj.params = copy.deepcopy(convproj_obj.track_master.params)
fxchannel_obj.fxslots_audio = convproj_obj.track_master.fxslots_audio.copy()
fxchannel_obj.fxslots_mixer = convproj_obj.track_master.fxslots_mixer.copy()
convproj_obj.track_master.fxslots_audio = []
convproj_obj.track_master.fxslots_mixer = []
fxchannel_obj.plugslots.slots_audio = convproj_obj.track_master.plugslots.slots_audio.copy()
fxchannel_obj.plugslots.slots_mixer = convproj_obj.track_master.plugslots.slots_mixer.copy()
convproj_obj.track_master.plugslots.slots_audio = []
convproj_obj.track_master.plugslots.slots_mixer = []

convproj_obj.automation.move(['master','vol'], ['fxmixer','0','vol'])
convproj_obj.automation.move(['master','pan'], ['fxmixer','0','pan'])
Expand All @@ -88,8 +88,8 @@ def process_m(convproj_obj):
fxchannel_obj = convproj_obj.fx__chan__add(fxnum)
fxchannel_obj.visual = copy.deepcopy(inst_obj.visual)
fxchannel_obj.params = copy.deepcopy(inst_obj.params)
fxchannel_obj.fxslots_audio = inst_obj.fxslots_audio.copy()
inst_obj.fxslots_audio = []
fxchannel_obj.plugslots.slots_audio = inst_obj.plugslots.slots_audio.copy()
inst_obj.plugslots.slots_audio = []
inst_obj.fxrack_channel = fxnum
fxchannel_obj.visual.name = inst_obj.visual.name
fxchannel_obj.visual.color = inst_obj.visual.color
Expand Down
4 changes: 1 addition & 3 deletions functions_song/convert_m2r.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ def convert(convproj_obj):
track_obj.visual = copy.deepcopy(inst_obj.visual)
track_obj.params = copy.deepcopy(inst_obj.params)
track_obj.datavals = copy.deepcopy(inst_obj.datavals)
track_obj.inst_pluginid = inst_obj.pluginid
track_obj.fxrack_channel = inst_obj.fxrack_channel
track_obj.midi = copy.deepcopy(inst_obj.midi)
track_obj.fxslots_notes = inst_obj.fxslots_notes
track_obj.fxslots_audio = inst_obj.fxslots_audio
track_obj.plugslots = copy.deepcopy(inst_obj.plugslots)
track_obj.is_drum = inst_obj.is_drum
track_stor[inst_id] = track_obj
if track_obj.fxrack_channel not in fxrack_order:
Expand Down
4 changes: 1 addition & 3 deletions functions_song/convert_r2m.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ def convert(convproj_obj):
inst_obj.visual = copy.deepcopy(track_obj.visual)
inst_obj.params = copy.deepcopy(track_obj.params)
inst_obj.datavals = copy.deepcopy(track_obj.datavals)
inst_obj.pluginid = track_obj.inst_pluginid
inst_obj.fxrack_channel = track_obj.fxrack_channel
inst_obj.midi = copy.deepcopy(track_obj.midi)
inst_obj.fxslots_notes = track_obj.fxslots_notes
inst_obj.fxslots_audio = track_obj.fxslots_audio
inst_obj.plugslots = copy.deepcopy(track_obj.plugslots)
inst_obj.is_drum = track_obj.is_drum

convproj_obj.automation.move_everything(['track'], ['inst'])
Expand Down
4 changes: 1 addition & 3 deletions functions_song/convert_ri2mi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ def convert(convproj_obj):
inst_obj.visual = copy.deepcopy(track_obj.visual)
inst_obj.params = copy.deepcopy(track_obj.params)
inst_obj.datavals = copy.deepcopy(track_obj.datavals)
inst_obj.pluginid = track_obj.inst_pluginid
inst_obj.fxrack_channel = track_obj.fxrack_channel

inst_obj.midi = copy.deepcopy(track_obj.midi)
inst_obj.fxslots_notes = track_obj.fxslots_notes
inst_obj.fxslots_audio = track_obj.fxslots_audio
inst_obj.plugslots = copy.deepcopy(track_obj.plugslots)
inst_obj.is_drum = track_obj.is_drum

starttxt = trackid+'_'
Expand Down
6 changes: 3 additions & 3 deletions functions_song/convert_rm2m.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def convert(convproj_obj, change_instnames):
newinstid = 'rm2m__'+trackid+'__'+instid
if instid in old_instruments:
new_inst = copy.deepcopy(old_instruments[instid])
if new_inst.pluginid not in used_plugins:
used_plugins.append(new_inst.pluginid)
if new_inst.plugslots.synth not in used_plugins:
used_plugins.append(new_inst.plugslots.synth)
convproj_obj.instruments[newinstid] = new_inst
convproj_obj.instruments_order.append(newinstid)
else:
Expand Down Expand Up @@ -71,7 +71,7 @@ def convert(convproj_obj, change_instnames):
nlp.notelist.appendtxt_inst('rm2m__'+trackid+'__', '')

for fxnum, fxchan_obj in convproj_obj.fxrack.items():
for x in fxchan_obj.fxslots_audio: used_plugins.append(x)
for x in fxchan_obj.plugslots.slots_audio: used_plugins.append(x)

for plugid in used_plugins:
if plugid:
Expand Down
6 changes: 3 additions & 3 deletions functions_song/convert_rm2r.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def convert(convproj_obj):

new_track_obj = track_obj.make_base_inst(inst_obj)
new_track_obj.is_drum = inst_obj.is_drum
used_plugins.append(new_track_obj.inst_pluginid)
used_plugins.append(new_track_obj.plugslots.synth)

if new_track_obj.fxrack_channel == -1: new_track_obj.fxrack_channel = track_obj.fxrack_channel

Expand Down Expand Up @@ -84,11 +84,11 @@ def convert(convproj_obj):
convproj_obj.track_data[trackid] = track_obj
convproj_obj.track_order.append(trackid)

for fxid in track_obj.fxslots_audio:
for fxid in track_obj.plugslots.slots_audio:
used_plugins.append(fxid)

for num, fxchannel_obj in convproj_obj.fxrack.items():
used_plugins += fxchannel_obj.fxslots_audio
used_plugins += fxchannel_obj.plugslots.slots_audio

used_plugins = set(used_plugins)
if '' in used_plugins: used_plugins.remove('')
Expand Down
9 changes: 4 additions & 5 deletions objects/convproj/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ def __init__(self):
self.visual = visual.cvpj_visual()
self.visual_ui = visual.cvpj_visual_ui()
self.params = params.cvpj_paramset()
self.fxslots_audio = []
self.fxslots_mixer = []
self.plugslots = tracks.cvpj_plugslots()
self.sends = sends.cvpj_sends()

class cvpj_scene:
Expand Down Expand Up @@ -380,7 +379,7 @@ def track__addspec__midi(self, track_id, plug_id, m_bank, m_inst, m_drum, uses_p
track_obj.midi.out_inst.patch = m_inst
track_obj.midi.out_inst.bank = m_bank
track_obj.midi.out_inst.drum = m_drum
track_obj.inst_pluginid = plug_id
track_obj.plugslots.set_synth(plug_id)
track_obj.params.add('usemasterpitch', not m_drum, 'bool')
return track_obj, plugin_obj

Expand Down Expand Up @@ -420,7 +419,7 @@ def track__add__dset(self, track_id, plug_id, dset_name, ds_id, def_name, def_co
plugin_obj = self.plugin__add(plug_id, None, None, None)
plugin_obj.role = 'synth'
track_obj = self.track__add(track_id, 'instrument', uses_pl, indexed)
track_obj.inst_pluginid = plug_id
track_obj.plugslots.set_synth(plug_id)
track_obj.visual.name = def_name
track_obj.visual.color = def_color
track_obj.visual.from_dset_opt(dset_name, 'inst', ds_id)
Expand Down Expand Up @@ -508,7 +507,7 @@ def fx__chan__remove_unused(self):
if track_obj.fxrack_channel in unused_fx: unused_fx.remove(track_obj.fxrack_channel)

for n, d in self.fxrack.items():
if d.visual or d.visual_ui or d.fxslots_audio or d.fxslots_mixer:
if d.visual or d.visual_ui or d.plugslots.slots_audio or d.plugslots.slots_mixer:
if n in unused_fx: unused_fx.remove(n)
if d.sends.to_master_active:
if 0 in unused_fx: unused_fx.remove(0)
Expand Down
Loading

0 comments on commit d7091a9

Please sign in to comment.