This commit is contained in:
SatyrDiamond 2023-07-08 20:57:36 -04:00
parent 19474a28e0
commit 3b8c704335
8 changed files with 168 additions and 109 deletions

View file

@ -18,7 +18,6 @@ db_plugins = sqlite3.connect('./__config/plugins_external.db')
db_plugins.execute('''
CREATE TABLE IF NOT EXISTS vst2(
name text,
internal_name text,
id text,
type text,
creator text,
@ -27,6 +26,7 @@ db_plugins.execute('''
audio_num_outputs integer,
midi_num_inputs integer,
midi_num_outputs integer,
num_params integer,
path_32bit_win text,
path_64bit_win text,
path_32bit_unix text,
@ -48,6 +48,7 @@ db_plugins.execute('''
audio_num_outputs integer,
midi_num_inputs integer,
midi_num_outputs integer,
num_params integer,
path_32bit_win text,
path_64bit_win text,
path_32bit_unix text,
@ -62,23 +63,12 @@ db_plugins.execute('''
version text,
audio_num_inputs integer,
audio_num_outputs integer,
num_params integer,
path_win text,
path_unix text,
UNIQUE(name)
)''')
db_plugins.execute('''
CREATE TABLE IF NOT EXISTS lv2(
name text,
id text,
creator text,
path_win_dir text,
path_win_bin text,
path_unix_dir text,
path_unix_bin text,
UNIQUE(id)
)''')
homepath = os.path.expanduser("~")
if platformtxt == 'win':
@ -99,7 +89,7 @@ elif len(dawlist) == 0:
# ------------------------------------- Ardour -------------------------------------
if 'ardour' in dawlist:
print('[dawvert-vst] Importing VST List from: Ardour')
print('[dawvert-vst] Importing Plugin List from: Ardour')
vstcachelist = os.listdir(l_path_aurdor)
for vstcache in vstcachelist:
vstxmlfile = vstcache
@ -156,7 +146,7 @@ if 'ardour' in dawlist:
# ------------------------------------- Waveform -------------------------------------
if 'waveform' in dawlist:
print('[dawvert-vst] Importing VST List from: Waveform')
print('[dawvert-vst] Importing Plugin List from: Waveform')
plugfilename = os.path.join(l_path_waveform, 'knownPluginList64.settings')
if exists(plugfilename):
vstxmldata = ET.parse(plugfilename)
@ -176,7 +166,6 @@ if 'waveform' in dawlist:
db_plugins.execute("INSERT OR IGNORE INTO vst2 (id) VALUES (?)", (plugdata_fourid,))
if vst_name != None: db_plugins.execute("UPDATE vst2 SET name = ? WHERE id = ?", (vst_name, plugdata_fourid,))
else: db_plugins.execute("UPDATE vst2 SET name = ? WHERE id = ?", (pluginfo.get('name'), plugdata_fourid,))
db_plugins.execute("UPDATE vst2 SET internal_name = ? WHERE id = ?", (pluginfo.get('name'), plugdata_fourid,))
if platformtxt == 'win':
db_plugins.execute("UPDATE vst3 SET path_64bit_win = ? WHERE id = ?", (pluginfo.get('file'), plugdata_fourid,))
if platformtxt == 'lin':

View file

@ -10,23 +10,23 @@ os.makedirs(os.getcwd() + '/__config/', exist_ok=True)
db_plugins = sqlite3.connect('./__config/plugins_external.db')
db_plugins.execute('''
CREATE TABLE IF NOT EXISTS vst2(
name text,
internal_name text,
id text,
type text,
creator text,
version text,
audio_num_inputs integer,
audio_num_outputs integer,
midi_num_inputs integer,
midi_num_outputs integer,
path_32bit_win text,
path_64bit_win text,
path_32bit_unix text,
path_64bit_unix text,
UNIQUE(id)
)''')
CREATE TABLE IF NOT EXISTS vst2(
name text,
id text,
type text,
creator text,
version text,
audio_num_inputs integer,
audio_num_outputs integer,
midi_num_inputs integer,
midi_num_outputs integer,
num_params integer,
path_32bit_win text,
path_64bit_win text,
path_32bit_unix text,
path_64bit_unix text,
UNIQUE(id)
)''')
db_plugins.execute('''
CREATE TABLE IF NOT EXISTS vst3(
@ -42,12 +42,13 @@ db_plugins.execute('''
audio_num_outputs integer,
midi_num_inputs integer,
midi_num_outputs integer,
path_32bit_win text,
path_64bit_win text,
path_32bit_unix text,
path_64bit_unix text,
UNIQUE(id)
)''')
num_params integer,
path_32bit_win text,
path_64bit_win text,
path_32bit_unix text,
path_64bit_unix text,
UNIQUE(id)
)''')
db_plugins.execute('''
CREATE TABLE IF NOT EXISTS clap(
@ -120,7 +121,7 @@ if len(dawlist) == 0:
# ------------------------------------- CakeWalk -------------------------------------
if 'cakewalk' in dawlist:
print('[dawvert-vst] Importing VST List from: Cakewalk')
print('[dawvert-vst] Importing Plugin List from: Cakewalk')
vstlist = reg_list(w_regkey_cakewalk)
for vstplugin in vstlist:
registry_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, vstplugin, 0, winreg.KEY_READ)
@ -163,7 +164,7 @@ if 'cakewalk' in dawlist:
# ------------------------------------- CakeWalk -------------------------------------
if 'flstudio' in dawlist:
print('[dawvert-vst] Importing VST List from: FL Studio')
print('[dawvert-vst] Importing Plugin List from: FL Studio')
for pathtype in [ ['vst2',path_flstudio_vst2_inst],['vst2',path_flstudio_vst2_fx],['vst3',path_flstudio_vst3_inst],['vst3',path_flstudio_vst3_fx] ]:
for filename in os.listdir(pathtype[1]):
if '.nfo' in filename:
@ -200,7 +201,7 @@ if 'flstudio' in dawlist:
# ------------------------------------- CakeWalk -------------------------------------
if 'bidule' in dawlist:
print('[dawvert-vst] Importing VST List from: Plogue Bidule')
print('[dawvert-vst] Importing Plugin List from: Plogue Bidule')
if os.path.exists(path_ploguebidule_vst2_64) == True:
bio_data = open(path_ploguebidule_vst2_64, "r")

View file

@ -11,8 +11,6 @@ import platform
import os
import sqlite3
glo_vstpaths = {}
cpu_arch_list = [64, 32]
platform_architecture = platform.architecture()
@ -110,5 +108,3 @@ def replace_data(cvpj_l, pluginid, platform, in_name, datatype, data, numparams)
plugins.add_plug_data(cvpj_l, pluginid, 'numparams', numparams)
else:
print('[plugin-vst2] Plugin, '+in_name+' not found.')
def vstpaths(): return glo_vstpaths

View file

@ -453,7 +453,7 @@ def getparams(cvpj_l, pluginid, pluginname, chunkdata, foldername):
filename = os.path.join(foldername, pluginid+'_custom_audio.wav')
with open(filename, "wb") as customconvolverfile:
customconvolverfile.write(fl_plugstr.read(audiosize))
plugins.add_plug_data(cvpj_l, pluginid, 'file', filename)
plugins.add_plug_data(cvpj_l, pluginid, 'file', filename.decode())
fl_plugstr.read(36)
autodata = {}
for autoname in ['pan', 'vol', 'stereo', 'allpurpose', 'eq']:
@ -509,12 +509,12 @@ def getparams(cvpj_l, pluginid, pluginname, chunkdata, foldername):
plugins.add_plug_param(cvpj_l, pluginid, 'center', flplugvals[6], 'bool', 'Center')
elif pluginname == 'fruity free filter':
flplugvals = struct.unpack('IIIIIb', chunkdata)
plugins.add_plug_param(cvpj_l, pluginid, 'type', flplugvals[1], 'int', 'Type')
plugins.add_plug_param(cvpj_l, pluginid, 'freq', flplugvals[2], 'int', 'Frequency')
plugins.add_plug_param(cvpj_l, pluginid, 'lowpass', flplugvals[3], 'int', 'Q')
plugins.add_plug_param(cvpj_l, pluginid, 'gain', flplugvals[4], 'int', 'Gain')
plugins.add_plug_param(cvpj_l, pluginid, 'center', flplugvals[5], 'bool', 'Center')
flplugvals = struct.unpack('IIIII', chunkdata)
plugins.add_plug_param(cvpj_l, pluginid, 'type', flplugvals[0], 'int', 'Type')
plugins.add_plug_param(cvpj_l, pluginid, 'freq', flplugvals[1], 'int', 'Frequency')
plugins.add_plug_param(cvpj_l, pluginid, 'lowpass', flplugvals[2], 'int', 'Q')
plugins.add_plug_param(cvpj_l, pluginid, 'gain', flplugvals[3], 'int', 'Gain')
plugins.add_plug_param(cvpj_l, pluginid, 'center', flplugvals[4], 'bool', 'Center')
elif pluginname == 'fruity html notebook':
version = int.from_bytes(fl_plugstr.read(4), "little")

View file

@ -39,6 +39,48 @@ def getsamplefile(channeldata, flppath):
return ''
def parse_envlfo(envlfo, pluginid, envtype):
bio_envlfo = data_bytes.to_bytesio(envlfo)
envlfo_flags = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_enabled = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_predelay = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_attack = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_hold = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_decay = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_sustain = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_release = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_aomunt = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_lfo_predelay = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_lfo_attack = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_lfo_amount = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_lfo_speed = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_lfo_shape = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_attack_tension = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_decay_tension = int.from_bytes(bio_envlfo.read(4), "little")
envlfo_envelope_release_tension = int.from_bytes(bio_envlfo.read(4), "little")
#print(envlfo, pluginid, envtype)
#print( envlfo_envelope_hold )
#print( envlfo_envelope_release )
# 15087 = 0.25
# 20643 = 0.5
# 26664 = 1
# 32950 = 2
# 39376 = 4
#print( pow(2, envlfo_envelope_hold/32950) )
#exit()
class input_flp(plugin_input.base):
def __init__(self): pass
def is_dawvert_plugin(self): return 'input'
@ -140,6 +182,8 @@ class input_flp(plugin_input.base):
if 'pluginparams' in channeldata:
flp_dec_pluginparams.getparams(cvpj_l, pluginid, flpluginname, channeldata['pluginparams'], samplefolder)
#parse_envlfo(channeldata['envlfo_vol'], pluginid, 'vol')
cvpj_inst['poly'] = {}
cvpj_inst['poly']['max'] = channeldata['polymax']

View file

@ -485,8 +485,16 @@ class input_cvpj_r(plugin_input.base):
for slotnum in CausticFXData:
if CausticFXData[slotnum] != {}:
slot_fxslotdata = CausticFXData[slotnum]['controls']
tracks.add_fxslot_native(cvpj_l, 'audio', 'caustic', ['master'], not int(slot_fxslotdata[5]), None,
'master_slot'+str(slotnum), caustic_fxtype[CausticFXData[slotnum]['type']], slot_fxslotdata)
masterslotplugid = 'master_slot'+str(slotnum)
plugins.add_plug(cvpj_l, masterslotplugid, 'native-caustic', caustic_fxtype[CausticFXData[slotnum]['type']])
plugins.add_plug_fxdata(cvpj_l, masterslotplugid, not int(slot_fxslotdata[5]), None)
tracks.insert_fxslot(cvpj_l, ['master'], 'audio', masterslotplugid)
for paramid in slot_fxslotdata:
plugins.add_plug_param(cvpj_l, masterslotplugid, paramid, slot_fxslotdata[paramid], 'float', str(paramid))
for fxids in [
['master_delay', 'delay', 'Delay', [0.64, 0.78, 0.87]],
@ -498,7 +506,7 @@ class input_cvpj_r(plugin_input.base):
plugins.add_plug_fxdata(cvpj_l, fxids[0], True, master_params[fxids[1]]['wet'])
tracks.insert_fxslot(cvpj_l, ['return', None, fxids[0]], 'audio', fxids[0])
for paramid in master_params[fxids[1]]:
plugins.add_plug_param(cvpj_l, fxids[0], paramid, master_params[fxids[1]][paramid], 'float', paramid)
plugins.add_plug_param(cvpj_l, fxids[0], paramid, master_params[fxids[1]][paramid], 'float', str(paramid))
for fxids in [['master_eq', 'eq'], ['master_limiter', 'limiter']]:
@ -506,7 +514,7 @@ class input_cvpj_r(plugin_input.base):
plugins.add_plug_fxdata(cvpj_l, fxids[0], not int(master_params[fxids[1]]['muted']), 1)
tracks.insert_fxslot(cvpj_l, ['master'], 'audio', fxids[0])
for paramid in master_params[fxids[1]]:
plugins.add_plug_param(cvpj_l, fxids[0], paramid, master_params[fxids[1]][paramid], 'float', paramid)
plugins.add_plug_param(cvpj_l, fxids[0], paramid, master_params[fxids[1]][paramid], 'float', str(paramid))
#print(AUTO_data)

View file

@ -753,10 +753,8 @@ def lmms_encode_effectslot(pluginid, fxcX):
pluginautoid = tracks.autoid_out_getlist(['slot', pluginid])
fxdata = plugins.get_plug_fxdata(cvpj_l, pluginid)
#add_auto_placements(1, None, ['slot', pluginid], 'enabled', json_plugin, 'enabled', fxslotX, 'on', 'Slot', 'On')
#add_auto_placements(1, None, ['slot', pluginid], 'wet', json_plugin, 'wet', fxslotX, 'wet', 'Slot', 'Wet')
fxslotX.set('enabled', str(fxdata[0]) )
fxslotX.set('wet', str(fxdata[1]) )
add_auto_placements(1, None, ['slot', pluginid], 'enabled', fxdata, 'enabled', fxslotX, 'on', 'Slot', 'On')
add_auto_placements(1, None, ['slot', pluginid], 'wet', fxdata, 'wet', fxslotX, 'wet', 'Slot', 'Wet')
lmms_encode_effectplugin(pluginid, fxslotX)
return fxslotX

View file

@ -6,10 +6,12 @@ import json
import lxml.etree as ET
import mido
import zlib
import os
import base64
from functions import placements
from functions import colors
from functions import data_values
from functions import plugins
def addvalue(xmltag, name, value):
x_temp = ET.SubElement(xmltag, name)
@ -62,57 +64,74 @@ def maketrack_synth(xmltag, insttrackdata, portnum):
global NoteStep
global synthidnum
routelist.append([tracknum, 0])
x_miditrack = ET.SubElement(xmltag, "SynthI")
if 'name' in insttrackdata: addvalue(x_miditrack, 'name', insttrackdata['name'])
else: addvalue(x_miditrack, 'name', 'Out')
if 'vol' in insttrackdata: addcontroller(x_miditrack, 0, insttrackdata['vol'], '#ff0000')
addvalue(x_miditrack, 'record', 0)
x_synthtrack = ET.SubElement(xmltag, "SynthI")
if 'name' in insttrackdata: addvalue(x_synthtrack, 'name', insttrackdata['name'])
else: addvalue(x_synthtrack, 'name', 'Out')
if 'vol' in insttrackdata: addcontroller(x_synthtrack, 0, insttrackdata['vol'], '#ff0000')
addvalue(x_synthtrack, 'record', 0)
track_mute = 0
if 'muted' in insttrackdata: track_mute = insttrackdata['muted']
else: track_mute = 0
if 'color' in insttrackdata: addvalue(x_miditrack, 'color', '#'+colors.rgb_float_2_hex(insttrackdata['color']))
addvalue(x_miditrack, 'solo', 0)
addvalue(x_miditrack, 'channels', 2)
addvalue(x_miditrack, 'height', 24)
addvalue(x_miditrack, 'locked', 0)
addvalue(x_miditrack, 'recMonitor', 0)
addvalue(x_miditrack, 'selected', 0)
addvalue(x_miditrack, 'selectionOrder', 0)
addvalue(x_miditrack, 'prefader', 0)
addvalue(x_miditrack, 'sendMetronome', 0)
addvalue(x_miditrack, 'off', 0)
addvalue(x_miditrack, 'automation', 0)
addvalue(x_miditrack, 'port', portnum)
if 'color' in insttrackdata: addvalue(x_synthtrack, 'color', '#'+colors.rgb_float_2_hex(insttrackdata['color']))
addvalue(x_synthtrack, 'solo', 0)
addvalue(x_synthtrack, 'channels', 2)
addvalue(x_synthtrack, 'height', 24)
addvalue(x_synthtrack, 'locked', 0)
addvalue(x_synthtrack, 'recMonitor', 0)
addvalue(x_synthtrack, 'selected', 0)
addvalue(x_synthtrack, 'selectionOrder', 0)
addvalue(x_synthtrack, 'prefader', 0)
addvalue(x_synthtrack, 'sendMetronome', 0)
addvalue(x_synthtrack, 'off', 0)
addvalue(x_synthtrack, 'automation', 0)
addvalue(x_synthtrack, 'port', portnum)
#if 'chain_fx_audio' in insttrackdata:
# chain_fx_audio = insttrackdata['chain_fx_audio']
# for pluginid in chain_fx_audio:
# plugintype = plugins.get_plug_type(cvpj_l, pluginid)
# print(pluginid, plugintype)
if 'instdata' in insttrackdata:
insttrackdata_instdata = insttrackdata['instdata']
if 'plugin' in insttrackdata_instdata and 'plugindata' in insttrackdata_instdata:
if insttrackdata_instdata['plugin'] == 'vst2-so':
addvalue(x_miditrack, 'synthType', 'VST (synths)')
if 'name' in insttrackdata_instdata['plugindata']['plugin']:
vstname = insttrackdata_instdata['plugindata']['plugin']['name']
if vstname == 'Drops': addvalue(x_miditrack, 'class', 'drops-vst')
else: addvalue(x_miditrack, 'class', vstname)
vstdata = insttrackdata_instdata['plugindata']['data'].encode('ascii')
vstdata_bytes = base64.b64decode(vstdata)
musevst = b''
musevst += len(vstdata_bytes).to_bytes(4, 'big')
musevst += zlib.compress(vstdata_bytes)
addvalue(x_miditrack, 'customData', base64.b64encode(musevst).decode('ascii'))
if 'pluginid' in insttrackdata_instdata:
pluginid = insttrackdata_instdata['pluginid']
plugintype = plugins.get_plug_type(cvpj_l, pluginid)
if plugintype == ['vst2', 'lin']:
cvpj_plugindata = plugins.get_plug_data(cvpj_l, pluginid)
addvalue(x_synthtrack, 'synthType', 'VST (synths)')
vstpath = data_values.get_value(cvpj_plugindata, 'path', '')
vstname = os.path.splitext(os.path.basename(vstpath))[0]
addvalue(x_synthtrack, 'class', vstname)
datatype = data_values.get_value(cvpj_plugindata, 'datatype', 'none')
if datatype == 'chunk':
vstdata = data_values.get_value(cvpj_plugindata, 'chunk', '')
vstdata_bytes = base64.b64decode(vstdata)
musevst = b''
musevst += len(vstdata_bytes).to_bytes(4, 'big')
musevst += zlib.compress(vstdata_bytes)
addvalue(x_synthtrack, 'customData', base64.b64encode(musevst).decode('ascii'))
else:
numparams = data_values.get_value(cvpj_plugindata, 'numparams', 0)
for param in range(numparams):
pval, ptype, pname = plugins.get_plug_param(cvpj_l, pluginid, 'vst_param_'+str(param), 0)
addvalue(x_synthtrack, 'param', pval)
else:
addvalue(x_miditrack, 'synthType', 'MESS')
addvalue(x_miditrack, 'class', 'vam')
else:
addvalue(x_synthtrack, 'synthType', 'MESS')
addvalue(x_synthtrack, 'class', 'vam')
track_mute = 1
else:
addvalue(x_miditrack, 'synthType', 'MESS')
addvalue(x_miditrack, 'class', 'vam')
addvalue(x_synthtrack, 'synthType', 'MESS')
addvalue(x_synthtrack, 'class', 'vam')
track_mute = 1
else:
addvalue(x_miditrack, 'synthType', 'MESS')
addvalue(x_miditrack, 'class', 'vam')
addvalue(x_synthtrack, 'synthType', 'MESS')
addvalue(x_synthtrack, 'class', 'vam')
track_mute = 1
addvalue(x_miditrack, 'mute', track_mute)
addvalue(x_synthtrack, 'mute', track_mute)
tracknum += 1
synthidnum += 1
@ -185,18 +204,19 @@ class output_cvpj(plugin_output.base):
global tracknum
global synthidnum
global routelist
global cvpj_l
tracknum = 0
synthidnum = 5
projJ = json.loads(convproj_json)
cvpj_l = json.loads(convproj_json)
midiDivision = 384
NoteStep = midiDivision/4
cvpj_trackdata = projJ['track_data']
cvpj_trackordering = projJ['track_order']
cvpj_trackplacements = projJ['track_placements']
cvpj_trackdata = cvpj_l['track_data']
cvpj_trackordering = cvpj_l['track_order']
cvpj_trackplacements = cvpj_l['track_placements']
x_muse = ET.Element("muse")
x_muse.set('version', "3.4")
@ -255,9 +275,12 @@ class output_cvpj(plugin_output.base):
for routeid in routelist:
addroute_audio(x_song, routeid[0], routeid[1])
muse_bpm = int(data_values.get_value(projJ, 'bpm', 120))
muse_numerator = int(data_values.get_value(projJ, 'timesig_numerator', 4))
muse_denominator = int(data_values.get_value(projJ, 'timesig_denominator', 4))
muse_bpm = int(data_values.get_value(cvpj_l, 'bpm', 120))
muse_numerator = data_values.get_value(cvpj_l, 'timesig_numerator', 4)
muse_denominator = data_values.get_value(cvpj_l, 'timesig_denominator', 4)
if muse_numerator == None: muse_numerator = 4
if muse_denominator == None: muse_denominator = 4
x_tempolist = ET.SubElement(x_song, "tempolist")
x_tempolist.set('fix', "0")
@ -274,8 +297,8 @@ class output_cvpj(plugin_output.base):
addvalue(x_sig, 'nom', str(int(muse_numerator)))
addvalue(x_sig, 'denom', str(int(muse_denominator)))
#if 'timemarkers' in projJ:
# for cvpj_timemarker in projJ['timemarkers']:
#if 'timemarkers' in cvpj_l:
# for cvpj_timemarker in cvpj_l['timemarkers']:
# if 'type' in cvpj_timemarker:
# if cvpj_timemarker['type'] == 'timesig':
# add_timesig(x_siglist, cvpj_timemarker['position'], cvpj_timemarker['numerator'], cvpj_timemarker['denominator'])