update
This commit is contained in:
parent
59e23bfe2d
commit
c4ca05f892
17 changed files with 235 additions and 121 deletions
|
@ -74,6 +74,9 @@ else:
|
|||
|
||||
# -------------------------------------------------------------- Output Format --------------------------------------------------------------
|
||||
|
||||
out_file_nameext = os.path.splitext(os.path.basename(out_file))
|
||||
out_file_path = os.path.dirname(out_file)
|
||||
|
||||
if out_format in core.output_get_plugins():
|
||||
out_class = core.output_set(out_format)
|
||||
else:
|
||||
|
@ -81,8 +84,6 @@ else:
|
|||
exit()
|
||||
|
||||
out_plug_ext = core.output_get_extension()
|
||||
out_file_nameext = os.path.splitext(os.path.basename(out_file))
|
||||
out_file_path = os.path.dirname(out_file)
|
||||
if out_file_nameext[1] == '': out_file = os.path.join(out_file_path, out_file_nameext[0]+'.'+out_plug_ext)
|
||||
|
||||
# -------------------------------------------------------------- convert --------------------------------------------------------------
|
||||
|
@ -102,6 +103,6 @@ if os.path.isfile(out_file) and do_overwrite == False:
|
|||
exit()
|
||||
|
||||
core.parse_input(in_file, extra_json)
|
||||
core.convert_plugins(extra_json)
|
||||
core.convert_type_output(extra_json)
|
||||
core.convert_plugins(extra_json)
|
||||
core.parse_output(out_file)
|
|
@ -11,6 +11,7 @@ import platform
|
|||
import os
|
||||
|
||||
typelist = {}
|
||||
typelist['c'] = 'Cloned'
|
||||
typelist['r'] = 'Regular'
|
||||
typelist['ri'] = 'RegularIndexed'
|
||||
typelist['m'] = 'Multiple'
|
||||
|
@ -196,22 +197,48 @@ def convert_type_output(extra_json):
|
|||
|
||||
convproj_j[0] = song_compat.makecompat_any(convproj_j[0], in_type, in_dawcapabilities, out_dawcapabilities)
|
||||
|
||||
if in_type == 'ri' and out_type == 'mi': convproj_j[0] = song_convert.ri2mi(convproj_j[0])
|
||||
if in_type == 'ri' and out_type == 'r': convproj_j[0] = song_convert.ri2r(convproj_j[0])
|
||||
if in_type == 'ri' and out_type == 'mi':
|
||||
convproj_j[0] = song_convert.ri2mi(convproj_j[0])
|
||||
elif in_type == 'ri' and out_type == 'r':
|
||||
convproj_j[0] = song_convert.ri2r(convproj_j[0])
|
||||
|
||||
if in_type == 'm' and out_type == 'mi': convproj_j[0] = song_convert.m2mi(convproj_j[0])
|
||||
if in_type == 'm' and out_type == 'r': convproj_j[0] = song_convert.m2r(convproj_j[0])
|
||||
elif in_type == 'm' and out_type == 'mi':
|
||||
convproj_j[0] = song_convert.m2mi(convproj_j[0])
|
||||
elif in_type == 'm' and out_type == 'r':
|
||||
convproj_j[0] = song_convert.m2r(convproj_j[0])
|
||||
|
||||
if in_type == 'r' and out_type == 'm': convproj_j[0] = song_convert.r2m(convproj_j[0])
|
||||
if in_type == 'r' and out_type == 'mi':
|
||||
elif in_type == 'r' and out_type == 'm':
|
||||
convproj_j[0] = song_convert.r2m(convproj_j[0])
|
||||
elif in_type == 'r' and out_type == 'mi':
|
||||
convproj_j[0] = song_convert.r2m(convproj_j[0])
|
||||
convproj_j[0] = song_convert.m2mi(convproj_j[0])
|
||||
|
||||
if in_type == 'mi' and out_type == 'm': convproj_j[0] = song_convert.mi2m(convproj_j[0], extra_json)
|
||||
if in_type == 'mi' and out_type == 'r':
|
||||
elif in_type == 'mi' and out_type == 'm':
|
||||
convproj_j[0] = song_convert.mi2m(convproj_j[0], extra_json)
|
||||
elif in_type == 'mi' and out_type == 'r':
|
||||
convproj_j[0] = song_convert.mi2m(convproj_j[0], extra_json)
|
||||
convproj_j[0] = song_convert.m2r(convproj_j[0])
|
||||
|
||||
elif in_type == 'c' and out_type == 'r':
|
||||
convproj_j[0] = song_convert.c2r(convproj_j[0])
|
||||
elif in_type == 'c' and out_type == 'm':
|
||||
convproj_j[0] = song_convert.c2r(convproj_j[0])
|
||||
convproj_j[0] = song_convert.r2m(convproj_j[0])
|
||||
elif in_type == 'c' and out_type == 'mi':
|
||||
convproj_j[0] = song_convert.c2r(convproj_j[0])
|
||||
convproj_j[0] = song_convert.r2m(convproj_j[0])
|
||||
convproj_j[0] = song_convert.m2mi(convproj_j[0])
|
||||
|
||||
elif in_type == out_type:
|
||||
pass
|
||||
|
||||
elif out_type == 'debug':
|
||||
pass
|
||||
|
||||
else:
|
||||
print(typelist[in_type],'to',typelist[out_type],'is not supported')
|
||||
exit()
|
||||
|
||||
if out_type != 'debug':
|
||||
convproj_j[0] = song_compat.makecompat(convproj_j[0], out_type, in_dawcapabilities, out_dawcapabilities)
|
||||
|
||||
|
|
|
@ -31,12 +31,12 @@ def trackfx2fxrack(cvpj_l, cvpjtype):
|
|||
|
||||
tracks.a_move_auto(cvpj_l, ['master','vol'], ['fxmixer','0','vol'])
|
||||
|
||||
if cvpjtype == 'r' or cvpjtype == 'ri':
|
||||
r_trackfx2fxrack(cvpj_l, cvpjtype)
|
||||
if cvpjtype in ['r', 'ri']:
|
||||
trackfx2fxrack_adv(cvpj_l, cvpjtype)
|
||||
else:
|
||||
o_trackfx2fxrack(cvpj_l, cvpjtype)
|
||||
trackfx2fxrack_simple(cvpj_l, cvpjtype)
|
||||
|
||||
def r_trackfx2fxrack(cvpj_l, cvpjtype):
|
||||
def trackfx2fxrack_adv(cvpj_l, cvpjtype):
|
||||
cvpj_l['fxrack'] = {}
|
||||
fxnum = 1
|
||||
|
||||
|
@ -116,7 +116,7 @@ def r_trackfx2fxrack(cvpj_l, cvpjtype):
|
|||
|
||||
#print(outfxnum)
|
||||
|
||||
print('[r_trackfx2fxrack] Num ', 'type'.ljust(8), 'id'.ljust(12), 'dest'.ljust(8), 'dest_id'.ljust(12))
|
||||
print('[trackfx2fxrack_adv] Num ', 'type'.ljust(8), 'id'.ljust(12), 'dest'.ljust(8), 'dest_id'.ljust(12))
|
||||
for fxslot in fxdata:
|
||||
slotdata = fxdata[fxslot]
|
||||
|
||||
|
@ -129,20 +129,22 @@ def r_trackfx2fxrack(cvpj_l, cvpjtype):
|
|||
|
||||
tracks.fxrack_addsend(cvpj_l, fxslot, out_fx_send[0], out_fx_send[1], None)
|
||||
|
||||
print('[r_trackfx2fxrack] '+str(fxslot).rjust(4),
|
||||
print('[trackfx2fxrack_adv] '+str(fxslot).rjust(4),
|
||||
str(slotdata[0][0]).ljust(8),
|
||||
str(slotdata[0][1]).ljust(12),
|
||||
str(slotdata[1][0]).ljust(8),
|
||||
str(slotdata[1][1]).ljust(12),
|
||||
out_fx_send)
|
||||
|
||||
def o_trackfx2fxrack(cvpj_l, cvpjtype):
|
||||
|
||||
|
||||
def trackfx2fxrack_simple(cvpj_l, cvpjtype):
|
||||
cvpj_l['fxrack'] = {}
|
||||
fxnum = 1
|
||||
if cvpjtype == 'r' or cvpjtype == 'ri':
|
||||
if cvpjtype in ['r', 'ri', 'c']:
|
||||
c_orderingdata = cvpj_l['track_order']
|
||||
c_trackdata = cvpj_l['track_data']
|
||||
if cvpjtype == 'm' or cvpjtype == 'mi':
|
||||
if cvpjtype in ['m', 'mi']:
|
||||
c_orderingdata = cvpj_l['instruments_order']
|
||||
c_trackdata = cvpj_l['instruments_data']
|
||||
|
||||
|
@ -157,9 +159,9 @@ def o_trackfx2fxrack(cvpj_l, cvpjtype):
|
|||
fxtrack = {}
|
||||
if 'name' in trackdata:
|
||||
fxtrack['name'] = trackdata['name']
|
||||
print('[compat] trackfx2fxrack: Track to FX '+str(fxnum)+' ('+str(trackdata['name'])+')')
|
||||
print('[trackfx2fxrack_simple] Track to FX '+str(fxnum)+' ('+str(trackdata['name'])+')')
|
||||
else:
|
||||
print('[compat] trackfx2fxrack: Track to FX '+str(fxnum))
|
||||
print('[trackfx2fxrack_simple] Track to FX '+str(fxnum))
|
||||
|
||||
if 'color' in trackdata: fxtrack['color'] = trackdata['color']
|
||||
if 'chain_fx_audio' in trackdata:
|
||||
|
@ -167,6 +169,9 @@ def o_trackfx2fxrack(cvpj_l, cvpjtype):
|
|||
del trackdata['chain_fx_audio']
|
||||
cvpj_l['fxrack'][str(fxnum)] = fxtrack
|
||||
|
||||
if cvpjtype == 'c':
|
||||
tracks.a_move_auto(cvpj_l, ['track',trackid,'vol'], ['fxmixer',str(fxnum),'vol'])
|
||||
|
||||
fxnum += 1
|
||||
|
||||
def fxrack2trackfx(cvpj_l, cvpjtype):
|
||||
|
|
|
@ -14,6 +14,106 @@ from functions import notelist_data
|
|||
from functions import xtramath
|
||||
import json
|
||||
|
||||
def rx_track_iter(cvpj_track_placements, cvpj_track_order, cvpj_track_data):
|
||||
for trackid in cvpj_track_order:
|
||||
track_placements_pre = cvpj_track_placements[trackid] if trackid in cvpj_track_placements else {}
|
||||
track_placements_notes = track_placements_pre['notes'] if 'notes' in track_placements_pre else []
|
||||
track_placements_audio = track_placements_pre['audio'] if 'audio' in track_placements_pre else []
|
||||
track_data = cvpj_track_data[trackid] if trackid in cvpj_track_data else {}
|
||||
yield trackid, track_data, track_placements_notes, track_placements_audio
|
||||
|
||||
# ---------------------------------- Cloned to Regular ----------------------------------
|
||||
|
||||
def c2r(song):
|
||||
print('[song-convert] Converting from Cloned > Regular')
|
||||
cvpj_proj = json.loads(song)
|
||||
if 'track_order' not in cvpj_proj:
|
||||
print('[error] track_order not found')
|
||||
|
||||
cvpj_instruments_data = cvpj_proj['instruments_data']
|
||||
del cvpj_proj['instruments_data']
|
||||
cvpj_track_order = cvpj_proj['track_order']
|
||||
del cvpj_proj['track_order']
|
||||
cvpj_track_data = cvpj_proj['track_data']
|
||||
del cvpj_proj['track_data']
|
||||
cvpj_plugins = cvpj_proj['plugins']
|
||||
del cvpj_proj['plugins']
|
||||
|
||||
if 'track_placements' in cvpj_proj:
|
||||
cvpj_track_placements = cvpj_proj['track_placements']
|
||||
del cvpj_proj['track_placements']
|
||||
else: cvpj_track_placements = {}
|
||||
|
||||
cvpj_proj['track_placements'] = {}
|
||||
cvpj_proj['track_order'] = []
|
||||
cvpj_proj['track_data'] = {}
|
||||
cvpj_proj['plugins'] = {}
|
||||
|
||||
usedinst = {}
|
||||
|
||||
for trackid, track_data, track_placements_notes, track_placements_audio in rx_track_iter(cvpj_track_placements, cvpj_track_order, cvpj_track_data):
|
||||
|
||||
if track_data['type'] == 'instruments':
|
||||
track_data['type'] = 'instrument'
|
||||
|
||||
used_insts = []
|
||||
for c_track_placement in track_placements_notes:
|
||||
c_track_placement_base = c_track_placement.copy()
|
||||
del c_track_placement_base['notelist']
|
||||
m_notelist = {}
|
||||
if 'notelist' in c_track_placement:
|
||||
for cvpj_note in c_track_placement['notelist']:
|
||||
noteinst = cvpj_note['instrument']
|
||||
if noteinst not in m_notelist: m_notelist[noteinst] = []
|
||||
cvpj_note['instrument'] += '_'+trackid
|
||||
m_notelist[noteinst].append(cvpj_note)
|
||||
if noteinst not in used_insts: used_insts.append(noteinst)
|
||||
|
||||
for m_inst in m_notelist:
|
||||
r_trackid = m_inst+'_'+trackid
|
||||
c_track_placement_single = c_track_placement_base.copy()
|
||||
c_track_placement_single['notelist'] = m_notelist[m_inst]
|
||||
data_values.nested_dict_add_to_list(
|
||||
cvpj_proj,
|
||||
['track_placements', r_trackid, 'notes'],
|
||||
c_track_placement_single)
|
||||
|
||||
for used_inst in used_insts:
|
||||
cvpj_instrument = cvpj_instruments_data[used_inst].copy() if used_inst in cvpj_instruments_data else {}
|
||||
pluginid = data_values.nested_dict_get_value(cvpj_instrument, ['instdata', 'pluginid'])
|
||||
if pluginid != None and pluginid not in cvpj_proj['plugins']:
|
||||
cvpj_proj['plugins'][pluginid] = cvpj_plugins[pluginid]
|
||||
|
||||
#cvpj_plugins
|
||||
temp_track_data = track_data.copy()
|
||||
|
||||
if 'name' in cvpj_instrument:
|
||||
instname = cvpj_instrument['name']
|
||||
del cvpj_instrument['name']
|
||||
else:
|
||||
instname = used_inst
|
||||
|
||||
if 'name' in temp_track_data: temp_track_data['name'] = instname+' ('+temp_track_data['name']+')'
|
||||
else: temp_track_data['name'] = instname
|
||||
|
||||
temp_track_data |= cvpj_instrument
|
||||
|
||||
r_trackid = used_inst+'_'+trackid
|
||||
cvpj_proj['track_order'].append(r_trackid)
|
||||
cvpj_proj['track_data'][r_trackid] = temp_track_data
|
||||
|
||||
if track_data['type'] == 'audio':
|
||||
cvpj_proj['track_order'].append(trackid)
|
||||
cvpj_proj['track_data'][trackid] = track_data
|
||||
data_values.nested_dict_add_to_list(
|
||||
cvpj_proj,
|
||||
['track_placements', trackid, 'audio'],
|
||||
track_placements_audio)
|
||||
|
||||
|
||||
return json.dumps(cvpj_proj)
|
||||
|
||||
|
||||
# ---------------------------------- Regular to Multiple ----------------------------------
|
||||
|
||||
def r2m_pl_addinst(placements, trackid):
|
||||
|
|
|
@ -73,7 +73,6 @@ def r_track_iter(cvpj_l):
|
|||
cvpj_track_placements = cvpj_l['track_placements'] if 'track_placements' in cvpj_l else {}
|
||||
cvpj_track_order = cvpj_l['track_order'] if 'track_order' in cvpj_l else []
|
||||
cvpj_track_data = cvpj_l['track_data'] if 'track_data' in cvpj_l else {}
|
||||
outdata = []
|
||||
for trackid in cvpj_track_order:
|
||||
track_placements = cvpj_track_placements[trackid] if trackid in cvpj_track_placements else {}
|
||||
track_data = cvpj_track_data[trackid] if trackid in cvpj_track_data else {}
|
||||
|
|
|
@ -5,7 +5,7 @@ import argparse
|
|||
import struct
|
||||
from io import BytesIO
|
||||
from functions import data_bytes
|
||||
from functions import format_flp_tlv
|
||||
from functions_plugin import format_flp_tlv
|
||||
|
||||
# ------------- Functions -------------
|
||||
def create_bytesio(data):
|
|
@ -74,14 +74,12 @@ def parsetrack_timbre(file_stream):
|
|||
track_name = data_bytes.readstring_fixedlen(file_stream, 15, 'ascii')
|
||||
track_num_events = int.from_bytes(file_stream.read(2), 'little')
|
||||
rol_timbre_events = {}
|
||||
used_instruments = []
|
||||
for _ in range(track_num_events):
|
||||
timbre_pos = int.from_bytes(file_stream.read(2), 'little')
|
||||
timbre_name = file_stream.read(9).split(b'\x00')[0].decode('ascii')
|
||||
if timbre_name not in used_instruments: used_instruments.append(timbre_name)
|
||||
rol_timbre_events[timbre_pos] = timbre_name
|
||||
file_stream.read(3)
|
||||
return track_name, rol_timbre_events, used_instruments
|
||||
return track_name, rol_timbre_events
|
||||
|
||||
def parsetrack_float(file_stream, i_mul, i_add):
|
||||
track_name = data_bytes.readstring_fixedlen(file_stream, 15, 'ascii')
|
||||
|
@ -106,91 +104,28 @@ def parsetrack(file_stream, tracknum, notelen):
|
|||
rol_tr_volume = parsetrack_float(file_stream, 1, 0)
|
||||
rol_tr_pitch = parsetrack_float(file_stream, 1, -1)
|
||||
|
||||
trackinstpart = 'track_'+str(tracknum+1)+'_'
|
||||
cvpj_trackid = 'track'+str(tracknum+1)
|
||||
|
||||
timbrepoints = []
|
||||
for timbrepos in rol_tr_timbre[1]:
|
||||
timbrepoints.append(timbrepos)
|
||||
|
||||
for used_instrument in rol_tr_timbre[2]:
|
||||
instid = trackinstpart+used_instrument
|
||||
|
||||
used_instrument_upper = used_instrument.upper()
|
||||
|
||||
adlibrol_instname = idvals.get_idval(idvals_inst_adlib_rol, used_instrument_upper, 'name')
|
||||
if adlibrol_instname == 'noname': adlibrol_instname = used_instrument
|
||||
|
||||
tracks.m_inst_create(cvpj_l, instid, name=adlibrol_instname+' (Trk'+str(tracknum+1)+')')
|
||||
tracks.m_inst_add_dataval(cvpj_l, instid, None, 'fxrack_channel', tracknum+1)
|
||||
|
||||
if adlib_bnk == None:
|
||||
adlibrol_gminst = idvals.get_idval(idvals_inst_adlib_rol, used_instrument_upper, 'gm_inst')
|
||||
if adlibrol_gminst != None:
|
||||
pluginid = plugins.get_id()
|
||||
plugins.add_plug_gm_midi(cvpj_l, pluginid, 0, adlibrol_gminst-1)
|
||||
else:
|
||||
if used_instrument_upper in adlib_bnk[0]:
|
||||
opl2data = adlib_bnk[1][adlib_bnk[0][used_instrument_upper][0]]
|
||||
pluginid = plugins.get_id()
|
||||
tracks.r_add_dataval(cvpj_l, instid, None, 'middlenote', 24)
|
||||
plugins.add_plug(cvpj_l, pluginid, 'fm', 'opl2')
|
||||
|
||||
if opl2data[0][0] == 1:
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'perctype', opl2data[0][1]-6, 'int', 'perctype')
|
||||
else:
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'perctype', 0, 'int', 'perctype')
|
||||
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'tremolo_depth', 0, 'int', 'tremolo_depth')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'vibrato_depth', 0, 'int', 'vibrato_depth')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'fm', 1, 'int', 'fm')
|
||||
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_scale', opl2data[1][0], 'int', 'op1_scale')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_freqmul', opl2data[1][1], 'int', 'op1_freqmul')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'feedback', opl2data[1][2], 'int', 'feedback')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_env_attack', (opl2data[1][3]*-1)+15, 'int', 'op1_env_attack')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_env_sustain', (opl2data[1][4]*-1)+15, 'int', 'op1_env_sustain')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_perc_env', int(not bool(opl2data[1][5])), 'int', 'op1_perc_env')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_env_decay', (opl2data[1][6]*-1)+15, 'int', 'op1_env_decay')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_env_release', (opl2data[1][7]*-1)+15, 'int', 'op1_env_release')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_level', (opl2data[1][8]*-1)+63, 'int', 'op1_level')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_tremolo', opl2data[1][9], 'int', 'op1_tremolo')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_vibrato', opl2data[1][10], 'int', 'op1_vibrato')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_ksr', opl2data[1][11], 'int', 'op1_ksr')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'fm', opl2data[1][12], 'int', 'fm')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op1_waveform', opl2data[3][0], 'int', 'op1_waveform')
|
||||
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_scale', opl2data[2][0], 'int', 'op2_scale')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_freqmul', opl2data[2][1], 'int', 'op2_freqmul')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_env_attack', (opl2data[2][3]*-1)+15, 'int', 'op2_env_attack')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_env_sustain', (opl2data[2][4]*-1)+15, 'int', 'op2_env_sustain')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_perc_env', int(not bool(opl2data[2][5])), 'int', 'op2_perc_env')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_env_decay', (opl2data[2][6]*-1)+15, 'int', 'op2_env_decay')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_env_release', (opl2data[2][7]*-1)+15, 'int', 'op2_env_release')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_level', (opl2data[2][8]*-1)+63, 'int', 'op2_level')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_tremolo', opl2data[2][9], 'int', 'op2_tremolo')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_vibrato', opl2data[2][10], 'int', 'op2_vibrato')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_ksr', opl2data[2][11], 'int', 'op2_ksr')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'op2_waveform', opl2data[3][1], 'int', 'op2_waveform')
|
||||
|
||||
tracks.m_inst_pluginid(cvpj_l, instid, pluginid)
|
||||
|
||||
if len(rol_tr_pitch[1]) > 1: tracks.a_auto_nopl_twopoints(['track', instid, 'pitch'], 'float', rol_tr_pitch[1], notelen, 'instant')
|
||||
|
||||
cvpj_notelist = []
|
||||
curtrackpos = 0
|
||||
for rol_notedata in rol_tr_voice[1]:
|
||||
if rol_notedata[0] >= 12:
|
||||
cvpj_noteinst = trackinstpart+rol_tr_timbre[1][closest(timbrepoints, curtrackpos)]
|
||||
cvpj_notelist.append(note_data.mx_makenote(cvpj_noteinst, curtrackpos*notelen, rol_notedata[1]*notelen, rol_notedata[0]-48, None, None))
|
||||
cvpj_noteinst = rol_tr_timbre[1][closest(timbrepoints, curtrackpos)]
|
||||
cvpj_notelist.append(note_data.mx_makenote(cvpj_noteinst.upper(), curtrackpos*notelen, rol_notedata[1]*notelen, rol_notedata[0]-48, None, None))
|
||||
curtrackpos += rol_notedata[1]
|
||||
|
||||
print('[input-adlib_rol] Track: "'+rol_tr_voice[0]+'", Instruments: '+str(rol_tr_timbre[2]))
|
||||
cvpj_l['fxrack'][tracknum+1] = {"name": rol_tr_voice[0]}
|
||||
print('[input-adlib_rol] Track: "'+rol_tr_voice[0]+'"')
|
||||
|
||||
if len(rol_tr_volume) > 1: tracks.a_auto_nopl_twopoints(['fxmixer', tracknum+1, 'vol'], 'float', rol_tr_volume[1], notelen, 'instant')
|
||||
if len(rol_tr_volume) > 1: tracks.a_auto_nopl_twopoints(['track', tracknum+1, 'vol'], 'float', rol_tr_volume[1], notelen, 'instant')
|
||||
if len(rol_tr_pitch[1]) > 1: tracks.a_auto_nopl_twopoints(['track', tracknum+1, 'pitch'], 'float', rol_tr_pitch[1], notelen, 'instant')
|
||||
|
||||
placementdata = placement_data.nl2pl(cvpj_notelist)
|
||||
tracks.m_playlist_pl(cvpj_l, tracknum+1, rol_tr_voice[0], None, placementdata)
|
||||
tracks.c_create_track(cvpj_l, 'instruments', cvpj_trackid, name=rol_tr_voice[0])
|
||||
tracks.c_pl_notes(cvpj_l, cvpj_trackid, placementdata)
|
||||
|
||||
# --------------------------------------- Plugin ----------------------------------------
|
||||
|
||||
|
@ -199,11 +134,9 @@ class input_adlib_rol(plugin_input.base):
|
|||
def is_dawvert_plugin(self): return 'input'
|
||||
def getshortname(self): return 'adlib_rol'
|
||||
def getname(self): return 'AdLib Visual Composer'
|
||||
def gettype(self): return 'm'
|
||||
def gettype(self): return 'c'
|
||||
def getdawcapabilities(self):
|
||||
return {
|
||||
'fxrack': True,
|
||||
'track_lanes': True,
|
||||
'track_nopl': True
|
||||
}
|
||||
def supported_autodetect(self): return True
|
||||
|
@ -215,18 +148,65 @@ class input_adlib_rol(plugin_input.base):
|
|||
else: return False
|
||||
def parse(self, input_file, extra_param):
|
||||
global cvpj_l
|
||||
global idvals_inst_adlib_rol
|
||||
global adlib_bnk
|
||||
|
||||
song_file = open(input_file, 'rb')
|
||||
cvpj_l = {}
|
||||
idvals_inst_adlib_rol = idvals.parse_idvalscsv('data_idvals/adlib_rol_inst.csv')
|
||||
|
||||
adlib_bnk = None
|
||||
if 'extrafile' in extra_param:
|
||||
adlib_bnk = load_bank(extra_param['extrafile'])
|
||||
numinst = len(adlib_bnk[0])
|
||||
for instname in adlib_bnk[0]:
|
||||
instname_upper = instname.upper()
|
||||
adlibrol_instname = idvals.get_idval(idvals_inst_adlib_rol, instname_upper, 'name')
|
||||
tracks.c_inst_create(cvpj_l, instname_upper, name=adlibrol_instname)
|
||||
tracks.c_inst_pluginid(cvpj_l, instname_upper, instname_upper)
|
||||
instdatanum = adlib_bnk[0][instname][0]
|
||||
if instdatanum <= numinst:
|
||||
opl2data = adlib_bnk[1][adlib_bnk[0][instname][0]]
|
||||
|
||||
idvals_inst_adlib_rol = idvals.parse_idvalscsv('data_idvals/adlib_rol_inst.csv')
|
||||
plugins.add_plug(cvpj_l, instname_upper, 'fm', 'opl2')
|
||||
|
||||
cvpj_l = {}
|
||||
tracks.c_inst_add_dataval(cvpj_l, instname_upper, None, 'middlenote', 24)
|
||||
if opl2data[0][0] == 1: plugins.add_plug_param(cvpj_l, instname_upper, 'perctype', opl2data[0][1]-6, 'int', 'perctype')
|
||||
else: plugins.add_plug_param(cvpj_l, instname_upper, 'perctype', 0, 'int', 'perctype')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'tremolo_depth', 0, 'int', 'tremolo_depth')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'vibrato_depth', 0, 'int', 'vibrato_depth')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'fm', 1, 'int', 'fm')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_scale', opl2data[1][0], 'int', 'op1_scale')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_freqmul', opl2data[1][1], 'int', 'op1_freqmul')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'feedback', opl2data[1][2], 'int', 'feedback')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_env_attack', (opl2data[1][3]*-1)+15, 'int', 'op1_env_attack')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_env_sustain', (opl2data[1][4]*-1)+15, 'int', 'op1_env_sustain')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_perc_env', int(not bool(opl2data[1][5])), 'int', 'op1_perc_env')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_env_decay', (opl2data[1][6]*-1)+15, 'int', 'op1_env_decay')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_env_release', (opl2data[1][7]*-1)+15, 'int', 'op1_env_release')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_level', (opl2data[1][8]*-1)+63, 'int', 'op1_level')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_tremolo', opl2data[1][9], 'int', 'op1_tremolo')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_vibrato', opl2data[1][10], 'int', 'op1_vibrato')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_ksr', opl2data[1][11], 'int', 'op1_ksr')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'fm', opl2data[1][12], 'int', 'fm')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op1_waveform', opl2data[3][0], 'int', 'op1_waveform')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_scale', opl2data[2][0], 'int', 'op2_scale')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_freqmul', opl2data[2][1], 'int', 'op2_freqmul')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_env_attack', (opl2data[2][3]*-1)+15, 'int', 'op2_env_attack')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_env_sustain', (opl2data[2][4]*-1)+15, 'int', 'op2_env_sustain')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_perc_env', int(not bool(opl2data[2][5])), 'int', 'op2_perc_env')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_env_decay', (opl2data[2][6]*-1)+15, 'int', 'op2_env_decay')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_env_release', (opl2data[2][7]*-1)+15, 'int', 'op2_env_release')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_level', (opl2data[2][8]*-1)+63, 'int', 'op2_level')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_tremolo', opl2data[2][9], 'int', 'op2_tremolo')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_vibrato', opl2data[2][10], 'int', 'op2_vibrato')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_ksr', opl2data[2][11], 'int', 'op2_ksr')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'op2_waveform', opl2data[3][1], 'int', 'op2_waveform')
|
||||
else:
|
||||
for instassocgm in idvals_inst_adlib_rol:
|
||||
gmmidiinst = idvals_inst_adlib_rol[instassocgm]['gm_inst']
|
||||
rolname = idvals_inst_adlib_rol[instassocgm]['name']
|
||||
tracks.c_inst_create(cvpj_l, instassocgm, name=rolname)
|
||||
if gmmidiinst != None:
|
||||
tracks.c_inst_pluginid(cvpj_l, instassocgm, instassocgm)
|
||||
plugins.add_plug_gm_midi(cvpj_l, instassocgm, 0, gmmidiinst-1)
|
||||
|
||||
rol_header_majorVersion = int.from_bytes(song_file.read(2), 'little')
|
||||
print("[input-adlib_rol] majorVersion: " + str(rol_header_majorVersion))
|
|
@ -27,8 +27,8 @@ class input_gt_mnbs(plugin_input.base):
|
|||
def is_dawvert_plugin(self): return 'input'
|
||||
def getshortname(self): return 'mnbs'
|
||||
def getname(self): return 'Minecraft Note Block Studio'
|
||||
def gettype(self): return 'm'
|
||||
def getdawcapabilities(self): return {'track_lanes': True}
|
||||
def gettype(self): return 'c'
|
||||
def getdawcapabilities(self): return {}
|
||||
def supported_autodetect(self): return False
|
||||
def parse(self, input_file, extra_param):
|
||||
|
||||
|
@ -59,7 +59,7 @@ class input_gt_mnbs(plugin_input.base):
|
|||
|
||||
nbs_notes = {}
|
||||
for playlistid in range(nbs_layercount):
|
||||
tracks.m_playlist_pl(cvpj_l, playlistid+1, None, [0.23, 0.23, 0.23], [])
|
||||
tracks.c_create_track(cvpj_l, 'instruments', str(playlistid+1), color=[0.23, 0.23, 0.23])
|
||||
nbs_notes[playlistid+1] = {}
|
||||
|
||||
nbs_song_name = data_bytes.readstring_lenbyte(nbs_file, 4, "little", "utf-8")
|
||||
|
@ -118,7 +118,8 @@ class input_gt_mnbs(plugin_input.base):
|
|||
if nbs_file.tell() <= nbs_len:
|
||||
for layernum in range(nbs_layercount):
|
||||
layername = data_bytes.readstring_lenbyte(nbs_file, 4, "little", "utf-8")
|
||||
if layername != None: tracks.m_playlist_pl(cvpj_l, layernum+1, layername, None, None)
|
||||
if layername != None:
|
||||
tracks.c_add_dataval(cvpj_l, str(layernum+1), None, 'name', layername)
|
||||
if nbs_newformat == 1: nbs_file.read(3)
|
||||
|
||||
# OUTPUT
|
||||
|
@ -128,13 +129,13 @@ class input_gt_mnbs(plugin_input.base):
|
|||
cvpj_instcolor = idvals.get_idval(idvals_inst_mnbs, str(instnum), 'color')
|
||||
cvpj_instgm = idvals.get_idval(idvals_inst_mnbs, str(instnum), 'gm_inst')
|
||||
|
||||
tracks.m_inst_create(cvpj_l, instid, name=cvpj_instname, color=cvpj_instcolor)
|
||||
tracks.c_inst_create(cvpj_l, instid, name=cvpj_instname, color=cvpj_instcolor)
|
||||
|
||||
if cvpj_instgm != None:
|
||||
plugid = plugins.get_id()
|
||||
plugins.add_plug_gm_midi(cvpj_l, plugid, 0, cvpj_instgm-1)
|
||||
tracks.m_inst_pluginid(cvpj_l, instid, plugid)
|
||||
tracks.m_inst_add_dataval(cvpj_l, instid, 'midi', 'output', {'program': cvpj_instgm})
|
||||
tracks.c_inst_pluginid(cvpj_l, instid, plugid)
|
||||
tracks.c_inst_add_dataval(cvpj_l, instid, 'midi', 'output', {'program': cvpj_instgm})
|
||||
|
||||
|
||||
# PART 4: CUSTOM INSTRUMENTS
|
||||
|
@ -150,8 +151,8 @@ class input_gt_mnbs(plugin_input.base):
|
|||
plugid = plugins.get_id()
|
||||
|
||||
instid = 'NoteBlock'+str(instnum)
|
||||
tracks.m_inst_create(cvpj_l, instid, name=custominst_name)
|
||||
tracks.m_inst_pluginid(cvpj_l, instid, plugid)
|
||||
tracks.c_inst_create(cvpj_l, instid, name=custominst_name)
|
||||
tracks.c_inst_pluginid(cvpj_l, instid, plugid)
|
||||
plugins.add_plug_sampler_singlefile(cvpj_l, plugid, custominst_file)
|
||||
custominstid += 1
|
||||
|
||||
|
@ -170,7 +171,7 @@ class input_gt_mnbs(plugin_input.base):
|
|||
cvpj_notedata = note_data.mx_makenote('NoteBlock'+str(nbs_notedata[1]), note-placementnum, 2, nbs_notedata[0], None, None)
|
||||
layer_placements[placementnum].append(cvpj_notedata)
|
||||
for placenum in layer_placements:
|
||||
tracks.m_playlist_pl_add(cvpj_l, nbs_layer, placement_data.makepl_n(placenum, split_duration, layer_placements[placenum]))
|
||||
tracks.c_pl_notes(cvpj_l, str(nbs_layer), placement_data.makepl_n(placenum, split_duration, layer_placements[placenum]))
|
||||
|
||||
song.add_info(cvpj_l, 'title', nbs_song_name)
|
||||
song.add_info(cvpj_l, 'author', nbs_song_author)
|
|
@ -11,7 +11,7 @@ import varint
|
|||
from pathlib import Path
|
||||
|
||||
from functions_plugin import flp_dec_pluginparams
|
||||
from functions import format_flp_dec
|
||||
from functions_plugin import format_flp_dec
|
||||
from functions import note_mod
|
||||
from functions import data_bytes
|
||||
from functions import colors
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2023 SatyrDiamond
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from functions_plugin import format_flp_tlv
|
||||
from functions import colors
|
||||
from functions import data_bytes
|
||||
from functions import data_values
|
||||
|
@ -8,7 +9,6 @@ from functions import note_data
|
|||
from functions import tracks
|
||||
from functions import song
|
||||
from functions import audio
|
||||
from functions import format_flp_tlv
|
||||
|
||||
import plugin_input
|
||||
import json
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# SPDX-FileCopyrightText: 2023 SatyrDiamond
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from functions_plugin import format_caustic
|
||||
from functions import audio_wav
|
||||
from functions import auto
|
||||
from functions import data_bytes
|
||||
from functions import format_caustic
|
||||
from functions import idvals
|
||||
from functions import note_data
|
||||
from functions import plugins
|
||||
|
|
|
@ -383,7 +383,7 @@ def do_device_data_single(fxpluginid, xmltag, deviceid):
|
|||
|
||||
if plugtype[1] in ['single', 'multi']:
|
||||
x_Player = ET.SubElement(xml_device, 'Player')
|
||||
cvpj_plugindata = plugins.get_plug_data(cvpj_l, pluginid)
|
||||
cvpj_plugindata = plugins.get_plug_data(cvpj_l, fxpluginid)
|
||||
|
||||
x_MultiSampleMap = ET.SubElement(x_Player, 'MultiSampleMap')
|
||||
addvalue(x_MultiSampleMap, 'LoadInRam', 'false')
|
||||
|
|
|
@ -14,6 +14,7 @@ class output_cvpj_f(plugin_output.base):
|
|||
def plugin_archs(self): return None
|
||||
def getdawcapabilities(self):
|
||||
return {
|
||||
'fxrack': True,
|
||||
'track_hybrid': False,
|
||||
'track_lanes': True,
|
||||
'placement_cut': True,
|
||||
|
|
|
@ -7,7 +7,7 @@ import math
|
|||
import base64
|
||||
import struct
|
||||
from bs4 import BeautifulSoup
|
||||
from functions import format_flp_enc
|
||||
from functions_plugin import format_flp_enc
|
||||
from functions import song_convert
|
||||
from functions import note_mod
|
||||
from functions import data_values
|
||||
|
|
Loading…
Reference in a new issue