fm update + goldbox
This commit is contained in:
parent
f71fb614f6
commit
59ce62c13d
14 changed files with 358 additions and 251 deletions
100
functions_plugparams/params_fm.py
Normal file
100
functions_plugparams/params_fm.py
Normal file
|
@ -0,0 +1,100 @@
|
|||
# SPDX-FileCopyrightText: 2023 SatyrDiamond
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from functions import plugins
|
||||
from functions import data_bytes
|
||||
|
||||
g_paramnames = {}
|
||||
g_paramnames['opl2'] = [
|
||||
['perctype','tremolo_depth','vibrato_depth','fm','feedback'],
|
||||
2,
|
||||
['env_attack','env_decay','env_release','env_sustain','freqmul','ksr','level','ksl','tremolo','vibrato','waveform','sustained', 'perc_env'] ]
|
||||
|
||||
g_paramnames['opl3'] = [
|
||||
['perctype','tremolo_depth','vibrato_depth','con_12','con_34','feedback_12','feedback_34'],
|
||||
4,
|
||||
['env_attack','env_decay','env_release','env_sustain','freqmul','ksr','level','ksl','tremolo','vibrato','waveform','sustained', 'perc_env'] ]
|
||||
|
||||
g_paramnames['opn2'] = [
|
||||
['algorithm','feedback','fms','ams','lfo_enable','lfo_frequency'],
|
||||
4,
|
||||
['am','env_attack','env_decay','freqmul','env_release','env_sustain','level','detune2','ratescale','detune','env_decay2','ssg_enable','ssg_mode'] ]
|
||||
|
||||
class fm_data:
|
||||
def __init__(self, fmtype):
|
||||
self.params = {}
|
||||
self.operator = []
|
||||
self.fmtype = fmtype
|
||||
self.fm_paramnames = g_paramnames[fmtype]
|
||||
|
||||
for paramname in self.fm_paramnames[0]: self.params[paramname] = 0
|
||||
|
||||
for opnum in range(self.fm_paramnames[1]):
|
||||
op_data = {}
|
||||
for opparamname in self.fm_paramnames[2]: op_data[opparamname] = 0
|
||||
self.operator.append(op_data)
|
||||
|
||||
def set_param(self, name, value):
|
||||
self.params[name] = value
|
||||
|
||||
def set_op_param(self, opnum, name, value):
|
||||
self.operator[opnum][name] = value
|
||||
|
||||
def to_cvpj(self, cvpj_l, pluginid):
|
||||
for paramname in self.fm_paramnames[0]:
|
||||
plugins.add_plug_param(cvpj_l, pluginid, paramname, self.params[paramname], 'int', paramname)
|
||||
|
||||
for opnum in range(self.fm_paramnames[1]):
|
||||
for opparamname in self.fm_paramnames[2]:
|
||||
cvpj_opparamname = 'op'+str(opnum+1)+'_'+opparamname
|
||||
plugins.add_plug_param(cvpj_l, pluginid, cvpj_opparamname, self.operator[opnum][opparamname], 'int', 'OP '+str(opnum+1)+': '+opparamname)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def opl_sbi_part_op(self, opnum, i_input, isreversed):
|
||||
ixChar, ixScale, ixAttack, ixSustain, ixWaveSel = i_input
|
||||
|
||||
opl_out_flags, opl_out_mul = data_bytes.splitbyte(ixChar)
|
||||
opl_out_trem, opl_out_vib, opl_out_sust, opl_out_krs = data_bytes.to_bin(opl_out_flags, 4)
|
||||
opl_out_kls = ixScale >> 6
|
||||
opl_out_out = ixScale & 0x3F
|
||||
opl_out_wave = ixWaveSel
|
||||
opl_out_att, opl_out_dec = data_bytes.splitbyte(ixAttack)
|
||||
opl_out_sus, opl_out_rel = data_bytes.splitbyte(ixSustain)
|
||||
|
||||
if isreversed == False:
|
||||
self.set_op_param(opnum, 'env_attack', opl_out_att)
|
||||
self.set_op_param(opnum, 'env_decay', opl_out_dec)
|
||||
self.set_op_param(opnum, 'env_release', opl_out_rel)
|
||||
else:
|
||||
self.set_op_param(opnum, 'env_attack', (opl_out_att*-1)+15)
|
||||
self.set_op_param(opnum, 'env_decay', (opl_out_dec*-1)+15)
|
||||
self.set_op_param(opnum, 'env_release', (opl_out_rel*-1)+15)
|
||||
|
||||
|
||||
self.set_op_param(opnum, 'ksl', opl_out_kls)
|
||||
self.set_op_param(opnum, 'freqmul', opl_out_mul)
|
||||
self.set_op_param(opnum, 'env_sustain', opl_out_sus)
|
||||
self.set_op_param(opnum, 'sustained', opl_out_sust)
|
||||
self.set_op_param(opnum, 'level', opl_out_out)
|
||||
self.set_op_param(opnum, 'tremolo', opl_out_trem)
|
||||
self.set_op_param(opnum, 'vibrato', opl_out_vib)
|
||||
self.set_op_param(opnum, 'ksr', opl_out_krs)
|
||||
self.set_op_param(opnum, 'waveform', opl_out_wave)
|
||||
|
||||
def opl_sbi_part_fbcon(self, iFeedback, txt_feedback, txt_fm):
|
||||
opl_fb = (iFeedback) >> 1
|
||||
opl_con = iFeedback & 0x01
|
||||
|
||||
self.set_param(txt_feedback, opl_fb)
|
||||
self.set_param(txt_fm, opl_con)
|
||||
|
|
@ -72,14 +72,14 @@ def create_wave(shape, mul, pw, **kwargs):
|
|||
for num in range(numpoints): wave_data.append(wave_tri((num+halfpoint)/numpoints)**3)
|
||||
return wave_data
|
||||
|
||||
def cvpjwave2wave(cvpj_l, pluginid, wave_name):
|
||||
def cvpjwave2wave(cvpj_l, pluginid, wave_name, **kwargs):
|
||||
wavedata = plugins.get_wave(cvpj_l, pluginid, wave_name)
|
||||
if wavedata != None:
|
||||
wavedata_points = wavedata['points']
|
||||
if 'range' in wavedata:
|
||||
rangedata = wavedata['range']
|
||||
wavedata_points = [xtramath.between_to_one(rangedata[0], rangedata[1], i) for i in wavedata_points]
|
||||
return resizewave(wavedata_points)
|
||||
return resizewave(wavedata_points, **kwargs)
|
||||
else: return None
|
||||
|
||||
def wave2file(cvpj_l, pluginid, wave_name, fileloc):
|
||||
|
|
|
@ -8,6 +8,7 @@ from functions import plugins
|
|||
from functions import idvals
|
||||
from functions import song
|
||||
from functions_tracks import tracks_mi
|
||||
from functions_plugparams import params_fm
|
||||
import plugin_input
|
||||
import zlib
|
||||
import struct
|
||||
|
@ -160,22 +161,24 @@ class input_cvpj_r(plugin_input.base):
|
|||
fmdata['ams'] = bio_dmf.read(1)[0] #(AMS on YM2612, AMS on YM2151)
|
||||
fmdata['lfo_enable'] = 0
|
||||
fmdata['lfo_frequency'] = 0
|
||||
fmdata['ops'] = [[],[],[],[]]
|
||||
for opnum in [0,2,1,3]:
|
||||
optxt = 'op'+str(opnum+1)+'_'
|
||||
fmdata[optxt+'am'] = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'env_attack'] = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'env_decay'] = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'freqmul'] = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'env_release'] = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'env_sustain'] = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'level'] = (bio_dmf.read(1)[0]*-1)+127
|
||||
fmdata[optxt+'detune2'] = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'ratescale'] = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'detune'] = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'env_decay2'] = bio_dmf.read(1)[0]
|
||||
opdata = {}
|
||||
opdata['am'] = bio_dmf.read(1)[0]
|
||||
opdata['env_attack'] = bio_dmf.read(1)[0]
|
||||
opdata['env_decay'] = bio_dmf.read(1)[0]
|
||||
opdata['freqmul'] = bio_dmf.read(1)[0]
|
||||
opdata['env_release'] = bio_dmf.read(1)[0]
|
||||
opdata['env_sustain'] = bio_dmf.read(1)[0]
|
||||
opdata['level'] = (bio_dmf.read(1)[0]*-1)+127
|
||||
opdata['detune2'] = bio_dmf.read(1)[0]
|
||||
opdata['ratescale'] = bio_dmf.read(1)[0]
|
||||
opdata['detune'] = bio_dmf.read(1)[0]
|
||||
opdata['env_decay2'] = bio_dmf.read(1)[0]
|
||||
ssgmode = bio_dmf.read(1)[0]
|
||||
fmdata[optxt+'ssg_enable'] = int(bool(ssgmode & 0b0001000))
|
||||
fmdata[optxt+'ssg_mode'] = ssgmode & 0b00001111
|
||||
opdata['ssg_enable'] = int(bool(ssgmode & 0b0001000))
|
||||
opdata['ssg_mode'] = ssgmode & 0b00001111
|
||||
fmdata['ops'][opnum] = opdata
|
||||
dmf_inst['fmdata'] = fmdata
|
||||
else:
|
||||
dmf_inst['fm'] = False
|
||||
|
@ -307,8 +310,31 @@ class input_cvpj_r(plugin_input.base):
|
|||
|
||||
elif insttype == 'opn2':
|
||||
plugins.add_plug(cvpj_l, pluginid, 'fm', 'opn2')
|
||||
for fmdataval in dmf_instdata['fmdata']:
|
||||
plugins.add_plug_param(cvpj_l, pluginid, fmdataval, dmf_instdata['fmdata'][fmdataval], 'int', fmdataval)
|
||||
fmdata = params_fm.fm_data('opn2')
|
||||
dmf_fmdata = dmf_instdata['fmdata']
|
||||
dmf_fmopdata = dmf_fmdata['ops']
|
||||
|
||||
fmdata.set_param('algorithm', dmf_fmdata['algorithm'])
|
||||
fmdata.set_param('feedback', dmf_fmdata['feedback'])
|
||||
fmdata.set_param('fms', dmf_fmdata['fms'])
|
||||
fmdata.set_param('ams', dmf_fmdata['ams'])
|
||||
|
||||
for opnum in range(4):
|
||||
fmdata.set_op_param(opnum, 'am', dmf_fmopdata[opnum]['am'])
|
||||
fmdata.set_op_param(opnum, 'detune', dmf_fmopdata[opnum]['detune'])
|
||||
fmdata.set_op_param(opnum, 'detune2', dmf_fmopdata[opnum]['detune2'])
|
||||
fmdata.set_op_param(opnum, 'env_attack', dmf_fmopdata[opnum]['env_attack'])
|
||||
fmdata.set_op_param(opnum, 'env_decay', dmf_fmopdata[opnum]['env_decay'])
|
||||
fmdata.set_op_param(opnum, 'env_decay2', dmf_fmopdata[opnum]['env_decay2'])
|
||||
fmdata.set_op_param(opnum, 'env_release', dmf_fmopdata[opnum]['env_release'])
|
||||
fmdata.set_op_param(opnum, 'env_sustain', dmf_fmopdata[opnum]['env_sustain'])
|
||||
fmdata.set_op_param(opnum, 'freqmul', dmf_fmopdata[opnum]['freqmul'])
|
||||
fmdata.set_op_param(opnum, 'level', dmf_fmopdata[opnum]['level'])
|
||||
fmdata.set_op_param(opnum, 'ratescale', dmf_fmopdata[opnum]['ratescale'])
|
||||
fmdata.set_op_param(opnum, 'ssg_enable', dmf_fmopdata[opnum]['ssg_enable'])
|
||||
fmdata.set_op_param(opnum, 'ssg_mode', dmf_fmopdata[opnum]['ssg_mode'])
|
||||
|
||||
fmdata.to_cvpj(cvpj_l, pluginid)
|
||||
else:
|
||||
cvpj_instdata["plugin"] = 'none'
|
||||
|
||||
|
|
|
@ -481,7 +481,7 @@ class input_famistudio(plugin_input.base):
|
|||
|
||||
cvpj_notemod['auto']['pitch'] = [{'position': 0, 'value': 0}, {'position': t_duration, 'value': t_slidenote-t_key}]
|
||||
|
||||
if ChannelName[0:4] == 'VRC7': t_key -= 24
|
||||
if ChannelName[0:6] == 'EPSMFM': t_key -= 12
|
||||
|
||||
if cvpj_multikeys == []:
|
||||
cvpj_note = note_data.mx_makenote(t_instrument, t_position, t_duration, t_key, None, None)
|
||||
|
|
|
@ -134,6 +134,7 @@ noteoffset['C♯'] = 1
|
|||
noteoffset['C'] = 0
|
||||
|
||||
inst_names = {
|
||||
"FM6op": "advanced FM",
|
||||
"chip": "Chip Wave",
|
||||
"PWM": "Pulse Width",
|
||||
"harmonics": "Harmonics",
|
||||
|
@ -164,24 +165,25 @@ def calcval(value):
|
|||
global jummbox_ticksPerBeat
|
||||
return (value*(jummbox_beatsPerBar/jummbox_ticksPerBeat))/2
|
||||
|
||||
def addfx(cvpj_instid, fxname):
|
||||
def addfx(fxgroupname, cvpj_instid, fxname):
|
||||
pluginid = cvpj_instid+'_'+fxname
|
||||
plugins.add_plug(cvpj_l, pluginid, 'native-jummbox', fxname)
|
||||
plugins.add_plug_fxdata(cvpj_l, pluginid, True, 1)
|
||||
plugins.add_plug(cvpj_l, pluginid, fxgroupname, fxname)
|
||||
fxslot.insert(cvpj_l, ['instrument', cvpj_instid], 'audio', pluginid)
|
||||
return pluginid
|
||||
|
||||
def addfx_universal(cvpj_instid, fxname):
|
||||
pluginid = cvpj_instid+'_'+fxname
|
||||
plugins.add_plug(cvpj_l, pluginid, 'universal', fxname)
|
||||
fxslot.insert(cvpj_l, ['instrument', cvpj_instid], 'audio', pluginid)
|
||||
return pluginid
|
||||
|
||||
def addfx_simple(cvpj_instid, fxname):
|
||||
pluginid = cvpj_instid+'_'+fxname
|
||||
plugins.add_plug(cvpj_l, pluginid, 'simple', fxname)
|
||||
fxslot.insert(cvpj_l, ['instrument', cvpj_instid], 'audio', pluginid)
|
||||
return pluginid
|
||||
def add_eq_data(cvpj_instid, eqfiltbands):
|
||||
pluginid = addfx('universal', cvpj_instid, 'eq-bands')
|
||||
plugins.add_plug_fxvisual(cvpj_l, pluginid, 'EQ', None)
|
||||
for eqfiltdata in eqfiltbands:
|
||||
eqgain_pass = eqfiltdata['linearGain']
|
||||
eqgain = (eqfiltdata['linearGain']-2)*6
|
||||
eqtype = eqfiltdata['type']
|
||||
if eqtype == 'low-pass':
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, eqfiltdata['cutoffHz'], 0, 'low_pass', eqgain_pass, None)
|
||||
if eqtype == 'peak':
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, eqfiltdata['cutoffHz'], eqgain, 'peak', 1, None)
|
||||
if eqtype == 'high-pass':
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, eqfiltdata['cutoffHz'], 0, 'high_pass', eqgain_pass, None)
|
||||
|
||||
def get_harmonics(i_harmonics):
|
||||
harmonics = [i/100 for i in i_harmonics]
|
||||
|
@ -263,7 +265,7 @@ def parse_instrument(channum, instnum, bb_instrument, bb_type, bb_color, bb_inst
|
|||
op_waveform = data_values.get_value(opdata, 'waveform', 'sine')
|
||||
plugins.add_plug_data(cvpj_l, cvpj_instid, opnumtext+'waveform', op_waveform)
|
||||
op_pulseWidth = data_values.get_value(opdata, 'waveform', 'sine')
|
||||
plugins.add_plug_data(cvpj_l, cvpj_instid, opnumtext+'pulseWidth', 5)
|
||||
plugins.add_plug_data(cvpj_l, cvpj_instid, opnumtext+'pulseWidth', op_pulseWidth)
|
||||
plugins.add_plug_param(cvpj_l, cvpj_instid, opnumtext+"amplitude", opdata['amplitude'], 'int', "")
|
||||
|
||||
if bb_inst_type == 'custom chip':
|
||||
|
@ -271,53 +273,48 @@ def parse_instrument(channum, instnum, bb_instrument, bb_type, bb_color, bb_inst
|
|||
customChipWave = [customChipWave[str(i)] for i in range(64)]
|
||||
plugins.add_wave(cvpj_l, cvpj_instid, 'chipwave', customChipWave, -24, 24)
|
||||
|
||||
if bb_inst_type == 'FM6op': #goldbox
|
||||
plugins.add_plug_data(cvpj_l, cvpj_instid, 'algorithm', bb_instrument['algorithm'])
|
||||
plugins.add_plug_data(cvpj_l, cvpj_instid, 'feedback_type', bb_instrument['feedbackType'])
|
||||
plugins.add_plug_param(cvpj_l, cvpj_instid, "feedback_amplitude", bb_instrument['feedbackAmplitude'], 'int', "Feedback Amplitude")
|
||||
|
||||
for opnum in range(4):
|
||||
opdata = bb_instrument['operators'][opnum]
|
||||
opnumtext = 'op'+str(opnum+1)+'_'
|
||||
plugins.add_plug_data(cvpj_l, cvpj_instid, opnumtext+'frequency', opdata['frequency'])
|
||||
op_waveform = data_values.get_value(opdata, 'waveform', 'sine')
|
||||
plugins.add_plug_data(cvpj_l, cvpj_instid, opnumtext+'waveform', op_waveform)
|
||||
op_pulseWidth = data_values.get_value(opdata, 'waveform', 'sine')
|
||||
plugins.add_plug_data(cvpj_l, cvpj_instid, opnumtext+'pulseWidth', op_pulseWidth)
|
||||
plugins.add_plug_param(cvpj_l, cvpj_instid, opnumtext+"amplitude", opdata['amplitude'], 'int', "")
|
||||
|
||||
if bb_instrument['algorithm'] == 'Custom':
|
||||
plugins.add_plug_data(cvpj_l, cvpj_instid, 'customAlgorithm', bb_instrument['customAlgorithm'])
|
||||
|
||||
|
||||
|
||||
tracks_mi.inst_create(cvpj_l, cvpj_instid)
|
||||
tracks_mi.inst_visual(cvpj_l, cvpj_instid, name=cvpj_instname, color=bb_color)
|
||||
tracks_mi.inst_pluginid(cvpj_l, cvpj_instid, cvpj_instid)
|
||||
tracks_mi.inst_param_add(cvpj_l, cvpj_instid, 'vol', cvpj_volume, 'float')
|
||||
|
||||
if 'eqFilterType' in bb_instrument:
|
||||
if bb_instrument['eqFilterType'] == False:
|
||||
if 'eqSubFilters0' in bb_instrument:
|
||||
pluginid = addfx_universal(cvpj_instid, 'eq-bands')
|
||||
plugins.add_plug_fxvisual(cvpj_l, pluginid, 'EQ', None)
|
||||
for eqfiltdata in bb_instrument['eqSubFilters0']:
|
||||
eqgain_pass = eqfiltdata['linearGain']
|
||||
eqgain = (eqfiltdata['linearGain']-2)*6
|
||||
eqtype = eqfiltdata['type']
|
||||
if eqtype == 'low-pass':
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, eqfiltdata['cutoffHz'], 0, 'low_pass', eqgain_pass, None)
|
||||
if eqtype == 'peak':
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, eqfiltdata['cutoffHz'], eqgain, 'peak', 1, None)
|
||||
if eqtype == 'high-pass':
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, eqfiltdata['cutoffHz'], 0, 'high_pass', eqgain_pass, None)
|
||||
else:
|
||||
if bb_instrument['eqFilterType'] == False and 'eqSubFilters0' in bb_instrument: add_eq_data(cvpj_instid, bb_instrument['eqSubFilters0'])
|
||||
|
||||
else:
|
||||
filter_hz = filtervals[bb_instrument['eqSimpleCut']]
|
||||
filter_peak = bb_instrument['eqSimplePeak']
|
||||
if filter_hz != None or filter_peak != 0:
|
||||
if filter_hz == None: filter_hz = 8000
|
||||
pluginid = addfx_universal(cvpj_instid, 'eq-bands')
|
||||
pluginid = addfx('universal', cvpj_instid, 'eq-bands')
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, filter_hz, 0, 'low_pass', filter_peak*2, None)
|
||||
|
||||
elif 'eqFilter' in bb_instrument:
|
||||
bb_eqFilter = bb_instrument['eqFilter']
|
||||
if bb_eqFilter != []:
|
||||
pluginid = addfx_universal(cvpj_instid, 'eq-bands')
|
||||
plugins.add_plug_fxvisual(cvpj_l, pluginid, 'EQ', None)
|
||||
for eqfiltdata in bb_eqFilter:
|
||||
eqgain_pass = eqfiltdata['linearGain']
|
||||
eqgain = (eqfiltdata['linearGain']-2)*6
|
||||
eqtype = eqfiltdata['type']
|
||||
if eqtype == 'low-pass':
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, eqfiltdata['cutoffHz'], 0, 'low_pass', eqgain_pass, None)
|
||||
if eqtype == 'peak':
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, eqfiltdata['cutoffHz'], eqgain, 'peak', 1, None)
|
||||
if eqtype == 'high-pass':
|
||||
plugins.add_eqband(cvpj_l, pluginid, 1, eqfiltdata['cutoffHz'], 0, 'high_pass', eqgain_pass, None)
|
||||
if bb_eqFilter != []: add_eq_data(cvpj_instid, bb_eqFilter)
|
||||
|
||||
if 'echo' in bb_inst_effects:
|
||||
pluginid = addfx_universal(cvpj_instid, 'delay-c')
|
||||
pluginid = addfx('universal', cvpj_instid, 'delay-c')
|
||||
plugins.add_plug_fxvisual(cvpj_l, pluginid, 'Echo', None)
|
||||
plugins.add_plug_fxdata(cvpj_l, pluginid, 1, 0.5)
|
||||
|
||||
|
@ -326,12 +323,12 @@ def parse_instrument(channum, instnum, bb_instrument, bb_type, bb_color, bb_inst
|
|||
plugins.add_plug_data(cvpj_l, pluginid, 'feedback', bb_instrument['echoSustain']/240)
|
||||
|
||||
if 'distortion' in bb_inst_effects:
|
||||
pluginid = addfx_simple(cvpj_instid, 'distortion')
|
||||
pluginid = addfx('simple', cvpj_instid, 'distortion')
|
||||
plugins.add_plug_fxvisual(cvpj_l, pluginid, 'Distortion', None)
|
||||
plugins.add_plug_param(cvpj_l, pluginid, 'amount', bb_instrument['distortion']/100, 'float', 'amount')
|
||||
|
||||
if 'bitcrusher' in bb_inst_effects:
|
||||
pluginid = addfx_universal(cvpj_instid, 'bitcrush')
|
||||
pluginid = addfx('universal', cvpj_instid, 'bitcrush')
|
||||
plugins.add_plug_fxvisual(cvpj_l, pluginid, 'Bitcrusher', None)
|
||||
|
||||
t_bits_val = round(xtramath.between_from_one(7, 0, bb_instrument['bitcrusherQuantization']/100))
|
||||
|
@ -345,12 +342,12 @@ def parse_instrument(channum, instnum, bb_instrument, bb_type, bb_color, bb_inst
|
|||
plugins.add_plug_param(cvpj_l, pluginid, 'freq', freq_out, 'float', "")
|
||||
|
||||
if 'chorus' in bb_inst_effects:
|
||||
pluginid = addfx_simple(cvpj_instid, 'chorus')
|
||||
pluginid = addfx('simple', cvpj_instid, 'chorus')
|
||||
plugins.add_plug_fxvisual(cvpj_l, pluginid, 'Chorus', None)
|
||||
plugins.add_plug_fxdata(cvpj_l, pluginid, 1, bb_instrument['chorus']/100)
|
||||
|
||||
if 'reverb' in bb_inst_effects:
|
||||
pluginid = addfx_simple(cvpj_instid, 'reverb')
|
||||
pluginid = addfx('simple', cvpj_instid, 'reverb')
|
||||
plugins.add_plug_fxvisual(cvpj_l, pluginid, 'Reverb', None)
|
||||
reverblvl = data_values.get_value(bb_instrument, 'reverb', 40)
|
||||
plugins.add_plug_fxdata(cvpj_l, pluginid, 1, reverblvl/100)
|
||||
|
|
|
@ -44,7 +44,7 @@ opl2opvarnames = [
|
|||
['_mul', '_freqmul'],
|
||||
['_ksr', '_ksr'],
|
||||
['_lvl', '_level'],
|
||||
['_perc', '_perc_env'],
|
||||
['_perc', '_sustained'],
|
||||
['_scale', '_scale'],
|
||||
['_trem', '_tremolo'],
|
||||
['_vib', '_vibrato'],
|
||||
|
|
|
@ -10,6 +10,8 @@ from functions import plugins
|
|||
from functions import song
|
||||
from functions_tracks import tracks_rm
|
||||
from functions_tracks import auto_nopl
|
||||
from functions_plugparams import params_fm
|
||||
|
||||
import plugin_input
|
||||
import json
|
||||
import struct
|
||||
|
@ -169,40 +171,46 @@ class input_adlib_rol(plugin_input.base):
|
|||
if instdatanum <= numinst:
|
||||
opl2data = adlib_bnk[1][adlib_bnk[0][instname][0]]
|
||||
|
||||
fmdata = params_fm.fm_data('opl2')
|
||||
|
||||
plugins.add_plug(cvpj_l, instname_upper, 'fm', 'opl2')
|
||||
|
||||
tracks_rm.inst_dataval_add(cvpj_l, instname_upper, 'instdata', 'middlenote', 0)
|
||||
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, 'mod_scale', opl2data[1][0], 'int', 'mod_scale')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_freqmul', opl2data[1][1], 'int', 'mod_freqmul')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'feedback', opl2data[1][2], 'int', 'feedback')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_env_attack', (opl2data[1][3]*-1)+15, 'int', 'mod_env_attack')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_env_sustain', (opl2data[1][4]*-1)+15, 'int', 'mod_env_sustain')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_perc_env', int(not bool(opl2data[1][5])), 'int', 'mod_perc_env')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_env_decay', (opl2data[1][6]*-1)+15, 'int', 'mod_env_decay')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_env_release', (opl2data[1][7]*-1)+15, 'int', 'mod_env_release')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_level', (opl2data[1][8]*-1)+63, 'int', 'mod_level')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_tremolo', opl2data[1][9], 'int', 'mod_tremolo')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_vibrato', opl2data[1][10], 'int', 'mod_vibrato')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_ksr', opl2data[1][11], 'int', 'mod_ksr')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'fm', opl2data[1][12], 'int', 'fm')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'mod_waveform', opl2data[3][0], 'int', 'mod_waveform')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_scale', opl2data[2][0], 'int', 'car_scale')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_freqmul', opl2data[2][1], 'int', 'car_freqmul')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_env_attack', (opl2data[2][3]*-1)+15, 'int', 'car_env_attack')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_env_sustain', (opl2data[2][4]*-1)+15, 'int', 'car_env_sustain')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_perc_env', int(not bool(opl2data[2][5])), 'int', 'car_perc_env')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_env_decay', (opl2data[2][6]*-1)+15, 'int', 'car_env_decay')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_env_release', (opl2data[2][7]*-1)+15, 'int', 'car_env_release')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_level', (opl2data[2][8]*-1)+63, 'int', 'car_level')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_tremolo', opl2data[2][9], 'int', 'car_tremolo')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_vibrato', opl2data[2][10], 'int', 'car_vibrato')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_ksr', opl2data[2][11], 'int', 'car_ksr')
|
||||
plugins.add_plug_param(cvpj_l, instname_upper, 'car_waveform', opl2data[3][1], 'int', 'car_waveform')
|
||||
if opl2data[0][0] == 1: fmdata.set_param('perctype', opl2data[0][1]-6)
|
||||
else:
|
||||
fmdata.set_op_param(0, 'sustained', 1)
|
||||
fmdata.set_op_param(1, 'sustained', 1)
|
||||
|
||||
fmdata.set_op_param(0, 'ksl', opl2data[1][0])
|
||||
fmdata.set_op_param(0, 'freqmul', opl2data[1][1])
|
||||
fmdata.set_param('feedback', opl2data[1][2])
|
||||
fmdata.set_op_param(0, 'env_attack', opl2data[1][3])
|
||||
fmdata.set_op_param(0, 'env_sustain', opl2data[1][4])
|
||||
fmdata.set_op_param(0, 'perc_env', int(not bool(opl2data[1][5])))
|
||||
fmdata.set_op_param(0, 'env_decay', opl2data[1][6])
|
||||
fmdata.set_op_param(0, 'env_release', opl2data[1][7])
|
||||
fmdata.set_op_param(0, 'level', opl2data[1][8])
|
||||
fmdata.set_op_param(0, 'tremolo', opl2data[1][9])
|
||||
fmdata.set_op_param(0, 'vibrato', opl2data[1][10])
|
||||
fmdata.set_op_param(0, 'ksr', opl2data[1][11])
|
||||
fmdata.set_param('fm', opl2data[1][12])
|
||||
fmdata.set_op_param(0, 'waveform', opl2data[3][0])
|
||||
|
||||
fmdata.set_op_param(1, 'ksl', opl2data[2][0])
|
||||
fmdata.set_op_param(1, 'freqmul', opl2data[2][1])
|
||||
fmdata.set_op_param(1, 'env_attack', opl2data[2][3])
|
||||
fmdata.set_op_param(1, 'env_sustain', opl2data[2][4])
|
||||
fmdata.set_op_param(1, 'perc_env', int(not bool(opl2data[2][5])))
|
||||
fmdata.set_op_param(1, 'env_decay', opl2data[2][6])
|
||||
fmdata.set_op_param(1, 'env_release', opl2data[2][7])
|
||||
fmdata.set_op_param(1, 'level', opl2data[2][8])
|
||||
fmdata.set_op_param(1, 'tremolo', opl2data[2][9])
|
||||
fmdata.set_op_param(1, 'vibrato', opl2data[2][10])
|
||||
fmdata.set_op_param(1, 'ksr', opl2data[2][11])
|
||||
fmdata.set_op_param(1, 'waveform', opl2data[3][1])
|
||||
|
||||
fmdata.to_cvpj(cvpj_l, instname_upper)
|
||||
|
||||
else:
|
||||
for instassocgm in idvals_inst_adlib_rol:
|
||||
gmmidiinst = idvals_inst_adlib_rol[instassocgm]['gm_inst']
|
||||
|
|
|
@ -16,6 +16,7 @@ from functions import note_data
|
|||
from functions import params
|
||||
from functions_tracks import tracks_rm
|
||||
from functions_tracks import auto_nopl
|
||||
from functions_plugparams import params_fm
|
||||
|
||||
def add_point(i_list, time, value):
|
||||
if time not in i_list: i_list[time] = []
|
||||
|
@ -28,24 +29,17 @@ def decode_events(song_file):
|
|||
for _ in range(track_numEvents):
|
||||
sop_event_pos = int.from_bytes(song_file.read(2), "little")
|
||||
sop_event_code = song_file.read(1)[0]
|
||||
if sop_event_code == 1:
|
||||
sop_eventdata.append([sop_event_pos, 'SPECIAL', song_file.read(1)[0]])
|
||||
if sop_event_code == 1: sop_eventdata.append([sop_event_pos, 'SPECIAL', song_file.read(1)[0]])
|
||||
elif sop_event_code == 2:
|
||||
note_pitch = song_file.read(1)[0]
|
||||
note_length = int.from_bytes(song_file.read(2), "little")
|
||||
sop_eventdata.append([sop_event_pos, 'NOTE', note_pitch, note_length])
|
||||
elif sop_event_code == 3:
|
||||
sop_eventdata.append([sop_event_pos, 'TEMPO', song_file.read(1)[0]])
|
||||
elif sop_event_code == 4:
|
||||
sop_eventdata.append([sop_event_pos, 'VOL', song_file.read(1)[0]])
|
||||
elif sop_event_code == 5:
|
||||
sop_eventdata.append([sop_event_pos, 'PITCH', song_file.read(1)[0]])
|
||||
elif sop_event_code == 6:
|
||||
sop_eventdata.append([sop_event_pos, 'INST', song_file.read(1)[0]])
|
||||
elif sop_event_code == 7:
|
||||
sop_eventdata.append([sop_event_pos, 'PAN', song_file.read(1)[0]])
|
||||
elif sop_event_code == 8:
|
||||
sop_eventdata.append([sop_event_pos, 'GVOL', song_file.read(1)[0]])
|
||||
elif sop_event_code == 3: sop_eventdata.append([sop_event_pos, 'TEMPO', song_file.read(1)[0]])
|
||||
elif sop_event_code == 4: sop_eventdata.append([sop_event_pos, 'VOL', song_file.read(1)[0]])
|
||||
elif sop_event_code == 5: sop_eventdata.append([sop_event_pos, 'PITCH', song_file.read(1)[0]])
|
||||
elif sop_event_code == 6: sop_eventdata.append([sop_event_pos, 'INST', song_file.read(1)[0]])
|
||||
elif sop_event_code == 7: sop_eventdata.append([sop_event_pos, 'PAN', song_file.read(1)[0]])
|
||||
elif sop_event_code == 8: sop_eventdata.append([sop_event_pos, 'GVOL', song_file.read(1)[0]])
|
||||
else:
|
||||
print('[error] unknown event code:', sop_event_code)
|
||||
exit()
|
||||
|
@ -137,69 +131,47 @@ class input_sop(plugin_input.base):
|
|||
tracks_rm.inst_create(cvpj_l, cvpj_instname)
|
||||
tracks_rm.inst_visual(cvpj_l, cvpj_instname, name=instname, color=[0.39, 0.16, 0.78])
|
||||
|
||||
#print(sop_data_s_inst, instname)
|
||||
if sop_data_s_inst[0] in [1,6,7,8,9,10]:
|
||||
fmdata = params_fm.fm_data('opl2')
|
||||
|
||||
#if sop_data_s_inst[0] in [1,6,7,8,9,10]:
|
||||
# tracks.c_inst_pluginid(cvpj_l, cvpj_instname, cvpj_instname)
|
||||
# plugins.add_plug(cvpj_l, cvpj_instname, 'fm', 'opl2')
|
||||
tracks_rm.inst_pluginid(cvpj_l, cvpj_instname, cvpj_instname)
|
||||
#tracks_rm.inst_dataval_add(cvpj_l, cvpj_instname, 'instdata', 'middlenote', 24)
|
||||
plugins.add_plug(cvpj_l, cvpj_instname, 'fm', 'opl2')
|
||||
|
||||
# sbidata = sop_data_s_inst[3]
|
||||
# iModChar = sbidata[0]
|
||||
# iModScale = sbidata[1]
|
||||
# iModAttack = sbidata[2]
|
||||
# iModSustain = sbidata[3]
|
||||
# iModWaveSel = sbidata[4]
|
||||
# iFeedback = sbidata[5]
|
||||
# iCarChar = sbidata[6]
|
||||
# iCarScale = sbidata[7]
|
||||
# iCarAttack = sbidata[8]
|
||||
# iCarSustain = sbidata[9]
|
||||
# iCarWaveSel = sbidata[10]
|
||||
sbidata = sop_data_s_inst[3]
|
||||
iMod = [sbidata[0], sbidata[1], sbidata[2], sbidata[3], sbidata[4]]
|
||||
iFeedback = sbidata[5]
|
||||
iCar = [sbidata[6], sbidata[7], sbidata[8], sbidata[9], sbidata[10]]
|
||||
|
||||
# opl_sbi.opl2sbi_plugin(cvpj_l, cvpj_instname,
|
||||
# iModChar, iCarChar, iModScale, iCarScale,
|
||||
# iModAttack, iCarAttack, iModSustain, iCarSustain,
|
||||
# iModWaveSel, iCarWaveSel, iFeedback)
|
||||
fmdata.opl_sbi_part_op(0, iMod, False)
|
||||
fmdata.opl_sbi_part_op(1, iCar, False)
|
||||
fmdata.opl_sbi_part_fbcon(iFeedback, 'feedback', 'fm')
|
||||
|
||||
#if sop_data_s_inst[0] == 0:
|
||||
# tracks.c_inst_pluginid(cvpj_l, cvpj_instname, cvpj_instname)
|
||||
# plugins.add_plug(cvpj_l, cvpj_instname, 'fm', 'opl3')
|
||||
# fouropdata = sop_data_s_inst[3]
|
||||
# op1_data = fouropdata[0:5]
|
||||
# op12_fbcon = fouropdata[5]
|
||||
# op2_data = fouropdata[6:11]
|
||||
# op3_data = fouropdata[11:16]
|
||||
# op34_fbcon = fouropdata[16]
|
||||
# op4_data = fouropdata[17:22]
|
||||
# for opnum, opdata in [['m1',op1_data],['c1',op2_data],['m2',op3_data],['c2',op4_data]]:
|
||||
# iOpChar = opdata[0]
|
||||
fmdata.to_cvpj(cvpj_l, cvpj_instname)
|
||||
|
||||
# iOpScale = opdata[1]
|
||||
# iOpAttack = opdata[2]
|
||||
# iOpSustain = opdata[3]
|
||||
if sop_data_s_inst[0] == 0:
|
||||
fmdata = params_fm.fm_data('opl3')
|
||||
|
||||
# iOpWaveSel = opdata[4]
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_waveform", iOpWaveSel, 'int', "")
|
||||
tracks_rm.inst_pluginid(cvpj_l, cvpj_instname, cvpj_instname)
|
||||
#tracks_rm.inst_dataval_add(cvpj_l, cvpj_instname, 'instdata', 'middlenote', 24)
|
||||
plugins.add_plug(cvpj_l, cvpj_instname, 'fm', 'opl3')
|
||||
fouropdata = sop_data_s_inst[3]
|
||||
|
||||
# out_kls = iOpScale >> 6
|
||||
# out_lvl = iOpScale & 0x3F
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_level", (out_lvl*-1)+63, 'int', "")
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_ksr", out_kls, 'int', "")
|
||||
op1_data = [fouropdata[0], fouropdata[1], fouropdata[2], fouropdata[3], fouropdata[4]]
|
||||
op12_fbcon = fouropdata[5]
|
||||
op2_data = [fouropdata[6], fouropdata[7], fouropdata[8], fouropdata[9], fouropdata[10]]
|
||||
op3_data = fouropdata[11:16]
|
||||
op34_fbcon = fouropdata[16]
|
||||
op4_data = fouropdata[17:22]
|
||||
|
||||
# out_att, out_dec = data_bytes.splitbyte(iOpAttack)
|
||||
# out_sus, out_rel = data_bytes.splitbyte(iOpSustain)
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_env_attack", (out_att*-1)+15, 'int', "")
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_env_sustain", (out_sus*-1)+15, 'int', "")
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_env_decay", (out_dec*-1)+15, 'int', "")
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_env_release", (out_rel*-1)+15, 'int', "")
|
||||
fmdata.opl_sbi_part_op(0, op1_data, False)
|
||||
fmdata.opl_sbi_part_fbcon(op12_fbcon, 'feedback_12', 'con_12')
|
||||
fmdata.opl_sbi_part_op(1, op2_data, False)
|
||||
fmdata.opl_sbi_part_op(2, op3_data, False)
|
||||
fmdata.opl_sbi_part_fbcon(op34_fbcon, 'feedback_34', 'con_34')
|
||||
fmdata.opl_sbi_part_op(3, op4_data, False)
|
||||
|
||||
# out_flags, out_mul = data_bytes.splitbyte(iOpChar)
|
||||
# out_trem, out_vib, out_sust, out_krs = data_bytes.to_bin(out_flags, 4)
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_freqmul", out_mul, 'int', "")
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_tremolo", out_trem, 'int', "")
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_vibrato", out_vib, 'int', "")
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_ksr", out_krs, 'int', "")
|
||||
# plugins.add_plug_param(cvpj_l, cvpj_instname, opnum+"_sust", out_sust, 'int', "")
|
||||
fmdata.to_cvpj(cvpj_l, cvpj_instname)
|
||||
|
||||
all_notepos = None
|
||||
|
||||
|
@ -208,7 +180,7 @@ class input_sop(plugin_input.base):
|
|||
|
||||
if sop_data_chanmodes[tracknum] == 0: trackname_endtext = ''
|
||||
if sop_data_chanmodes[tracknum] == 1: trackname_endtext = '4OP (YMF-262M)'
|
||||
if sop_data_chanmodes[tracknum] == 0: trackname_endtext = '2OP (YM-3812)'
|
||||
if sop_data_chanmodes[tracknum] == 2: trackname_endtext = '2OP (YM-3812)'
|
||||
|
||||
cvpj_trackid = str(tracknum)
|
||||
cvpj_notelist = []
|
||||
|
|
|
@ -49,7 +49,7 @@ opl2opvarnames = [
|
|||
['_mul', '_freqmul'],
|
||||
['_ksr', '_ksr'],
|
||||
['_lvl', '_level'],
|
||||
['_perc', '_perc_env'],
|
||||
['_perc', '_sustained'],
|
||||
['_scale', '_scale'],
|
||||
['_trem', '_tremolo'],
|
||||
['_vib', '_vibrato'],
|
||||
|
|
|
@ -22,6 +22,7 @@ import plugin_plugconv
|
|||
|
||||
from functions import plugins
|
||||
from functions import data_bytes
|
||||
from functions_plugparams import params_fm
|
||||
import math
|
||||
import struct
|
||||
|
||||
|
@ -54,37 +55,36 @@ class plugconv(plugin_plugconv.base):
|
|||
vrc_car_sus, vrc_car_rel = data_bytes.splitbyte(vrcregs[7])
|
||||
|
||||
plugins.replace_plug(cvpj_l, pluginid, 'fm', 'opl2')
|
||||
fmdata = params_fm.fm_data('opl2')
|
||||
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "feedback", vrc_fb, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "percussive", 0, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "perctype", 0, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "tremolo_depth", 0, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "vibrato_depth", 0, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "fm", 1, 'int', "")
|
||||
fmdata.set_param('fm', 0)
|
||||
fmdata.set_param('feedback', vrc_fb)
|
||||
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_scale", vrc_mod_kls, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_freqmul", vrc_mod_mul, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_env_attack", (vrc_mod_att*-1)+15, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_env_sustain", (vrc_mod_sus*-1)+15, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_perc_env", 0, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_env_decay", (vrc_mod_dec*-1)+15, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_env_release", vrc_mod_rel, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_level", (vrc_mod_out*-1)+63, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_tremolo", vrc_mod_trem, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_vibrato", vrc_mod_vib, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_ksr", vrc_mod_krs, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "mod_waveform", vrc_mod_wave, 'int', "")
|
||||
fmdata.set_op_param(0, 'env_attack', vrc_mod_att)
|
||||
fmdata.set_op_param(0, 'env_decay', vrc_mod_dec)
|
||||
fmdata.set_op_param(0, 'env_release', vrc_mod_rel)
|
||||
fmdata.set_op_param(0, 'env_sustain', vrc_mod_sus)
|
||||
fmdata.set_op_param(0, 'freqmul', vrc_mod_mul)
|
||||
fmdata.set_op_param(0, 'ksl', vrc_mod_kls)
|
||||
fmdata.set_op_param(0, 'ksr', vrc_mod_krs)
|
||||
fmdata.set_op_param(0, 'level', vrc_mod_out)
|
||||
fmdata.set_op_param(0, 'tremolo', vrc_mod_trem)
|
||||
fmdata.set_op_param(0, 'vibrato', vrc_mod_vib)
|
||||
fmdata.set_op_param(0, 'waveform', vrc_mod_wave)
|
||||
fmdata.set_op_param(0, 'sustained', vrc_mod_sust)
|
||||
|
||||
fmdata.set_op_param(1, 'env_attack', vrc_car_att)
|
||||
fmdata.set_op_param(1, 'env_decay', (vrc_car_dec*-1)+15)
|
||||
fmdata.set_op_param(1, 'env_release', (vrc_car_rel*-1)+15)
|
||||
fmdata.set_op_param(1, 'env_sustain', vrc_car_sus)
|
||||
fmdata.set_op_param(1, 'freqmul', vrc_car_mul)
|
||||
fmdata.set_op_param(1, 'ksl', vrc_car_kls)
|
||||
fmdata.set_op_param(1, 'ksr', vrc_car_krs)
|
||||
fmdata.set_op_param(1, 'tremolo', vrc_car_trem)
|
||||
fmdata.set_op_param(1, 'vibrato', vrc_car_vib)
|
||||
fmdata.set_op_param(1, 'waveform', vrc_car_wave)
|
||||
fmdata.set_op_param(1, 'sustained', vrc_car_sust)
|
||||
|
||||
fmdata.to_cvpj(cvpj_l, pluginid)
|
||||
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_scale", vrc_car_kls, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_freqmul", vrc_car_mul, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_env_attack", (vrc_car_att*-1)+15, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_env_sustain", (vrc_car_sus*-1)+15, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_perc_env", 0, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_env_decay", (vrc_car_dec*-1)+15, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_env_release", vrc_car_rel, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_level", 63, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_tremolo", vrc_car_trem, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_vibrato", vrc_car_vib, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_ksr", vrc_car_krs, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "car_waveform", vrc_car_wave, 'int', "")
|
||||
return True
|
|
@ -5,6 +5,7 @@ import plugin_plugconv
|
|||
|
||||
from functions import plugins
|
||||
from functions import idvals
|
||||
from functions_plugparams import params_fm
|
||||
|
||||
class plugconv(plugin_plugconv.base):
|
||||
def __init__(self): pass
|
||||
|
@ -18,28 +19,30 @@ class plugconv(plugin_plugconv.base):
|
|||
epsmopregs = [epsmregs[2:9], epsmregs[9:16], epsmregs[16:23], epsmregs[23:30]]
|
||||
|
||||
plugins.replace_plug(cvpj_l, pluginid, 'fm', 'opn2')
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "algorithm", epsmregs[0]&0x0F, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "feedback", ((epsmregs[0]>>3)*2)+1, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "ams", (epsmregs[1]>>4)&0x03, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "fms", epsmregs[1]&0x0F, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "lfo_enable", epsmregs[30]>>3, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, "lfo_frequency", epsmregs[30]&0x07, 'int', "")
|
||||
fmdata = params_fm.fm_data('opn2')
|
||||
|
||||
fmdata.set_param('algorithm', epsmregs[0]&0x0F)
|
||||
fmdata.set_param('feedback', ((epsmregs[0]>>3)*2)+1)
|
||||
fmdata.set_param('fms', epsmregs[1]&0x0F)
|
||||
fmdata.set_param('ams', (epsmregs[1]>>4)&0x03)
|
||||
fmdata.set_param('lfo_enable', epsmregs[30]>>3)
|
||||
fmdata.set_param('lfo_frequency', epsmregs[30]&0x07)
|
||||
|
||||
for opnum in range(4):
|
||||
op_reg = epsmopregs[opnum]
|
||||
op_num = 'op'+str(opnum)
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_am', op_reg[3] >> 7, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_env_attack', op_reg[2] & 0x3F, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_env_decay', op_reg[3] & 0x3F, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_freqmul', op_reg[0] & 0x0F, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_env_release', op_reg[5] & 0x0F, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_env_sustain', op_reg[5] >> 4, 'int', "") #SusLvl
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_level', (op_reg[1]*-1)+127, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_detune2', 0, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_ratescale', op_reg[2] >> 6, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_detune', op_reg[0] >> 4, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_env_decay2', op_reg[4], 'int', "") #SusRate
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_ssg_enable', op_reg[6] >> 3, 'int', "")
|
||||
plugins.add_plug_param(cvpj_l, pluginid, op_num+'_ssg_mode', op_reg[6] & 0x08, 'int', "")
|
||||
fmdata.set_op_param(opnum, 'am', op_reg[3] >> 7)
|
||||
fmdata.set_op_param(opnum, 'detune', op_reg[0] >> 4)
|
||||
fmdata.set_op_param(opnum, 'env_attack', op_reg[2] & 0x3F)
|
||||
fmdata.set_op_param(opnum, 'env_decay', op_reg[3] & 0x3F)
|
||||
fmdata.set_op_param(opnum, 'env_decay2', op_reg[4])
|
||||
fmdata.set_op_param(opnum, 'env_release', op_reg[5] & 0x0F)
|
||||
fmdata.set_op_param(opnum, 'env_sustain', op_reg[5] >> 4)
|
||||
fmdata.set_op_param(opnum, 'freqmul', op_reg[0] & 0x0F)
|
||||
fmdata.set_op_param(opnum, 'level', (op_reg[1]*-1)+127)
|
||||
fmdata.set_op_param(opnum, 'ratescale', op_reg[2] >> 6)
|
||||
fmdata.set_op_param(opnum, 'ssg_enable', op_reg[6] >> 3)
|
||||
fmdata.set_op_param(opnum, 'ssg_mode', op_reg[6] & 0x08)
|
||||
|
||||
fmdata.to_cvpj(cvpj_l, pluginid)
|
||||
|
||||
return True
|
|
@ -46,28 +46,28 @@ class plugconv(plugin_plugconv.base):
|
|||
opnplug_addvalue(opnplug_params, "four_op" ,0)
|
||||
opnplug_addvalue(opnplug_params, "pseudo_four_op" ,0)
|
||||
opnplug_addvalue(opnplug_params, "blank" ,0)
|
||||
opnplug_addvalue(opnplug_params, "con12" ,int(not getparam('fm')))
|
||||
opnplug_addvalue(opnplug_params, "con12" ,getparam('fm'))
|
||||
opnplug_addvalue(opnplug_params, "con34" ,0)
|
||||
opnplug_addvalue(opnplug_params, "note_offset1" ,0)
|
||||
opnplug_addvalue(opnplug_params, "note_offset2" ,0)
|
||||
opnplug_addvalue(opnplug_params, "fb12" ,getparam("12_fb"))
|
||||
opnplug_addvalue(opnplug_params, "note_offset1" ,0)
|
||||
opnplug_addvalue(opnplug_params, "note_offset2" ,0)
|
||||
opnplug_addvalue(opnplug_params, "fb12" ,getparam("feedback"))
|
||||
opnplug_addvalue(opnplug_params, "fb34" ,getparam("34_fb"))
|
||||
opnplug_addvalue(opnplug_params, "midi_velocity_offset" ,0)
|
||||
opnplug_addvalue(opnplug_params, "second_voice_detune" ,0)
|
||||
opnplug_addvalue(opnplug_params, "percussion_key_number" ,0)
|
||||
|
||||
for opnplugopname, cvpjopname in [['m1', 'mod'], ['c1', 'car'], ['m2', ''], ['c2', '']]:
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"attack" ,getparam(cvpjopname+"_env_attack"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"decay" ,getparam(cvpjopname+"_env_decay"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"sustain" ,getparam(cvpjopname+"_env_sustain"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"release" ,getparam(cvpjopname+"_env_release"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"level" ,getparam(cvpjopname+"_level"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"ksl" ,getparam(cvpjopname+"_ksr"))
|
||||
for opnplugopname, cvpjopname in [['m1', 'op1'], ['c1', 'op2'], ['m2', ''], ['c2', '']]:
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"attack" ,(getparam(cvpjopname+"_env_attack")*-1)+15)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"decay" ,(getparam(cvpjopname+"_env_decay")*-1)+15)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"sustain" ,(getparam(cvpjopname+"_env_sustain")*-1)+15)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"release" ,(getparam(cvpjopname+"_env_release")*-1)+15)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"level" ,(getparam(cvpjopname+"_level")*-1)+63)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"ksl" ,getparam(cvpjopname+"_ksl"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"fmul" ,getparam(cvpjopname+"_freqmul"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"trem" ,getparam(cvpjopname+"_tremolo"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"vib" ,getparam(cvpjopname+"_vibrato"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"sus" ,getparam(cvpjopname+"_sust"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"env" ,getparam(cvpjopname+"_perc_env"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"sus" ,getparam(cvpjopname+"_sustained"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"env" ,getparam(cvpjopname+"_ksr"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"wave" ,getparam(cvpjopname+"_waveform"))
|
||||
|
||||
opnplug_addvalue(opnplug_params, "delay_off_ms" ,160)
|
||||
|
|
|
@ -46,30 +46,29 @@ class plugconv(plugin_plugconv.base):
|
|||
opnplug_addvalue(opnplug_params, "four_op" ,1)
|
||||
opnplug_addvalue(opnplug_params, "pseudo_four_op" ,0)
|
||||
opnplug_addvalue(opnplug_params, "blank" ,0)
|
||||
opnplug_addvalue(opnplug_params, "con12" ,int(not getparam('fm')))
|
||||
opnplug_addvalue(opnplug_params, "con34" ,0)
|
||||
opnplug_addvalue(opnplug_params, "con12" ,getparam('con_12'))
|
||||
opnplug_addvalue(opnplug_params, "con34" ,getparam('con_34'))
|
||||
opnplug_addvalue(opnplug_params, "note_offset1" ,0)
|
||||
opnplug_addvalue(opnplug_params, "note_offset2" ,0)
|
||||
opnplug_addvalue(opnplug_params, "fb12" ,getparam('feedback'))
|
||||
opnplug_addvalue(opnplug_params, "fb34" ,0)
|
||||
opnplug_addvalue(opnplug_params, "fb12" ,getparam('feedback_12'))
|
||||
opnplug_addvalue(opnplug_params, "fb34" ,getparam('feedback_34'))
|
||||
opnplug_addvalue(opnplug_params, "midi_velocity_offset" ,0)
|
||||
opnplug_addvalue(opnplug_params, "second_voice_detune" ,0)
|
||||
opnplug_addvalue(opnplug_params, "percussion_key_number" ,0)
|
||||
|
||||
for opnum in range(4):
|
||||
s_opadltxt = opadltxt[opnum]
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"attack" ,getparam(s_opadltxt+"_env_attack"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"decay" ,getparam(s_opadltxt+"_env_decay"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"sustain" ,getparam(s_opadltxt+"_env_sustain"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"release" ,getparam(s_opadltxt+"_env_release"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"level" ,getparam(s_opadltxt+"_level"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"ksl" ,getparam(s_opadltxt+"_ksr"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"fmul" ,getparam(s_opadltxt+"_freqmul"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"trem" ,getparam(s_opadltxt+"_tremolo"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"vib" ,getparam(s_opadltxt+"_vibrato"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"sus" ,getparam(s_opadltxt+"_sust"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"env" ,getparam(s_opadltxt+"_perc_env"))
|
||||
opnplug_addvalue(opnplug_params, s_opadltxt+"wave" ,getparam(s_opadltxt+"_waveform"))
|
||||
for opnplugopname, cvpjopname in [['m1', 'op1'], ['c1', 'op2'], ['m2', 'op3'], ['c2', 'op4']]:
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"attack" ,(getparam(cvpjopname+"_env_attack")*-1)+15)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"decay" ,(getparam(cvpjopname+"_env_decay")*-1)+15)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"sustain" ,(getparam(cvpjopname+"_env_sustain")*-1)+15)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"release" ,(getparam(cvpjopname+"_env_release")*-1)+15)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"level" ,(getparam(cvpjopname+"_level")*-1)+63)
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"ksl" ,getparam(cvpjopname+"_ksl"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"fmul" ,getparam(cvpjopname+"_freqmul"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"trem" ,getparam(cvpjopname+"_tremolo"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"vib" ,getparam(cvpjopname+"_vibrato"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"sus" ,getparam(cvpjopname+"_sustained"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"env" ,getparam(cvpjopname+"_ksr"))
|
||||
opnplug_addvalue(opnplug_params, opnplugopname+"wave" ,getparam(cvpjopname+"_waveform"))
|
||||
|
||||
opnplug_addvalue(opnplug_params, "delay_off_ms" ,160)
|
||||
opnplug_addvalue(opnplug_params, "delay_on_ms" ,386)
|
||||
|
|
|
@ -5,6 +5,8 @@ import plugin_plugconv
|
|||
|
||||
from functions import plugins
|
||||
from functions import data_bytes
|
||||
from functions_plugparams import params_vital
|
||||
from functions import plugin_vst2
|
||||
|
||||
class plugconv(plugin_plugconv.base):
|
||||
def __init__(self): pass
|
||||
|
|
Loading…
Reference in a new issue