studio one + anvil studio track color + fix

This commit is contained in:
SatyrDiamond 2023-10-21 23:20:46 -04:00
parent 368726b2bb
commit 9c32848c26
2 changed files with 31 additions and 8 deletions

View file

@ -126,12 +126,35 @@ def add_track(startpos, midicmds):
if midicmd[0] == 'rest': track_curpos += midicmd[1]
elif midicmd[0] == 'track_name': track_name = midicmd[1]
elif midicmd[0] == 'track_name':
track_name = midicmd[1]
#print('TRACK NAME, '+track_name)
elif midicmd[0] == 'sequencer_specific':
exdata = midi_exdata.decode_exdata(midicmd[1], True)
if exdata[0] == [83]:
if exdata[0] == [5]:
if exdata[1][0] == 15: #from Anvil Studio
if exdata[1][1] == 52:
anvilcolordata = exdata[1][2:6]
red_p1 = anvilcolordata[3] & 0x3f
red_p2 = anvilcolordata[2] & 0xe0
out_red = (red_p1 << 2) + (red_p2 >> 5)
green_p1 = anvilcolordata[2] & 0x1f
green_p2 = anvilcolordata[1] & 0xf0
out_green = (green_p1 << 3) + (green_p2 >> 4)
blue_p1 = anvilcolordata[1] & 0x0f
blue_p2 = anvilcolordata[0] & 0x0f
out_blue = (blue_p1 << 4) + blue_p2
track_color = colors.rgb_int_to_rgb_float([out_red, out_green, out_blue])
#else:
# print(exdata[1][1], exdata[1][2:])
elif exdata[0] == [83]:
if exdata[1][0:5] == b'ign\x01\xff': #from Signal MIDI Editor
track_color = colors.rgb_int_to_rgb_float(exdata[1][5:8][::-1])
elif exdata[0] == [80]:

View file

@ -20,16 +20,16 @@ def convert(song):
if 'track_order' not in cvpj_proj:
print('[error] track_order not found')
cvpj_instruments_data = cvpj_proj['instruments_data']
cvpj_track_order = cvpj_proj['track_order']
cvpj_track_data = cvpj_proj['track_data']
cvpj_instruments_data = cvpj_proj['instruments_data'] if 'instruments_data' in cvpj_proj else {}
cvpj_track_order = cvpj_proj['track_order'] if 'track_order' in cvpj_proj else []
cvpj_track_data = cvpj_proj['track_data'] if 'track_data' in cvpj_proj else {}
cvpj_plugins = {}
if 'plugins' in cvpj_proj:
cvpj_plugins = cvpj_proj['plugins']
del cvpj_proj['plugins']
del cvpj_proj['instruments_data']
del cvpj_proj['track_order']
del cvpj_proj['track_data']
if 'instruments_data' in cvpj_proj: del cvpj_proj['instruments_data']
if 'track_order' in cvpj_proj: del cvpj_proj['track_order']
if 'track_data' in cvpj_proj: del cvpj_proj['track_data']
if 'track_placements' in cvpj_proj:
cvpj_track_placements = cvpj_proj['track_placements']