update
This commit is contained in:
parent
fa4c2b2702
commit
cd1926f073
88 changed files with 1491 additions and 1179 deletions
12
data_idvals/multichip_inst.csv
Normal file
12
data_idvals/multichip_inst.csv
Normal file
|
@ -0,0 +1,12 @@
|
|||
id;name;color_r;color_g;color_b
|
||||
adpcma;ADPCM-A;1;0.9;0.2
|
||||
c64;C64;0.8;0.8;0.8
|
||||
fmop;FM 1op;0.2;0.4;1
|
||||
noise;Noise;0.8;0.8;0.8
|
||||
opn2;FM 4op;0.2;0.8;1
|
||||
pce;PC Engine;1;0.5;0.2
|
||||
pcm;PCM;1;0.9;0.2
|
||||
pulse;Pulse;0.4;1;0.2
|
||||
sample;Sample;1;0.9;0.2
|
||||
square;Square;0.4;1;0.2
|
||||
wavetable;Wavetable;1;0.5;0.2
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
from functions import data_bytes
|
||||
from functions import note_data
|
||||
from functions import tracks
|
||||
from functions import placement_data
|
||||
from functions_tracks import tracks_r
|
||||
import experiments_plugin_input
|
||||
import json
|
||||
|
||||
|
@ -53,8 +53,8 @@ class input_ex_basic_pitch(experiments_plugin_input.base):
|
|||
autonum += 0.1
|
||||
cvpj_notelist.append(cvpj_note)
|
||||
|
||||
tracks.r_create_track(cvpj_l, 'instrument', 'basicpitch')
|
||||
tracks.r_pl_notes(cvpj_l, 'basicpitch', placement_data.nl2pl(cvpj_notelist))
|
||||
tracks_r.track_create(cvpj_l, 'basicpitch', 'instrument')
|
||||
tracks_r.add_pl(cvpj_l, 'basicpitch', 'notes', placement_data.nl2pl(cvpj_notelist))
|
||||
|
||||
cvpj_l['bpm'] = 120
|
||||
return json.dumps(cvpj_l)
|
|
@ -7,9 +7,9 @@ import experiments_plugin_input
|
|||
import os
|
||||
import json
|
||||
from functions import data_values
|
||||
from functions import tracks
|
||||
from functions import audio
|
||||
from functions import song
|
||||
from functions_tracks import tracks_r
|
||||
|
||||
def datachunk_to_placements(poschunk):
|
||||
|
||||
|
@ -53,11 +53,13 @@ class input_color_art(experiments_plugin_input.base):
|
|||
chandata = {}
|
||||
|
||||
for trackid in range(11, 17):
|
||||
tracks.r_create_track(cvpj_l, 'audio', str(trackid), name='Player 1: '+str(trackid-10))
|
||||
tracks_r.track_create(cvpj_l, str(trackid), 'audio')
|
||||
tracks_r.track_visual(cvpj_l, str(trackid), name='Player 1: '+str(trackid-10))
|
||||
chandata[trackid] = {}
|
||||
|
||||
for trackid in range(20, 27):
|
||||
tracks.r_create_track(cvpj_l, 'audio', str(trackid), name='Player 2: '+str(trackid-19))
|
||||
tracks_r.track_create(cvpj_l, str(trackid), 'audio')
|
||||
tracks_r.track_visual(cvpj_l, str(trackid), name='Player 2: '+str(trackid-19))
|
||||
chandata[trackid] = {}
|
||||
|
||||
audio_data = {}
|
||||
|
@ -114,13 +116,14 @@ class input_color_art(experiments_plugin_input.base):
|
|||
|
||||
for trackid in range(11, 27):
|
||||
if trackid in chandata:
|
||||
tracks.r_pl_audio(cvpj_l, trackid, datachunk_to_placements(chandata[trackid]))
|
||||
tracks_r.add_pl(cvpj_l, trackid, 'audio', datachunk_to_placements(chandata[trackid]))
|
||||
|
||||
for s_chandata_bgm in chandata_bgm:
|
||||
print(s_chandata_bgm, chandata_bgm[s_chandata_bgm])
|
||||
trackid = 'bgm_'+str(s_chandata_bgm)
|
||||
tracks.r_create_track(cvpj_l, 'audio', trackid, name='BGM #'+str(s_chandata_bgm))
|
||||
tracks.r_pl_audio(cvpj_l, trackid, datachunk_to_placements(chandata_bgm[s_chandata_bgm]))
|
||||
tracks_r.track_create(cvpj_l, trackid, 'audio')
|
||||
tracks_r.track_visual(cvpj_l, trackid, name='BGM #'+str(s_chandata_bgm))
|
||||
tracks_r.add_pl(cvpj_l, trackid, 'audio', datachunk_to_placements(chandata_bgm[s_chandata_bgm]))
|
||||
|
||||
|
||||
#exit()
|
||||
|
|
|
@ -5,7 +5,7 @@ from PIL import Image
|
|||
|
||||
import experiments_plugin_input
|
||||
import json
|
||||
from functions import tracks
|
||||
from functions_tracks import tracks_r
|
||||
|
||||
class input_color_art(experiments_plugin_input.base):
|
||||
def __init__(self): pass
|
||||
|
@ -41,7 +41,8 @@ class input_color_art(experiments_plugin_input.base):
|
|||
for height in range(h-1):
|
||||
trackid = str('track'+str(height))
|
||||
|
||||
tracks.r_create_track(cvpj_l, 'instrument', trackid, name='.')
|
||||
tracks_r.track_create(cvpj_l, trackid, 'instrument')
|
||||
tracks_r.track_visual(cvpj_l, trackid, name='.')
|
||||
|
||||
for width in range(w):
|
||||
coordinate = width, height
|
||||
|
@ -53,7 +54,7 @@ class input_color_art(experiments_plugin_input.base):
|
|||
placement_pl['position'] = width*16
|
||||
placement_pl['duration'] = 16
|
||||
placement_pl['notelist'] = [{"key": 0, "position": 0, "duration": 0.2}]
|
||||
tracks.r_pl_notes(cvpj_l, trackid, placement_pl)
|
||||
tracks_r.add_pl(cvpj_l, trackid, 'notes', placement_pl)
|
||||
|
||||
cvpj_l['bpm'] = 140
|
||||
return json.dumps(cvpj_l)
|
||||
|
|
|
@ -6,7 +6,6 @@ from functions import notelist_data
|
|||
from functions import data_values
|
||||
from functions import xtramath
|
||||
from functions import params
|
||||
from functions import tracks
|
||||
from functions import audio
|
||||
|
||||
from functions_compat import fxrack2trackfx
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
from functions import note_convert
|
||||
from functions import auto
|
||||
from functions import note_mod
|
||||
from functions import tracks
|
||||
from functions import data_bytes
|
||||
from functions_tracks import tracks_m
|
||||
from functions_tracks import tracks_mi
|
||||
|
||||
global used_instruments_num
|
||||
used_instruments_num = []
|
||||
|
@ -342,7 +343,8 @@ def multi_convert(cvpj_l, i_rows, i_patterns, i_orders, i_chantype, i_len_table)
|
|||
s_patterns = i_patterns[channum]
|
||||
s_orders = i_orders[channum]
|
||||
|
||||
tracks.m_playlist_pl(cvpj_l, channum+1, s_chantype, None, None)
|
||||
tracks_mi.playlist_add(cvpj_l, channum+1)
|
||||
tracks_mi.playlist_visual(cvpj_l, channum+1, name=s_chantype)
|
||||
|
||||
for patnum in s_patterns:
|
||||
s_pattern = s_patterns[patnum]
|
||||
|
@ -356,8 +358,10 @@ def multi_convert(cvpj_l, i_rows, i_patterns, i_orders, i_chantype, i_len_table)
|
|||
|
||||
if NLP != []:
|
||||
patid = str(channum)+'_'+str(patnum)
|
||||
tracks.m_add_nle(cvpj_l, patid, NLP[0]['notelist'])
|
||||
tracks.m_add_nle_info(cvpj_l, patid, s_chantype+' ('+str(patnum)+')', None)
|
||||
|
||||
tracks_mi.notelistindex_add(cvpj_l, patid, NLP[0]['notelist'])
|
||||
tracks_mi.notelistindex_visual(cvpj_l, patid, name=s_chantype+' ('+str(patnum)+')')
|
||||
|
||||
|
||||
curpatnum = 0
|
||||
curpos = 0
|
||||
|
@ -367,7 +371,7 @@ def multi_convert(cvpj_l, i_rows, i_patterns, i_orders, i_chantype, i_len_table)
|
|||
cvpj_l_placement['position'] = curpos
|
||||
cvpj_l_placement['duration'] = i_len_table[curpatnum]
|
||||
cvpj_l_placement['fromindex'] = str(channum)+'_'+str(s_order)
|
||||
cvpj_l_playlist[str(channum+1)]['placements_notes'].append(cvpj_l_placement)
|
||||
tracks_mi.add_pl(cvpj_l, str(channum+1), 'notes', cvpj_l_placement)
|
||||
curpos += i_len_table[curpatnum]
|
||||
curpatnum += 1
|
||||
|
||||
|
|
|
@ -1,483 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2023 SatyrDiamond
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from functions import data_values
|
||||
from functions import auto
|
||||
from functions import params
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ---------------------------------------------------------------- Regular -----------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def r_create_track(cvpj_l, tracktype, trackid, **kwargs):
|
||||
if 'track_data' not in cvpj_l: cvpj_l['track_data'] = {}
|
||||
if 'track_order' not in cvpj_l: cvpj_l['track_order'] = []
|
||||
cvpj_track = {}
|
||||
cvpj_track['type'] = tracktype
|
||||
if 'name' in kwargs:
|
||||
if kwargs['name'] != None: cvpj_track['name'] = kwargs['name']
|
||||
if 'color' in kwargs:
|
||||
if kwargs['color'] != None: cvpj_track['color'] = kwargs['color']
|
||||
cvpj_l['track_data'][trackid] = cvpj_track
|
||||
cvpj_l['track_order'].append(trackid)
|
||||
|
||||
def r_track_pluginid(cvpj_l, trackid, pluginid):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['track_data', trackid, 'instdata', 'pluginid'], pluginid)
|
||||
|
||||
def r_add_param(cvpj_l, trackid, p_id, p_value, p_type, **kwargs):
|
||||
if p_value != None: params.add(cvpj_l, ['track_data', trackid], p_id, p_value, p_type, **kwargs)
|
||||
|
||||
def r_get_param(cvpj_l, trackid, paramname, fallbackval):
|
||||
return params.get(cvpj_l, ['track_data', trackid], paramname, fallbackval)
|
||||
|
||||
def r_add_dataval(cvpj_l, trackid, datagroup, i_name, i_value):
|
||||
if datagroup != None:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['track_data', trackid, datagroup, i_name], i_value)
|
||||
else:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['track_data', trackid, i_name], i_value)
|
||||
|
||||
# ------------------------ RegularIndexed ------------------------
|
||||
|
||||
def ri_nle_add(cvpj_l, trackid, patid, nle_notelist, nle_name):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['track_data', trackid, 'notelistindex', patid], {})
|
||||
cvpj_inst_nle = cvpj_l['track_data'][trackid]['notelistindex'][patid]
|
||||
if nle_name != None: cvpj_inst_nle['name'] = nle_name
|
||||
cvpj_inst_nle['notelist'] = nle_notelist
|
||||
|
||||
# ------------------------ Regular******** ------------------------
|
||||
|
||||
def r_pl_notes(cvpj_l, trackid, placements_data):
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['track_placements', trackid, 'notes'], placements_data)
|
||||
|
||||
def r_pl_audio(cvpj_l, trackid, placements_data):
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['track_placements', trackid, 'audio'], placements_data)
|
||||
|
||||
def r_pl_notes_laned(cvpj_l, trackid, lanename, placements_data):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['track_placements', trackid, 'laned'], 1)
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['track_placements', trackid, 'lanedata', lanename, 'notes'], placements_data)
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['track_placements', trackid, 'laneorder'], lanename)
|
||||
|
||||
def r_pl_audio_laned(cvpj_l, trackid, lanename, placements_data):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['track_placements', trackid, 'laned'], 1)
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['track_placements', trackid, 'lanedata', lanename, 'audio'], placements_data)
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['track_placements', trackid, 'laneorder'], lanename)
|
||||
|
||||
def r_pl_laned(cvpj_l, trackid, laneddata):
|
||||
if 'track_placements' not in cvpj_l: cvpj_l['track_placements'] = {}
|
||||
cvpj_l['track_placements'][trackid] = {}
|
||||
if laneddata != None: cvpj_l['track_placements'][trackid] = laneddata
|
||||
|
||||
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 {}
|
||||
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 {}
|
||||
yield trackid, track_data, track_placements
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------- Multiple -----------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
def m_inst_create(cvpj_l, trackid, **kwargs):
|
||||
if 'instruments_data' not in cvpj_l: cvpj_l['instruments_data'] = {}
|
||||
if 'instruments_order' not in cvpj_l: cvpj_l['instruments_order'] = []
|
||||
cvpj_inst = {}
|
||||
if 'name' in kwargs:
|
||||
if kwargs['name'] != None: cvpj_inst['name'] = kwargs['name']
|
||||
if 'color' in kwargs:
|
||||
if kwargs['color'] != None: cvpj_inst['color'] = kwargs['color']
|
||||
cvpj_l['instruments_data'][trackid] = cvpj_inst
|
||||
if trackid not in cvpj_l['instruments_order']: cvpj_l['instruments_order'].append(trackid)
|
||||
|
||||
def m_inst_pluginid(cvpj_l, trackid, pluginid):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['instruments_data', trackid, 'instdata', 'pluginid'], pluginid)
|
||||
|
||||
def m_inst_add_param(cvpj_l, trackid, p_id, p_value, p_type, **kwargs):
|
||||
params.add(cvpj_l, ['instruments_data', trackid], p_id, p_value, p_type, **kwargs)
|
||||
|
||||
def m_inst_get_param(cvpj_l, trackid, paramname, fallbackval):
|
||||
return params.get(cvpj_l, ['instruments_data', trackid], paramname, fallbackval)
|
||||
|
||||
def m_inst_add_dataval(cvpj_l, trackid, datagroup, i_name, i_value):
|
||||
if datagroup != None:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['instruments_data', trackid, datagroup, i_name], i_value)
|
||||
else:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['instruments_data', trackid, i_name], i_value)
|
||||
|
||||
# ------------------------ Multiple******** ------------------------
|
||||
|
||||
def m_playlist_pl(cvpj_l, idnum, trk_name, trk_color, placements_notes):
|
||||
if 'playlist' not in cvpj_l: cvpj_l['playlist'] = {}
|
||||
if str(idnum) not in cvpj_l: cvpj_l['playlist'][str(idnum)] = {}
|
||||
if placements_notes != None: cvpj_l['playlist'][str(idnum)]['placements_notes'] = placements_notes
|
||||
else: cvpj_l['playlist'][str(idnum)]['placements_notes'] = []
|
||||
if trk_name != None: cvpj_l['playlist'][str(idnum)]['name'] = trk_name
|
||||
if trk_color != None: cvpj_l['playlist'][str(idnum)]['color'] = trk_color
|
||||
|
||||
def m_playlist_pl_add(cvpj_l, idnum, placement_data):
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['playlist', str(idnum), 'placements_notes'], placement_data)
|
||||
|
||||
def m_add_nle(cvpj_l, patid, nle_notelist):
|
||||
if 'notelistindex' not in cvpj_l: cvpj_l['notelistindex'] = {}
|
||||
cvpj_l['notelistindex'][patid] = {}
|
||||
cvpj_l['notelistindex'][patid]['notelist'] = nle_notelist
|
||||
|
||||
def m_add_nle_info(cvpj_l, patid, nle_name, nle_color):
|
||||
if nle_name != None: cvpj_l['notelistindex'][patid]['name'] = nle_name
|
||||
if nle_color != None: cvpj_l['notelistindex'][patid]['color'] = nle_color
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# -------------------------------------------------------------- RegularMultiple -----------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def c_inst_create(cvpj_l, trackid, **kwargs):
|
||||
if 'instruments_data' not in cvpj_l: cvpj_l['instruments_data'] = {}
|
||||
cvpj_inst = {}
|
||||
if 'name' in kwargs:
|
||||
if kwargs['name'] != None: cvpj_inst['name'] = kwargs['name']
|
||||
if 'color' in kwargs:
|
||||
if kwargs['color'] != None: cvpj_inst['color'] = kwargs['color']
|
||||
cvpj_l['instruments_data'][trackid] = cvpj_inst
|
||||
|
||||
def c_create_track(cvpj_l, tracktype, trackid, **kwargs):
|
||||
if 'track_data' not in cvpj_l: cvpj_l['track_data'] = {}
|
||||
if 'track_order' not in cvpj_l: cvpj_l['track_order'] = []
|
||||
cvpj_track = {}
|
||||
cvpj_track['type'] = tracktype
|
||||
if 'name' in kwargs:
|
||||
if kwargs['name'] != None: cvpj_track['name'] = kwargs['name']
|
||||
if 'color' in kwargs:
|
||||
if kwargs['color'] != None: cvpj_track['color'] = kwargs['color']
|
||||
cvpj_l['track_data'][trackid] = cvpj_track
|
||||
cvpj_l['track_order'].append(trackid)
|
||||
|
||||
def c_add_dataval(cvpj_l, trackid, datagroup, i_name, i_value):
|
||||
if datagroup != None:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['track_data', trackid, datagroup, i_name], i_value)
|
||||
else:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['track_data', trackid, i_name], i_value)
|
||||
|
||||
def c_inst_pluginid(cvpj_l, trackid, pluginid):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['instruments_data', trackid, 'instdata', 'pluginid'], pluginid)
|
||||
|
||||
def c_inst_add_param(cvpj_l, trackid, p_id, p_value, p_type, **kwargs):
|
||||
params.add(cvpj_l, ['instruments_data', trackid], p_id, p_value, p_type, **kwargs)
|
||||
|
||||
def c_inst_get_param(cvpj_l, trackid, paramname, fallbackval):
|
||||
return params.get(cvpj_l, ['instruments_data', trackid], paramname, fallbackval)
|
||||
|
||||
def c_inst_add_dataval(cvpj_l, trackid, datagroup, i_name, i_value):
|
||||
if datagroup != None:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['instruments_data', trackid, datagroup, i_name], i_value)
|
||||
else:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['instruments_data', trackid, i_name], i_value)
|
||||
|
||||
def c_pl_notes(cvpj_l, trackid, placements_data):
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['track_placements', trackid, 'notes'], placements_data)
|
||||
|
||||
def c_pl_audio(cvpj_l, trackid, placements_data):
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['track_placements', trackid, 'audio'], placements_data)
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------ All -------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def a_addtrack_master(cvpj_l, i_name, i_vol, i_color):
|
||||
if 'track_master' not in cvpj_l: cvpj_l['track_master'] = {}
|
||||
cvpj_master = cvpj_l['track_master']
|
||||
if i_name != None: cvpj_master['name'] = i_name
|
||||
if i_vol != None: params.add(cvpj_l, ['track_master'], 'vol', i_vol, 'float')
|
||||
if i_color != None: cvpj_master['color'] = i_color
|
||||
|
||||
def a_addtrack_master_param(cvpj_l, p_id, p_value, p_type):
|
||||
params.add(cvpj_l, ['track_master'], p_id, p_value, p_type)
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ----------------------------------------------------------------- FXRack -----------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def fxrack_add(cvpj_l, fx_num, fx_name, fx_color, fx_vol, fx_pan):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['fxrack', str(fx_num)], {})
|
||||
fxdata = cvpj_l['fxrack'][str(fx_num)]
|
||||
if fx_color != None: fxdata['color'] = fx_color
|
||||
if fx_name != None: fxdata['name'] = fx_name
|
||||
if fx_vol != None: params.add(fxdata, [], 'vol', fx_vol, 'float')
|
||||
if fx_pan != None: params.add(fxdata, [], 'pan', fx_pan, 'float')
|
||||
|
||||
def fxrack_param(cvpj_l, fx_num, v_name, v_value, v_type):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['fxrack', str(fx_num)], {})
|
||||
params.add(cvpj_l, ['fxrack',str(fx_num)], v_name, v_value, v_type)
|
||||
|
||||
def fxrack_addsend(cvpj_l, fx_num, fx_to_num, fx_amount, fx_sendautoid):
|
||||
senddata = {"amount": fx_amount, "channel": fx_to_num}
|
||||
if fx_sendautoid != None: senddata['sendautoid'] = fx_sendautoid
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['fxrack', str(fx_num), 'sends'], senddata)
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# -------------------------------------------------------------- Groups --------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def group_add(cvpj_l, i_id, i_inside_group):
|
||||
data_values.nested_dict_add_value(cvpj_l, ['groups', i_id], {})
|
||||
if i_inside_group != None:
|
||||
print('[tracks] Adding Group: "'+i_id+'" inside "'+i_inside_group+'"')
|
||||
data_values.nested_dict_add_value(cvpj_l, ['groups', i_id, 'parent_group'], i_inside_group)
|
||||
data_values.nested_dict_add_value(cvpj_l, ['groups', i_id, 'audio_destination'], {'type': 'group', 'id': i_inside_group})
|
||||
else:
|
||||
print('[tracks] Adding Group: "'+i_id+'"')
|
||||
data_values.nested_dict_add_value(cvpj_l, ['groups', i_id, 'audio_destination'], {'type': 'master'})
|
||||
|
||||
def group_basicdata(cvpj_l, i_id, i_name, i_color, i_vol, i_pan):
|
||||
if i_name != None: data_values.nested_dict_add_value(cvpj_l, ['groups', i_id, 'name'], i_name)
|
||||
if i_color != None: data_values.nested_dict_add_value(cvpj_l, ['groups', i_id, 'color'], i_color)
|
||||
if i_vol != None: params.add(cvpj_l, ['groups', i_id], 'vol', i_vol, 'float')
|
||||
if i_pan != None: params.add(cvpj_l, ['groups', i_id], 'pan', i_pan, 'float')
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------- Sends --------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def get_sendcvpjlocation(sendloc):
|
||||
out_location = None
|
||||
if sendloc[0] == 'master': out_location = ['track_master', 'returns']
|
||||
if sendloc[0] == 'group': out_location = ['groups', sendloc[1], 'returns']
|
||||
return out_location
|
||||
|
||||
def r_add_return(cvpj_l, i_location, i_returnname):
|
||||
out_location = get_sendcvpjlocation(i_location)
|
||||
print('[tracks] Adding Return: "'+i_returnname+'" in '+'/'.join(out_location))
|
||||
data_values.nested_dict_add_value(cvpj_l, out_location+[i_returnname], {})
|
||||
|
||||
def r_add_return_basicdata(cvpj_l, i_location, i_sendname, trk_name, trk_color, trk_vol, trk_pan):
|
||||
out_location = get_sendcvpjlocation(i_location)
|
||||
if trk_name != None: data_values.nested_dict_add_value(cvpj_l, out_location+[i_sendname, 'name'], trk_name)
|
||||
if trk_color != None: data_values.nested_dict_add_value(cvpj_l, out_location+[i_sendname, 'color'], trk_color)
|
||||
if trk_vol != None: params.add(cvpj_l, out_location+[i_sendname], 'vol', trk_vol, 'float')
|
||||
if trk_pan != None: params.add(cvpj_l, out_location+[i_sendname], 'pan', trk_pan, 'float')
|
||||
|
||||
def r_add_send(cvpj_l, i_trackid, 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, ['track_data', i_trackid, 'sends_audio'], send_data)
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------ FX ------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def get_fxcvpjlocation(fxloc):
|
||||
out_location = None
|
||||
if fxloc[0] == 'track': out_location = ['track_data', fxloc[1]]
|
||||
if fxloc[0] == 'instrument': out_location = ['instruments_data', fxloc[1]]
|
||||
if fxloc[0] == 'master': out_location = ['track_master']
|
||||
if fxloc[0] == 'fxrack': out_location = ['fxrack', str(fxloc[1])]
|
||||
if fxloc[0] == 'group': out_location = ['groups', fxloc[1]]
|
||||
if fxloc[0] == 'return':
|
||||
if fxloc[1] == None: out_location = ['track_master', 'returns', fxloc[2]]
|
||||
else: out_location = ['groups', fxloc[1], 'returns', fxloc[2]]
|
||||
return out_location
|
||||
|
||||
def insert_fxslot(cvpj_l, fxloc, fxtype, pluginid):
|
||||
out_location = get_fxcvpjlocation(fxloc)
|
||||
if fxtype == 'audio':
|
||||
data_values.nested_dict_add_to_list(cvpj_l, out_location+['chain_fx_audio'], pluginid)
|
||||
if fxtype == 'notes':
|
||||
data_values.nested_dict_add_to_list(cvpj_l, out_location+['chain_fx_notes'], pluginid)
|
||||
|
||||
#def add_fxslot(cvpj_l, fxloc, fxtype, chain_fx_data):
|
||||
# out_location = get_fxcvpjlocation(fxloc)
|
||||
# if fxtype == 'audio': data_values.nested_dict_add_to_list(cvpj_l, out_location+['chain_fx_audio'], chain_fx_data)
|
||||
# if fxtype == 'notes': data_values.nested_dict_add_to_list(cvpj_l, out_location+['chain_fx_notes'], chain_fx_data)
|
||||
|
||||
#def add_fxslot_basic(cvpj_l, fxloc, fxtype, enabled, wet, auto_plug, auto_slot, pluginname, plugindata):
|
||||
# fxslot_data = {"plugin": pluginname, "plugindata": plugindata}
|
||||
# if auto_plug != None: fxslot_data['pluginautoid'] = auto_plug
|
||||
# if auto_slot != None: fxslot_data['slotautoid'] = auto_slot
|
||||
# if enabled != None: fxslot_data['enabled'] = enabled
|
||||
# if wet != None: fxslot_data['wet'] = wet
|
||||
# add_fxslot(cvpj_l, fxloc, fxtype, fxslot_data)
|
||||
|
||||
#def add_fxslot_native(cvpj_l, fxtype, nativedawname, fxloc, enabled, wet, auto_id, fx_name, fx_data):
|
||||
# plugindata = {}
|
||||
# plugindata['name'] = fx_name
|
||||
# plugindata['data'] = fx_data
|
||||
# add_fxslot_basic(cvpj_l, fxloc, fxtype, enabled, wet, auto_id, auto_id, 'native-'+nativedawname, plugindata)
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------ Auto ------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
# ------------------------ Auto ------------------------
|
||||
|
||||
def a_add_auto_pl(cvpj_l, val_type, autolocation, in_autopoints):
|
||||
if autolocation != None:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['automation']+autolocation+['type'], val_type)
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['automation']+autolocation+['placements'], in_autopoints)
|
||||
|
||||
def a_auto_iter(cvpj_l):
|
||||
outdata = []
|
||||
if 'automation' in cvpj_l:
|
||||
cvpj_auto = cvpj_l['automation']
|
||||
for autotype in cvpj_auto:
|
||||
if autotype in ['main', 'master']:
|
||||
for autovarname in cvpj_auto[autotype]:
|
||||
outdata.append([False, [autotype, autovarname], cvpj_auto[autotype][autovarname]])
|
||||
else:
|
||||
for autonameid in cvpj_auto[autotype]:
|
||||
for autovarname in cvpj_auto[autotype][autonameid]:
|
||||
outdata.append([True, [autotype, autonameid, autovarname], cvpj_auto[autotype][autonameid][autovarname]])
|
||||
return outdata
|
||||
|
||||
def a_move_auto(cvpj_l, old_autolocation, new_autolocation):
|
||||
print('[tracks] Moving Automation:','/'.join(old_autolocation),'to','/'.join(new_autolocation))
|
||||
dictvals = data_values.nested_dict_get_value(cvpj_l, ['automation']+old_autolocation)
|
||||
if dictvals != None:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['automation']+new_autolocation, dictvals)
|
||||
if old_autolocation[0] in ['main', 'master']:
|
||||
del cvpj_l['automation'][old_autolocation[0]][old_autolocation[1]]
|
||||
else:
|
||||
del cvpj_l['automation'][old_autolocation[0]][old_autolocation[1]][old_autolocation[2]]
|
||||
|
||||
def a_del_auto_plugin(cvpj_l, pluginid):
|
||||
print('[tracks] Removing Plugin Automation:',pluginid)
|
||||
dictvals = data_values.nested_dict_get_value(cvpj_l, ['automation', 'plugin', pluginid])
|
||||
if dictvals != None: del cvpj_l['automation', 'plugin', pluginid]
|
||||
|
||||
# ------------------------ NoPl Auto ------------------------
|
||||
|
||||
nopl_autopoints = {}
|
||||
|
||||
def a_auto_nopl_addpoint(in_autoloc, val_type, point_pos, point_val, point_type):
|
||||
global nopl_autopoints
|
||||
pointdata = {"position": point_pos, "value": point_val, "type": point_type}
|
||||
data_values.nested_dict_add_value(nopl_autopoints, in_autoloc+['type'], val_type)
|
||||
data_values.nested_dict_add_to_list(nopl_autopoints, in_autoloc+['points'], pointdata)
|
||||
|
||||
def a_auto_nopl_twopoints(in_autoloc, val_type, twopoints, notelen, point_type):
|
||||
cvpj_points = []
|
||||
for twopoint in twopoints:
|
||||
a_auto_nopl_addpoint(in_autoloc, val_type, twopoint[0]*notelen, twopoint[1], point_type)
|
||||
|
||||
def a_auto_nopl_paramauto(in_autoloc, val_type, input_points, ticks, before_note, fallback, divi, add):
|
||||
out_param, out_twopoints = auto.points2paramauto(input_points, ticks, before_note, fallback, divi, add)
|
||||
if out_twopoints != []: a_auto_nopl_twopoints(in_autoloc, val_type, out_twopoints, 1, 'instant')
|
||||
return out_param
|
||||
|
||||
def a_auto_nopl_to_pl(pointsdata):
|
||||
autopl = {}
|
||||
durpos = auto.getdurpos(pointsdata, 0)
|
||||
autopl['position'] = durpos[0]
|
||||
autopl['duration'] = durpos[1]-durpos[0]+4
|
||||
autopl['points'] = auto.trimmove(pointsdata, durpos[0], durpos[0]+durpos[1])
|
||||
return autopl
|
||||
|
||||
def a_auto_nopl_to_cvpj(cvpj_l):
|
||||
global nopl_autopoints
|
||||
for in_type in nopl_autopoints:
|
||||
if in_type in ['track', 'plugin', 'fxmixer', 'slot', 'send']:
|
||||
for in_id in nopl_autopoints[in_type]:
|
||||
for in_name in nopl_autopoints[in_type][in_id]:
|
||||
s_autodata = nopl_autopoints[in_type][in_id][in_name]
|
||||
data_values.nested_dict_add_value(cvpj_l, ['automation', in_type, in_id, in_name, 'type'], s_autodata['type'])
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['automation', in_type, in_id, in_name, 'placements'], a_auto_nopl_to_pl(s_autodata['points']))
|
||||
else:
|
||||
for in_name in nopl_autopoints[in_type]:
|
||||
s_autodata = nopl_autopoints[in_type][in_name]
|
||||
data_values.nested_dict_add_value(cvpj_l, ['automation', in_type, in_name, 'type'], s_autodata['type'])
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['automation', in_type, in_name, 'placements'], a_auto_nopl_to_pl(s_autodata['points']))
|
||||
|
||||
def a_auto_nopl_getpoints(cvpj_l, in_autoloc):
|
||||
out = None
|
||||
autopoints = data_values.nested_dict_get_value(cvpj_l, ['automation']+in_autoloc)
|
||||
if autopoints != None:
|
||||
if 'placements' in autopoints:
|
||||
spldat = autopoints['placements']
|
||||
if len(spldat) != 0:
|
||||
out = spldat[0]['points']
|
||||
return out
|
||||
|
||||
|
||||
|
||||
# ------------------------ autoid to cvpjauto ------------------------
|
||||
|
||||
autoid_in_data = {}
|
||||
|
||||
def autoid_in_define(i_id, i_loc, i_type, i_addmul):
|
||||
#print('autoid_in_define', i_id, i_loc, i_type, i_addmul)
|
||||
if i_id not in autoid_in_data:
|
||||
autoid_in_data[i_id] = [i_loc, i_type, i_addmul, []]
|
||||
else:
|
||||
autoid_in_data[i_id][0] = i_loc
|
||||
autoid_in_data[i_id][1] = i_type
|
||||
autoid_in_data[i_id][2] = i_addmul
|
||||
|
||||
def autoid_in_add_pl(i_id, i_autopl):
|
||||
#print('autoid_in_add_pl', i_id, len(i_autopl))
|
||||
if i_id not in autoid_in_data: autoid_in_data[i_id] = [None, None, None, []]
|
||||
autoid_in_data[i_id][3].append(i_autopl)
|
||||
|
||||
def autoid_in_output(cvpj_l):
|
||||
for i_id in autoid_in_data:
|
||||
out_auto_loc = autoid_in_data[i_id][0]
|
||||
out_auto_type = autoid_in_data[i_id][1]
|
||||
out_auto_addmul = autoid_in_data[i_id][2]
|
||||
out_auto_data = autoid_in_data[i_id][3]
|
||||
#print(i_id, autoid_in_data[i_id][0:3], out_auto_data)
|
||||
if autoid_in_data[i_id][0:4] != [None, None, None] and out_auto_data != []:
|
||||
if out_auto_addmul != None: out_auto_data = auto.multiply(out_auto_data, out_auto_addmul[0], out_auto_addmul[1])
|
||||
a_add_auto_pl(cvpj_l, out_auto_type, out_auto_loc, out_auto_data)
|
||||
|
||||
# ------------------------ cvpjauto to autoid ------------------------
|
||||
|
||||
autoid_out_num = 340000
|
||||
autoid_out_ids = {}
|
||||
autoid_out_data = {}
|
||||
|
||||
def autoid_out_getlist(i_id):
|
||||
global autoid_out_num
|
||||
global autoid_out_data
|
||||
dictvals = data_values.nested_dict_get_value(autoid_out_ids, i_id)
|
||||
return dictvals
|
||||
|
||||
def autoid_out_get(i_id):
|
||||
global autoid_out_num
|
||||
global autoid_out_data
|
||||
idvalue = data_values.nested_dict_get_value(autoid_out_ids, i_id)
|
||||
|
||||
if idvalue != None and idvalue in autoid_out_data:
|
||||
output = idvalue, autoid_out_data[idvalue]
|
||||
del autoid_out_data[idvalue]
|
||||
return output
|
||||
else: return None, None
|
||||
|
||||
def autoid_out_load(cvpj_l):
|
||||
global autoid_out_num
|
||||
global autoid_out_data
|
||||
|
||||
for autopart in a_auto_iter(cvpj_l):
|
||||
data_values.nested_dict_add_value(autoid_out_ids, autopart[1], autoid_out_num)
|
||||
autoid_out_data[autoid_out_num] = autopart[2]
|
||||
autoid_out_num += 1
|
|
@ -1,7 +1,10 @@
|
|||
# SPDX-FileCopyrightText: 2023 SatyrDiamond
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from functions import tracks
|
||||
from functions import data_values
|
||||
from functions_tracks import tracks_r
|
||||
from functions_tracks import auto_data
|
||||
from functions_tracks import trackfx
|
||||
|
||||
def process_r(cvpj_l):
|
||||
if 'fxrack' in cvpj_l:
|
||||
|
@ -10,17 +13,16 @@ def process_r(cvpj_l):
|
|||
print('[compat] fxrack2trackfx: FX 0 to Master')
|
||||
cvpj_l['track_master'] = cvpj_fxrack['0']
|
||||
|
||||
tracks.a_move_auto(cvpj_l, ['fxmixer','0','vol'], ['master','vol'])
|
||||
tracks.a_move_auto(cvpj_l, ['fxmixer','0','pan'], ['master','pan'])
|
||||
auto_data.move(cvpj_l, ['fxmixer','0','vol'], ['master','vol'])
|
||||
auto_data.move(cvpj_l, ['fxmixer','0','pan'], ['master','pan'])
|
||||
fx_trackids = {}
|
||||
for cvpj_trackid, s_trackdata, track_placements in tracks.r_track_iter(cvpj_l):
|
||||
cvpj_track_fxnum = s_trackdata['fxrack_channel'] if 'fxrack_channel' in s_trackdata else None
|
||||
if cvpj_track_fxnum != None:
|
||||
if cvpj_track_fxnum not in fx_trackids: fx_trackids[cvpj_track_fxnum] = []
|
||||
fx_trackids[cvpj_track_fxnum].append(cvpj_trackid)
|
||||
if 'fxrack_channel' in s_trackdata: del s_trackdata['fxrack_channel']
|
||||
if cvpj_track_fxnum != 0:
|
||||
s_trackdata['group'] = 'fxrack_'+str(cvpj_track_fxnum)
|
||||
for cvpj_trackid, s_trackdata, track_placements in tracks_r.iter(cvpj_l):
|
||||
cvpj_track_fxnum = tracks_r.track_fxrackchan_get(cvpj_l, cvpj_trackid)
|
||||
|
||||
if cvpj_track_fxnum not in fx_trackids: fx_trackids[cvpj_track_fxnum] = []
|
||||
fx_trackids[cvpj_track_fxnum].append(cvpj_trackid)
|
||||
if 'fxrack_channel' in s_trackdata: del s_trackdata['fxrack_channel']
|
||||
if cvpj_track_fxnum != 0: s_trackdata['group'] = 'fxrack_'+str(cvpj_track_fxnum)
|
||||
|
||||
if 0 in fx_trackids: del fx_trackids[0]
|
||||
|
||||
|
@ -28,7 +30,7 @@ def process_r(cvpj_l):
|
|||
cvpj_fxdata = cvpj_fxrack[str(fx_trackid)] if str(fx_trackid) in cvpj_fxrack else {}
|
||||
if 'sends' in cvpj_fxdata: del cvpj_fxdata['sends']
|
||||
groupid = 'fxrack_'+str(fx_trackid)
|
||||
tracks.group_add(cvpj_l, groupid, None)
|
||||
trackfx.group_add(cvpj_l, groupid, None)
|
||||
cvpj_l['groups'][groupid] |= cvpj_fxdata
|
||||
print('[compat] fxrack2trackfx: FX to Tracks '+ ', '.join(fx_trackids[fx_trackid]))
|
||||
return True
|
||||
|
|
|
@ -61,9 +61,8 @@ def smart_merge(global_regions, local_region_count_list):
|
|||
nlb_patnum.append(nlb_exists.index(nlb_notes))
|
||||
|
||||
#used_areas = repeatfind.find(nlb_patnum, False)
|
||||
used_areas_n = repeatfind.find(nlb_patnum, False)
|
||||
used_areas_r = repeatfind.find(nlb_patnum, True)
|
||||
used_areas = data_regions.merge_used_areas(used_areas_n, used_areas_r)
|
||||
used_areas = repeatfind.find(nlb_patnum, False)
|
||||
#used_areas_r = repeatfind.find(nlb_patnum, True)
|
||||
|
||||
for nlb_num in range(nlb_pos, nlb_pos+lregc):
|
||||
used_area = used_areas[nlb_num-nlb_pos]
|
||||
|
|
|
@ -2,8 +2,11 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from functions import params
|
||||
from functions import tracks
|
||||
from functions import data_values
|
||||
from functions_tracks import tracks_r
|
||||
from functions_tracks import auto_data
|
||||
from functions_tracks import fxrack
|
||||
from functions_tracks import fxslot
|
||||
|
||||
def list2fxrack(cvpj_l, input_list, fxnum, defualtname, starttext, dontremoveboth):
|
||||
fx_name = starttext+input_list['name'] if 'name' in input_list else starttext+defualtname
|
||||
|
@ -16,10 +19,10 @@ def list2fxrack(cvpj_l, input_list, fxnum, defualtname, starttext, dontremovebot
|
|||
if dontremoveboth == True:
|
||||
params.remove(input_list, 'pan')
|
||||
|
||||
tracks.fxrack_add(cvpj_l, fxnum, fx_name, fx_color, vol, pan)
|
||||
fxrack.add(cvpj_l, fxnum, vol, pan, name=fx_name, color=fx_color)
|
||||
if 'chain_fx_audio' in input_list:
|
||||
for plugid in input_list['chain_fx_audio']:
|
||||
tracks.insert_fxslot(cvpj_l, ['fxrack', fxnum], 'audio', plugid)
|
||||
fxslot.insert(cvpj_l, ['fxrack', fxnum], 'audio', plugid)
|
||||
del input_list['chain_fx_audio']
|
||||
|
||||
def process_r(cvpj_l):
|
||||
|
@ -84,7 +87,7 @@ def process_r(cvpj_l):
|
|||
if send_data['sendid'] in returnids:
|
||||
sendautoid = None
|
||||
if 'sendautoid' in send_data: sendautoid = send_data['sendautoid']
|
||||
tracks.fxrack_addsend(cvpj_l, fxnum, returnids[send_data['sendid']], send_data['amount'], sendautoid)
|
||||
fxrack.addsend(cvpj_l, fxnum, returnids[send_data['sendid']], send_data['amount'], sendautoid)
|
||||
del s_trkdata['sends_audio']
|
||||
|
||||
track_dest_type = None
|
||||
|
@ -103,7 +106,7 @@ def process_r(cvpj_l):
|
|||
audiopl['fxrack_channel'] = int(fxnum)
|
||||
|
||||
list2fxrack(cvpj_l, s_trkdata, fxnum, trackid, '', False)
|
||||
tracks.r_add_dataval(cvpj_l, trackid, None, 'fxrack_channel', int(fxnum))
|
||||
tracks_r.track_fxrackchan_add(cvpj_l, trackid, int(fxnum))
|
||||
|
||||
fxnum += 1
|
||||
|
||||
|
@ -118,7 +121,7 @@ def process_r(cvpj_l):
|
|||
if slotdata[1][1] in outfxnum['group']:
|
||||
out_fx_send = outfxnum['group'][slotdata[1][1]]
|
||||
|
||||
tracks.fxrack_addsend(cvpj_l, fxslot, out_fx_send[0], out_fx_send[1], None)
|
||||
fxrack.addsend(cvpj_l, fxslot, out_fx_send[0], out_fx_send[1], None)
|
||||
|
||||
print('[trackfx2fxrack] '+str(fxslot).rjust(4),
|
||||
str(slotdata[0][0]).ljust(8),
|
||||
|
@ -128,16 +131,16 @@ def process_r(cvpj_l):
|
|||
out_fx_send)
|
||||
|
||||
if slotdata[0][0] == 'master':
|
||||
tracks.a_move_auto(cvpj_l, ['master','vol'], ['fxmixer',str(fxslot),'vol'])
|
||||
auto_data.move(cvpj_l, ['master','vol'], ['fxmixer',str(fxslot),'vol'])
|
||||
if slotdata[0][0] == 'group':
|
||||
tracks.a_move_auto(cvpj_l, ['group',slotdata[0][1],'vol'], ['fxmixer',str(fxslot),'vol'])
|
||||
tracks.a_move_auto(cvpj_l, ['group',slotdata[0][1],'pan'], ['fxmixer',str(fxslot),'pan'])
|
||||
auto_data.move(cvpj_l, ['group',slotdata[0][1],'vol'], ['fxmixer',str(fxslot),'vol'])
|
||||
auto_data.move(cvpj_l, ['group',slotdata[0][1],'pan'], ['fxmixer',str(fxslot),'pan'])
|
||||
if slotdata[0][0] == 'return':
|
||||
tracks.a_move_auto(cvpj_l, ['return',slotdata[0][1],'vol'], ['fxmixer',str(fxslot),'vol'])
|
||||
tracks.a_move_auto(cvpj_l, ['return',slotdata[0][1],'pan'], ['fxmixer',str(fxslot),'pan'])
|
||||
auto_data.move(cvpj_l, ['return',slotdata[0][1],'vol'], ['fxmixer',str(fxslot),'vol'])
|
||||
auto_data.move(cvpj_l, ['return',slotdata[0][1],'pan'], ['fxmixer',str(fxslot),'pan'])
|
||||
if slotdata[0][0] == 'track':
|
||||
tracks.a_move_auto(cvpj_l, ['track',slotdata[0][1],'vol'], ['fxmixer',str(fxslot),'vol'])
|
||||
tracks.a_move_auto(cvpj_l, ['track',slotdata[0][1],'pan'], ['fxmixer',str(fxslot),'pan'])
|
||||
auto_data.move(cvpj_l, ['track',slotdata[0][1],'vol'], ['fxmixer',str(fxslot),'vol'])
|
||||
auto_data.move(cvpj_l, ['track',slotdata[0][1],'pan'], ['fxmixer',str(fxslot),'pan'])
|
||||
|
||||
return True
|
||||
else: return False
|
||||
|
@ -153,7 +156,7 @@ def process_m(cvpj_l):
|
|||
if 'track_master' in cvpj_l:
|
||||
print('[trackfx2fxrack] Master to FX 0')
|
||||
cvpj_l['fxrack']['0'] = cvpj_l['track_master']
|
||||
tracks.a_move_auto(cvpj_l, ['master','vol'], ['fxmixer','0','vol'])
|
||||
auto_data.move(cvpj_l, ['master','vol'], ['fxmixer','0','vol'])
|
||||
|
||||
for trackid in c_orderingdata:
|
||||
trackdata = c_trackdata[trackid]
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from functions import data_values
|
||||
from functions import tracks
|
||||
from functions_tracks import tracks_r
|
||||
|
||||
def process_r(cvpj_l):
|
||||
new_trackdata = {}
|
||||
new_trackpl = {}
|
||||
new_trackordering = []
|
||||
for cvpj_trackid, s_trackdata, track_placements in tracks.r_track_iter(cvpj_l):
|
||||
for cvpj_trackid, s_trackdata, track_placements in tracks_r.iter(cvpj_l):
|
||||
tracktype = s_trackdata['type']
|
||||
trackauto = data_values.nested_dict_get_value(cvpj_l, ['automation', 'track', cvpj_trackid])
|
||||
if trackauto != None: del cvpj_l['automation']['track'][cvpj_trackid]
|
||||
|
|
|
@ -11,7 +11,8 @@ from functions import xtramath
|
|||
# ------------- Functions -------------
|
||||
|
||||
def utf16encode(text):
|
||||
return text.encode('utf-16le') + b'\x00\x00'
|
||||
out_text = text if text != None else ''
|
||||
return out_text.encode('utf-16le') + b'\x00\x00'
|
||||
|
||||
def calctempotimed(i_value):
|
||||
i_out = i_value*125
|
||||
|
|
|
@ -8,10 +8,13 @@ from functions import idvals
|
|||
from functions import midi_exdata
|
||||
from functions import params
|
||||
from functions import plugins
|
||||
from functions import tracks
|
||||
from functions import song
|
||||
from functions import colors
|
||||
from functions import auto
|
||||
from functions_tracks import tracks_rm
|
||||
from functions_tracks import fxrack
|
||||
from functions_tracks import fxslot
|
||||
from functions_tracks import auto_nopl
|
||||
|
||||
import chardet
|
||||
|
||||
|
@ -258,8 +261,9 @@ def song_end(cvpj_l):
|
|||
trackname = None
|
||||
if numtracks == 1: song.add_info(cvpj_l, 'title', global_miditrack[1])
|
||||
else: trackname = global_miditrack[1]
|
||||
tracks.c_create_track(cvpj_l, 'instruments', cvpj_trackid, name=trackname, color=track_color)
|
||||
tracks.c_pl_notes(cvpj_l, cvpj_trackid, placementdata)
|
||||
tracks_rm.track_create(cvpj_l, cvpj_trackid, 'instruments')
|
||||
tracks_rm.track_visual(cvpj_l, cvpj_trackid, name=trackname, color=track_color)
|
||||
tracks_rm.add_pl(cvpj_l, cvpj_trackid, 'notes', placementdata)
|
||||
tracknum += 1
|
||||
|
||||
for instnum in range(len(used_insts)):
|
||||
|
@ -282,9 +286,10 @@ def song_end(cvpj_l):
|
|||
if used_inst[3] == 0: plugins.add_plug_gm_midi(cvpj_l, instid, used_inst[2], used_inst[1])
|
||||
else: plugins.add_plug_gm_midi(cvpj_l, instid, 128, 1)
|
||||
|
||||
tracks.c_inst_create(cvpj_l, instid, name=instname, color=instcolor)
|
||||
tracks.c_inst_add_dataval(cvpj_l, instid, None, 'fxrack_channel', int(used_inst[0]+1))
|
||||
tracks.c_inst_pluginid(cvpj_l, instid, instid)
|
||||
tracks_rm.inst_create(cvpj_l, instid)
|
||||
tracks_rm.inst_visual(cvpj_l, instid, name=instname, color=instcolor)
|
||||
tracks_rm.inst_fxrackchan_add(cvpj_l, instid, int(used_inst[0]+1))
|
||||
tracks_rm.inst_pluginid(cvpj_l, instid, instid)
|
||||
|
||||
for fxnum in range(song_channels):
|
||||
s_fx_usedinstid = fx_usedinstid[fxnum]
|
||||
|
@ -356,14 +361,14 @@ def song_end(cvpj_l):
|
|||
if fx_name != None: fxchannames[fxnum] = fx_name
|
||||
if fx_color != None: fxchancolors[fxnum] = fx_color
|
||||
|
||||
tracks.fxrack_add(cvpj_l, 0, "Master", [0.3, 0.3, 0.3], 1.0, None)
|
||||
fxrack.add(cvpj_l, 0, 1.0, None, name="Master", color=[0.3, 0.3, 0.3])
|
||||
|
||||
usedeffects = [False,False]
|
||||
|
||||
for midi_channum in range(song_channels):
|
||||
s_chanauto = automation_channel[midi_channum]
|
||||
fxrack_chan = str(midi_channum+1)
|
||||
tracks.fxrack_add(cvpj_l, fxrack_chan, fxchannames[midi_channum], fxchancolors[midi_channum], None, None)
|
||||
fxrack.add(cvpj_l, fxrack_chan, None, None, name=fxchannames[midi_channum], color=fxchancolors[midi_channum])
|
||||
|
||||
for ccnum, name, defval, valdiv, valadd in [
|
||||
[ 1 ,'modulation', 1, 127, 0],
|
||||
|
@ -373,53 +378,53 @@ def song_end(cvpj_l):
|
|||
['pitch','pitch', 0, 1, 0],
|
||||
]:
|
||||
if ccnum in s_chanauto:
|
||||
out_param = tracks.a_auto_nopl_paramauto(
|
||||
out_param = auto_nopl.paramauto(
|
||||
['fxmixer', fxrack_chan, name], 'float', s_chanauto[ccnum], ppq_step, firstchanusepos[midi_channum], defval, valdiv, valadd)
|
||||
tracks.fxrack_param(cvpj_l, midi_channum+1, name, out_param, 'float')
|
||||
fxrack.param_add(cvpj_l, midi_channum+1, name, out_param, 'float')
|
||||
|
||||
for ccnum, fx2, fx1, fxname in [[91,0,0,'reverb'],[93,0,1,'chorus'],[92,1,0,'tremolo'],[95,1,1,'phaser']]:
|
||||
if ccnum in s_chanauto:
|
||||
sendname = str(midi_channum)+fxname
|
||||
usedeffects[fx2] = True
|
||||
sendtofx = song_channels+1+fx1+(fx2*2)
|
||||
out_param = tracks.a_auto_nopl_paramauto(['send', sendname, 'amount'], 'float', s_chanauto[ccnum], ppq_step, firstchanusepos[midi_channum], 0, 127, 0)
|
||||
tracks.fxrack_addsend(cvpj_l, midi_channum+1, 0, 1, None)
|
||||
tracks.fxrack_addsend(cvpj_l, midi_channum+1, sendtofx, out_param, sendname)
|
||||
out_param = auto_nopl.paramauto(['send', sendname, 'amount'], 'float', s_chanauto[ccnum], ppq_step, firstchanusepos[midi_channum], 0, 127, 0)
|
||||
fxrack.addsend(cvpj_l, midi_channum+1, 0, 1, None)
|
||||
fxrack.addsend(cvpj_l, midi_channum+1, sendtofx, out_param, sendname)
|
||||
|
||||
if usedeffects[0] == True:
|
||||
plugins.add_plug(cvpj_l, 'plugin-reverb', 'simple', 'reverb-send')
|
||||
plugins.add_plug(cvpj_l, 'plugin-chorus', 'simple', 'chorus-send')
|
||||
plugins.add_plug_fxvisual(cvpj_l, 'plugin-reverb', 'Reverb', None)
|
||||
plugins.add_plug_fxvisual(cvpj_l, 'plugin-chorus', 'Chorus', None)
|
||||
tracks.fxrack_add(cvpj_l, song_channels+1, "[S] Reverb", [0.4, 0.4, 0.4], 1.0, None)
|
||||
tracks.fxrack_add(cvpj_l, song_channels+2, "[S] Chorus", [0.4, 0.4, 0.4], 1.0, None)
|
||||
tracks.insert_fxslot(cvpj_l, ['fxrack', song_channels+1], 'audio', 'plugin-reverb')
|
||||
tracks.insert_fxslot(cvpj_l, ['fxrack', song_channels+2], 'audio', 'plugin-chorus')
|
||||
tracks.fxrack_addsend(cvpj_l, song_channels+1, 0, 1, None)
|
||||
tracks.fxrack_addsend(cvpj_l, song_channels+2, 0, 1, None)
|
||||
fxrack.add(cvpj_l, song_channels+1, 1.0, None, name="[S] Reverb", color=[0.4, 0.4, 0.4])
|
||||
fxrack.add(cvpj_l, song_channels+2, 1.0, None, name="[S] Chorus", color=[0.4, 0.4, 0.4])
|
||||
fxslot.insert(cvpj_l, ['fxrack', song_channels+1], 'audio', 'plugin-reverb')
|
||||
fxslot.insert(cvpj_l, ['fxrack', song_channels+2], 'audio', 'plugin-chorus')
|
||||
fxrack.addsend(cvpj_l, song_channels+1, 0, 1, None)
|
||||
fxrack.addsend(cvpj_l, song_channels+2, 0, 1, None)
|
||||
|
||||
if usedeffects[1] == True:
|
||||
plugins.add_plug(cvpj_l, 'plugin-tremelo', 'simple', 'tremelo-send')
|
||||
plugins.add_plug(cvpj_l, 'plugin-phaser', 'simple', 'phaser-send')
|
||||
plugins.add_plug_fxvisual(cvpj_l, 'plugin-tremelo', 'Tremelo', None)
|
||||
plugins.add_plug_fxvisual(cvpj_l, 'plugin-phaser', 'Phaser', None)
|
||||
tracks.fxrack_add(cvpj_l, song_channels+3, "[S] Tremelo", [0.4, 0.4, 0.4], 1.0, None)
|
||||
tracks.fxrack_add(cvpj_l, song_channels+4, "[S] Phaser", [0.4, 0.4, 0.4], 1.0, None)
|
||||
tracks.insert_fxslot(cvpj_l, ['fxrack', song_channels+3], 'audio', 'plugin-tremelo')
|
||||
tracks.insert_fxslot(cvpj_l, ['fxrack', song_channels+4], 'audio', 'plugin-phaser')
|
||||
tracks.fxrack_addsend(cvpj_l, song_channels+3, 0, 1, None)
|
||||
tracks.fxrack_addsend(cvpj_l, song_channels+4, 0, 1, None)
|
||||
fxrack.add(cvpj_l, song_channels+3, 1.0, None, name="[S] Tremelo", color=[0.4, 0.4, 0.4])
|
||||
fxrack.add(cvpj_l, song_channels+4, 1.0, None, name="[S] Phaser", color=[0.4, 0.4, 0.4])
|
||||
fxslot.insert(cvpj_l, ['fxrack', song_channels+3], 'audio', 'plugin-tremelo')
|
||||
fxslot.insert(cvpj_l, ['fxrack', song_channels+4], 'audio', 'plugin-phaser')
|
||||
fxrack.addsend(cvpj_l, song_channels+3, 0, 1, None)
|
||||
fxrack.addsend(cvpj_l, song_channels+4, 0, 1, None)
|
||||
|
||||
veryfirstnotepos = getbeforenoteall(firstchanusepos)
|
||||
|
||||
#tempo
|
||||
out_param = tracks.a_auto_nopl_paramauto(['main', 'bpm'], 'float', auto_bpm, ppq_step, veryfirstnotepos, 120, 1, 0)
|
||||
out_param = auto_nopl.paramauto(['main', 'bpm'], 'float', auto_bpm, ppq_step, veryfirstnotepos, 120, 1, 0)
|
||||
params.add(cvpj_l, [], 'bpm', out_param, 'float')
|
||||
|
||||
#volume
|
||||
if 'volume' in auto_master:
|
||||
out_param = tracks.a_auto_nopl_paramauto(['fxmixer', '0', 'vol'], 'float', auto_master['volume'], ppq_step, veryfirstnotepos, 127, 1, 0)
|
||||
tracks.fxrack_param(cvpj_l, 0, 'vol', out_param, 'float')
|
||||
out_param = auto_nopl.paramauto(['fxmixer', '0', 'vol'], 'float', auto_master['volume'], ppq_step, veryfirstnotepos, 127, 1, 0)
|
||||
fxrack.param_add(cvpj_l, 0, 'vol', out_param, 'float')
|
||||
|
||||
#timesig
|
||||
for timesigpoint in auto_timesig:
|
||||
|
@ -432,6 +437,6 @@ def song_end(cvpj_l):
|
|||
if loop_data[1] != None: song.add_timemarker_looparea(cvpj_l, 'Loop', loop_data[0], loop_data[1])
|
||||
elif loop_data[0] != None: song.add_timemarker_loop(cvpj_l, loop_data[0], 'Loop')
|
||||
|
||||
tracks.a_auto_nopl_to_cvpj(cvpj_l)
|
||||
auto_nopl.to_cvpj(cvpj_l)
|
||||
|
||||
return used_insts
|
|
@ -21,14 +21,10 @@ def tripleoct(x, shape, pw, one, two):
|
|||
|
||||
def create_wave(shape, mul, pw):
|
||||
vital_osc_shape = []
|
||||
if shape == 'sine':
|
||||
for num in range(2048): vital_osc_shape.append(wave_sine(num/2048))
|
||||
if shape == 'saw':
|
||||
for num in range(2048): vital_osc_shape.append(wave_saw(num/2048))
|
||||
if shape == 'triangle':
|
||||
for num in range(2048): vital_osc_shape.append(wave_tri(num/2048))
|
||||
if shape == 'square':
|
||||
for num in range(2048): vital_osc_shape.append(wave_squ(num/2048, pw))
|
||||
if shape == 'sine': vital_osc_shape = [wave_sine(num/2048) for num in range(2048)]
|
||||
if shape == 'saw': vital_osc_shape = [wave_saw(num/2048) for num in range(2048)]
|
||||
if shape == 'triangle': vital_osc_shape = [wave_tri(num/2048) for num in range(2048)]
|
||||
if shape == 'square': vital_osc_shape = [wave_squ(num/2048) for num in range(2048)]
|
||||
if shape == 'square_roundend':
|
||||
for num in range(2048):
|
||||
if num <= 1024: vital_osc_shape.append((wave_sine(num/4096)*-1))
|
||||
|
@ -37,7 +33,6 @@ def create_wave(shape, mul, pw):
|
|||
for num in range(2048):
|
||||
if num <= 1024: vital_osc_shape.append(num/1024)
|
||||
else: vital_osc_shape.append(wave_tri((num+1024)/2048)**3)
|
||||
if shape == 'exp':
|
||||
for num in range(2048): vital_osc_shape.append(wave_tri((num+1024)/2048)**3)
|
||||
if shape == 'exp': vital_osc_shape = [wave_tri((num+1024)/2048)**3 for num in range(2048)]
|
||||
return vital_osc_shape
|
||||
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
|
||||
import json
|
||||
|
||||
from functions import tracks
|
||||
from functions_tracks import tracks_mi
|
||||
|
||||
m2mi_sample_names = ['file', 'name', 'color', 'audiomod', 'vol', 'pan', 'fxrack_channel']
|
||||
m2mi_notes_names = ['id', 'notelist', 'name', 'color']
|
||||
|
||||
def convert(song):
|
||||
print('[song-convert] Converting from Multiple > MultipleIndexed')
|
||||
cvpj_proj = json.loads(song)
|
||||
cvpj_playlist = cvpj_proj['playlist']
|
||||
cvpj_l = json.loads(song)
|
||||
cvpj_playlist = cvpj_l['playlist']
|
||||
|
||||
pattern_number = 1
|
||||
existingpatterns = []
|
||||
|
@ -41,8 +41,8 @@ def convert(song):
|
|||
cvpj_placement['fromindex'] = dupepatternfound
|
||||
|
||||
for existingpattern in existingpatterns:
|
||||
tracks.m_add_nle(cvpj_proj, existingpattern[0], existingpattern[1][0])
|
||||
tracks.m_add_nle_info(cvpj_proj, existingpattern[0], existingpattern[1][1], existingpattern[1][2])
|
||||
tracks_mi.notelistindex_add(cvpj_l, existingpattern[0], existingpattern[1][0])
|
||||
tracks_mi.notelistindex_visual(cvpj_l, existingpattern[0], name=existingpattern[1][1], color=existingpattern[1][2])
|
||||
|
||||
sample_number = 1
|
||||
cvpj_sampleindex = {}
|
||||
|
@ -76,8 +76,8 @@ def convert(song):
|
|||
cvpj_sampleindex['m2mi_audio_' + str(sample_number)] = cvpj_sampledata
|
||||
sample_number += 1
|
||||
|
||||
if 'notelistindex' not in cvpj_proj: cvpj_proj['notelistindex'] = {}
|
||||
if 'notelistindex' not in cvpj_l: cvpj_l['notelistindex'] = {}
|
||||
|
||||
cvpj_proj['sampleindex'] = cvpj_sampleindex
|
||||
cvpj_l['sampleindex'] = cvpj_sampleindex
|
||||
|
||||
return json.dumps(cvpj_proj)
|
||||
return json.dumps(cvpj_l)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from functions import data_values
|
||||
from functions import tracks
|
||||
from functions import xtramath
|
||||
|
||||
import json
|
||||
|
|
40
functions_tracks/auto_data.py
Normal file
40
functions_tracks/auto_data.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
# SPDX-FileCopyrightText: 2023 SatyrDiamond
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from functions import data_values
|
||||
from functions import auto
|
||||
from functions import params
|
||||
|
||||
def add_pl(cvpj_l, val_type, autolocation, in_autopoints):
|
||||
if autolocation != None:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['automation']+autolocation+['type'], val_type)
|
||||
data_values.nested_dict_add_to_list(cvpj_l, ['automation']+autolocation+['placements'], in_autopoints)
|
||||
|
||||
def iter(cvpj_l):
|
||||
outdata = []
|
||||
if 'automation' in cvpj_l:
|
||||
cvpj_auto = cvpj_l['automation']
|
||||
for autotype in cvpj_auto:
|
||||
if autotype in ['main', 'master']:
|
||||
for autovarname in cvpj_auto[autotype]:
|
||||
outdata.append([False, [autotype, autovarname], cvpj_auto[autotype][autovarname]])
|
||||
else:
|
||||
for autonameid in cvpj_auto[autotype]:
|
||||
for autovarname in cvpj_auto[autotype][autonameid]:
|
||||
outdata.append([True, [autotype, autonameid, autovarname], cvpj_auto[autotype][autonameid][autovarname]])
|
||||
return outdata
|
||||
|
||||
def move(cvpj_l, old_autolocation, new_autolocation):
|
||||
print('[tracks] Moving Automation:','/'.join(old_autolocation),'to','/'.join(new_autolocation))
|
||||
dictvals = data_values.nested_dict_get_value(cvpj_l, ['automation']+old_autolocation)
|
||||
if dictvals != None:
|
||||
data_values.nested_dict_add_value(cvpj_l, ['automation']+new_autolocation, dictvals)
|
||||
if old_autolocation[0] in ['main', 'master']:
|
||||
del cvpj_l['automation'][old_autolocation[0]][old_autolocation[1]]
|
||||
else:
|
||||
del cvpj_l['automation'][old_autolocation[0]][old_autolocation[1]][old_autolocation[2]]
|
||||
|
||||
def del_plugin(cvpj_l, pluginid):
|
||||
print('[tracks] Removing Plugin Automation:',pluginid)
|
||||
dictvals = data_values.nested_dict_get_value(cvpj_l, ['automation', 'plugin', pluginid])
|
||||
if dictvals != None: del cvpj_l['automation', 'plugin', pluginid]
|
67
functions_tracks/auto_id.py
Normal file
67
functions_tracks/auto_id.py
Normal file
|
@ -0,0 +1,67 @@
|
|||