update
This commit is contained in:
parent
a6987f9647
commit
2be57ca742
6 changed files with 102 additions and 12 deletions
78
functions_compat/trackfx_to_numdata.py
Normal file
78
functions_compat/trackfx_to_numdata.py
Normal file
|
@ -0,0 +1,78 @@
|
|||
from functions_tracks import tracks_r
|
||||
|
||||
def trackfx_to_numdata_track(trackid, ingroupnum):
|
||||
global tracknum
|
||||
global output_ids
|
||||
global idnum_tracks
|
||||
global idnum_return
|
||||
global idnum_group
|
||||
|
||||
if ingroupnum == None: output_ids.append([tracknum, 'track', trackid, [-1, 1, None], [] ])
|
||||
else: output_ids.append([tracknum, 'track', trackid, [ingroupnum, 1, None], [] ])
|
||||
idnum_tracks[trackid] = tracknum
|
||||
|
||||
cvpj_track_data = cvpj_l['track_data'][trackid]
|
||||
tracknum = idnum_tracks[trackid]
|
||||
if 'sends_audio' in cvpj_track_data:
|
||||
for senddata in cvpj_track_data['sends_audio']:
|
||||
returnnum = idnum_return[senddata['sendid']]
|
||||
sendautoid = senddata['sendautoid'] if 'sendautoid' in senddata else None
|
||||
output_ids[tracknum][4].append([returnnum, senddata['amount'], 1, sendautoid])
|
||||
tracknum += 1
|
||||
|
||||
def trackfx_to_numdata(cvpj_l_in):
|
||||
global tracknum
|
||||
global output_ids
|
||||
global idnum_tracks
|
||||
global idnum_return
|
||||
global idnum_group
|
||||
global cvpj_l
|
||||
|
||||
cvpj_l = cvpj_l_in
|
||||
|
||||
group_trk = {}
|
||||
nogroup_trk = []
|
||||
|
||||
for cvpj_trackid, s_trackdata, track_placements in tracks_r.iter(cvpj_l):
|
||||
inside_group = s_trackdata['group'] if 'group' in s_trackdata else None
|
||||
if inside_group != None:
|
||||
if inside_group not in group_trk: group_trk[inside_group] = []
|
||||
group_trk[inside_group].append(cvpj_trackid)
|
||||
else:
|
||||
nogroup_trk.append(cvpj_trackid)
|
||||
|
||||
output_ids = []
|
||||
idnum_group = {}
|
||||
idnum_return = {}
|
||||
idnum_tracks = {}
|
||||
|
||||
tracknum = 0
|
||||
if 'track_master' in cvpj_l:
|
||||
track_master = cvpj_l['track_master']
|
||||
if 'returns' in track_master:
|
||||
for returnid in track_master['returns']:
|
||||
idnum_return[returnid] = tracknum
|
||||
output_ids.append([tracknum, 'return', returnid, [-1, 1, None], []])
|
||||
tracknum += 1
|
||||
|
||||
for groupid in group_trk:
|
||||
cvpj_group_data = cvpj_l['groups'][groupid]
|
||||
idnum_group[groupid] = tracknum
|
||||
output_ids.append([tracknum, 'group', groupid, [-1, 1, None], [] ])
|
||||
tracknum += 1
|
||||
for trackid in group_trk[groupid]:
|
||||
trackfx_to_numdata_track(trackid, idnum_group[groupid])
|
||||
|
||||
for trackid in nogroup_trk:
|
||||
trackfx_to_numdata_track(trackid, None)
|
||||
|
||||
for groupid in group_trk:
|
||||
if 'sends_audio' in cvpj_group_data:
|
||||
for senddata in cvpj_group_data['sends_audio']:
|
||||
groupidnum = idnum_group[groupid]
|
||||
returnnum = idnum_return[senddata['sendid']]
|
||||
sendautoid = senddata['sendautoid'] if 'sendautoid' in senddata else None
|
||||
output_ids[groupidnum][4].append([returnnum, senddata['amount'], 1, sendautoid])
|
||||
|
||||
return output_ids
|
||||
|
|
@ -36,6 +36,12 @@ def send_add(cvpj_l, i_trackid, i_sendname, i_amount, i_sendautoid):
|
|||
print('[tracks] Adding Send: "'+i_sendname+'"')
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['track_data', i_trackid, 'sends_audio'], send_data)
|
||||
|
||||
def group_send_add(cvpj_l, g_id, i_sendname, i_amount, i_sendautoid):
|
||||
send_data = {'amount': i_amount, 'sendid': i_sendname}
|
||||
if i_sendautoid != None: send_data['sendautoid'] = i_sendautoid
|
||||
print('[tracks] Adding Send: "'+i_sendname+'"')
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['groups', g_id, 'sends_audio'], send_data)
|
||||
|
||||
def group_add(cvpj_l, g_id, i_inside_group):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['groups', g_id], {})
|
||||
if i_inside_group != None:
|
||||
|
|
|
@ -322,6 +322,7 @@ class input_xm(plugin_input.base):
|
|||
file_stream = open(input_file, 'rb')
|
||||
|
||||
xm_header = file_stream.read(17)
|
||||
|
||||
xm_name = data_bytes.readstring_fixedlen(file_stream, 20, "windows-1252")
|
||||
print("[input-xm] Song Name: " + xm_name)
|
||||
xm_1a = file_stream.read(1)
|
||||
|
|
|
@ -517,19 +517,10 @@ class input_ableton(plugin_input.base):
|
|||
|
||||
tracks_r.add_pl(cvpj_l, track_id, 'audio', cvpj_placement)
|
||||
|
||||
sendcount = 1
|
||||
if tracktype in ['MidiTrack', 'AudioTrack']:
|
||||
get_auto(x_track_data)
|
||||
for track_sendholder in track_sendholders:
|
||||
sendid = sendcount
|
||||
sendautoid = 'send_'+track_id+'_'+str(sendid)
|
||||
sendlevel = get_param(track_sendholder, 'Send', 'float', 0, ['send', sendautoid, 'amount'], None)
|
||||
trackfx.send_add(cvpj_l, track_id, 'return_'+str(sendid), sendlevel, sendautoid)
|
||||
sendcount += 1
|
||||
|
||||
if tracktype == 'ReturnTrack':
|
||||
get_auto(x_track_data)
|
||||
cvpj_returntrackid = 'return_'+str(returnid)
|
||||
fxloc = ['return', None, cvpj_returntrackid]
|
||||
track_vol = get_param(x_track_Mixer, 'Volume', 'float', 0, ['return', cvpj_returntrackid, 'vol'], None)
|
||||
track_pan = get_param(x_track_Mixer, 'Pan', 'float', 0, ['return', cvpj_returntrackid, 'pan'], None)
|
||||
trackfx.return_add(cvpj_l, ['master'], cvpj_returntrackid)
|
||||
|
@ -541,6 +532,7 @@ class input_ableton(plugin_input.base):
|
|||
if tracktype == 'GroupTrack':
|
||||
get_auto(x_track_data)
|
||||
cvpj_grouptrackid = 'group_'+str(track_id)
|
||||
fxloc = ['group', cvpj_grouptrackid]
|
||||
track_vol = get_param(x_track_Mixer, 'Volume', 'float', 0, ['group', cvpj_grouptrackid, 'vol'], None)
|
||||
track_pan = get_param(x_track_Mixer, 'Pan', 'float', 0, ['group', cvpj_grouptrackid, 'pan'], None)
|
||||
trackfx.group_add(cvpj_l, cvpj_grouptrackid, None)
|
||||
|
@ -548,6 +540,17 @@ class input_ableton(plugin_input.base):
|
|||
trackfx.group_param_add(cvpj_l, cvpj_grouptrackid, 'vol', track_vol, 'float')
|
||||
trackfx.group_param_add(cvpj_l, cvpj_grouptrackid, 'pan', track_pan, 'float')
|
||||
|
||||
sendcount = 1
|
||||
if fxloc != None:
|
||||
get_auto(x_track_data)
|
||||
for track_sendholder in track_sendholders:
|
||||
sendid = sendcount
|
||||
sendautoid = 'send_'+track_id+'_'+str(sendid)
|
||||
sendlevel = get_param(track_sendholder, 'Send', 'float', 0, ['send', sendautoid, 'amount'], None)
|
||||
if fxloc[0] == 'track': trackfx.send_add(cvpj_l, track_id, 'return_'+str(sendid), sendlevel, sendautoid)
|
||||
if fxloc[0] == 'group': trackfx.group_send_add(cvpj_l, cvpj_grouptrackid, 'return_'+str(sendid), sendlevel, sendautoid)
|
||||
sendcount += 1
|
||||
|
||||
x_track_DeviceChain_inside = x_track_DeviceChain.findall('DeviceChain')[0]
|
||||
x_trackdevices = x_track_DeviceChain_inside.findall('Devices')[0]
|
||||
|
||||
|
|
|
@ -60,8 +60,8 @@ def dp_parse_trackinfo(dpx_track):
|
|||
if track_role == "instrument" or track_role == "audio":
|
||||
tracks_r.track_create(cvpj_l, dpt_cid, track_role)
|
||||
tracks_r.track_visual(cvpj_l, dpt_cid, name=dpt_name, color=dpt_color)
|
||||
tracks_r.track_param_add(cvpj_l, dpt_cid, 'vol', float(cvpj_l_track_vol[0]), 'float', visname=cvpj_l_track_vol[1])
|
||||
tracks_r.track_param_add(cvpj_l, dpt_cid, 'pan', float(cvpj_l_track_pan[0]), 'float', visname=cvpj_l_track_pan[1])
|
||||
tracks_r.track_param_add(cvpj_l, dpt_cid, 'vol', float(cvpj_l_track_vol[0]), 'float')
|
||||
tracks_r.track_param_add(cvpj_l, dpt_cid, 'pan', float(cvpj_l_track_pan[0]), 'float')
|
||||
|
||||
def parse_auto(pointsxml):
|
||||
cvpj_auto_out = []
|
||||
|
|
|
@ -14,6 +14,7 @@ from functions import idvals
|
|||
from functions import notelist_data
|
||||
from functions import params
|
||||
from functions import auto
|
||||
from functions_compat import trackfx_to_numdata
|
||||
from functions_plugin import soundation_values
|
||||
from functions_tracks import auto_nopl
|
||||
from functions_tracks import tracks_r
|
||||
|
@ -223,6 +224,7 @@ class output_soundation(plugin_output.base):
|
|||
ts_numerator, ts_denominator = cvpj_l['timesig']
|
||||
sng_output["timeSignature"] = str(ts_numerator)+'/'+str(ts_denominator)
|
||||
|
||||
|
||||
for cvpj_trackid, s_trackdata, track_placements in tracks_r.iter(cvpj_l):
|
||||
tracktype = s_trackdata['type']
|
||||
if tracktype == 'instrument':
|
||||
|
|
Loading…
Reference in a new issue