Skip to content

Commit

Permalink
fixes and spectrum analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
SatyrDiamond committed Nov 16, 2024
1 parent d7091a9 commit a197729
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 23 deletions.
2 changes: 1 addition & 1 deletion functions_plugin_ext/params_os_juicysfplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ def set_sffile(self, value):

def to_cvpj_vst2(self, convproj_obj, plugin_obj):
plugin_vst2.replace_data(convproj_obj, plugin_obj, 'id', 'any', 1249076848, 'chunk', data_vc2xml.make(self.jsfp_xml), None)
plugin_obj.move_prog(self.program-1)
plugin_obj.move_prog(self.program)
3 changes: 2 additions & 1 deletion objects/convproj/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,11 @@ def copy_everything(self, locset_from, locset_to):

def calc(self, autopath, mathtype, val1, val2, val3, val4):
autopath = cvpj_autoloc(autopath)
logger_automation.info('Math '+str(autopath))
if autopath in self.data:
logger_automation.info('Math '+str(autopath))
self.data[autopath].calc(mathtype, val1, val2, val3, val4)
else:
logger_automation.debug('(not found) Math '+str(autopath))
self.calcnotfound.append([autopath, mathtype, val1, val2, val3, val4])


Expand Down
20 changes: 11 additions & 9 deletions plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,17 @@ def set_auto_keepset(self, indata):
if self.plugintype in self.pluginlist:
for shortname, dvplugin in self.pluginlist[self.plugintype].items():
if dvplugin.supported_autodetect:
try:
detected_format = dvplugin.plug_obj.detect(indata)
if detected_format:
self.selected_shortname = shortname
self.selected_plugin = self.pluginlist[self.plugintype][shortname]
logger_plugins.info('Auto-Set '+self.plugintype+' plugin: '+self.selected_shortname+' ('+ self.selected_plugin.name+')')
return shortname
except PermissionError:
pass
funclist = dir(dvplugin.plug_obj)
if 'detect' in funclist:
try:
detected_format = dvplugin.plug_obj.detect(indata)
if detected_format:
self.selected_shortname = shortname
self.selected_plugin = self.pluginlist[self.plugintype][shortname]
logger_plugins.info('Auto-Set '+self.plugintype+' plugin: '+self.selected_shortname+' ('+ self.selected_plugin.name+')')
return shortname
except PermissionError:
pass

def get_prop_obj(self):
return self.selected_plugin.prop_obj if self.selected_plugin else None
Expand Down
9 changes: 5 additions & 4 deletions plugins/input/r_reaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,10 @@ def parse(self, convproj_obj, input_file, dv_config):
if len(outsamplers) == 1:
filename, samplerj = outsamplers[0]
plugin_obj, sampleref_obj, sp_obj = convproj_obj.plugin__addspec__sampler(sampler_id, filename, 'win')
do_samplepart_loop(samplerj, sp_obj, sampleref_obj)
do_samplepart_adsr(samplerj, plugin_obj, sampleref_obj, 'vol')
track_obj.plugslots.plugin_autoplace(plugin_obj, sampler_id)
if sampleref_obj:
do_samplepart_loop(samplerj, sp_obj, sampleref_obj)
do_samplepart_adsr(samplerj, plugin_obj, sampleref_obj, 'vol')
track_obj.plugslots.plugin_autoplace(plugin_obj, sampler_id)

if len(outsamplers) > 1:
plugin_obj = convproj_obj.plugin__add(sampler_id, 'universal', 'sampler', 'multi')
Expand All @@ -311,7 +312,7 @@ def parse(self, convproj_obj, input_file, dv_config):

sampleref_obj = convproj_obj.sampleref__add(filename, filename, None)

if sampmode == 2:
if sampmode == 2 and sampleref_obj:
key_start = int((samplerj['key_start'] if 'key_start' in samplerj else 0)*127)
key_end = int((samplerj['key_end'] if 'key_end' in samplerj else 1)*127)
pitch_start = int((samplerj['pitch_start'] if 'pitch_start' in samplerj else 0)*160)-80
Expand Down
5 changes: 3 additions & 2 deletions plugins/input/r_soundation.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ def parse(self, i_convproj_obj, input_file, dv_config):
filename = None
if 'sample' in soundation_inst.data:
sample_d = soundation_inst.data['sample']
if 'url' in sample_d: filename = sample_d['url']
if sample_d:
if 'url' in sample_d: filename = sample_d['url']

if zip_data and filename:
if filename in zip_data.namelist():
Expand Down Expand Up @@ -249,7 +250,7 @@ def parse(self, i_convproj_obj, input_file, dv_config):
fldso = globalstore.dataset.get_obj('synth_nonfree', 'plugin', 'europa')
if fldso:
for param_id, dset_param in fldso.params.iter():
outval = get_paramval(soundation_inst, "/custom_properties/"+param_id)
outval = get_paramval(soundation_inst, "/custom_properties/"+dset_param.name)
plugin_obj.dset_param__add(param_id, outval, dset_param)

elif instpluginname == 'com.soundation.GM-2':
Expand Down
4 changes: 2 additions & 2 deletions plugins/input/r_waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ def do_track(convproj_obj, wf_track, track_obj):
placement_obj.time.position_real = midiclip.start
placement_obj.time.duration_real = midiclip.length
if midiclip.loopStartBeats == 0 and midiclip.loopLengthBeats == 0:
placement_obj.time.set_offset(midiclip.offset)
placement_obj.time.set_offset(midiclip.offset*4)
else:
placement_obj.cut_loop_data(midiclip.offset, midiclip.loopStartBeats, midiclip.loopStartBeats+midiclip.loopLengthBeats)
placement_obj.time.set_loop_data(midiclip.offset*4, midiclip.loopStartBeats*4, (midiclip.loopStartBeats+midiclip.loopLengthBeats)*4)

for note in midiclip.sequence.notes:
placement_obj.notelist.add_r(note.pos*4, note.dur*4, note.key-60, note.vel/100, {})
Expand Down
5 changes: 5 additions & 0 deletions plugins/plugconv/ableton__v_universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config):
manu_obj.to_param('refrence', 'TuningFreq', None)
return 1

if plugin_obj.type.check_wildmatch('universal', 'spectrum_analyzer', None):
extpluglog.convinternal('Universal', 'Spectrum Analyzer', 'Ableton', 'Spectrum Analyzer')
plugin_obj.replace('native', 'ableton', 'SpectrumAnalyzer')
return 1

if plugin_obj.type.check_wildmatch('universal', 'filter', None):
extpluglog.convinternal('Universal', 'Filter', 'Ableton', 'Eq8')
abe_starttxt = "Bands.0/ParameterA/"
Expand Down
5 changes: 5 additions & 0 deletions plugins/plugconv/flstudio__v_universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,9 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config):
plugin_obj.params.add('frequency', p_frequency*70000, 'int')
plugin_obj.params.add('freqtype', not p_freqtype, 'int')

if plugin_obj.type.check_wildmatch('universal', 'spectrum_analyzer', None):
extpluglog.convinternal('Universal', 'Spectrum Analyzer', 'FL Studio', 'Fruity Spectroman')
plugin_obj.replace('native', 'flstudio', 'fruity spectroman')
return 0

return 2
5 changes: 5 additions & 0 deletions plugins/plugconv/lmms__v_universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,9 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config):
convproj_obj.automation.move(['n_filter', pluginid, 'low_pass', 'freq'], ['plugin', pluginid, "LPfreq"])
return 0

if plugin_obj.type.check_wildmatch('universal', 'spectrum_analyzer', None):
extpluglog.convinternal('Universal', 'Spectrum Analyzer', 'LMMS', 'Spectrum Analyzer')
plugin_obj.replace('native', 'lmms', 'spectrumanalyzer')
return 0

return 2
5 changes: 5 additions & 0 deletions plugins/plugconv/soundbridge__v_universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,9 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config):
plugin_obj.params.add('downsample', xtramath.clamp(22050/(freq*40), 0, 1), 'float')
return 0

if plugin_obj.type.check_wildmatch('universal', 'spectrum_analyzer', None):
extpluglog.convinternal('Universal', 'Spectrum Analyzer', 'SoundBridge', 'Analyzer')
plugin_obj.replace('native', 'soundbridge', 'analyzer')
return 1

return 2
5 changes: 5 additions & 0 deletions plugins/plugconv/universal__n_ableton.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config):
plugin_obj.plugts_transform('./data_main/plugts/ableton_univ.pltr', 'filtereq3', convproj_obj, pluginid)
return 1

if plugin_obj.type.check_wildmatch('native', 'ableton', 'SpectrumAnalyzer'):
extpluglog.convinternal('Ableton', 'SpectrumAnalyzer', 'Universal', 'Spectrum Analyzer')
plugin_obj.replace('universal', 'spectrum_analyzer', None)
return 1

if plugin_obj.type.check_wildmatch('native', 'ableton', 'FrequencyShifter'):
p_Coarse = plugin_obj.params.get("Coarse", 0).value
p_Fine = plugin_obj.params.get("Fine", 0).value
Expand Down
5 changes: 5 additions & 0 deletions plugins/plugconv/universal__n_flstudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,9 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config):
plugin_obj = delay_obj.to_cvpj(convproj_obj, pluginid)
return 1

if plugin_obj.type.check_wildmatch('native', 'flstudio', 'fruity spectroman'):
extpluglog.convinternal('FL Studio', 'Fruity Spectroman', 'Universal', 'Spectrum Analyzer')
plugin_obj.replace('universal', 'spectrum_analyzer', None)
return 1

return 2
5 changes: 5 additions & 0 deletions plugins/plugconv/universal__n_lmms.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,9 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config):
plugin_obj.params.add('gain_in', eq_Inputgain, 'float')
return 1

if plugin_obj.type.check_wildmatch('native', 'lmms', 'spectrumanalyzer'):
extpluglog.convinternal('LMMS', 'SpectrumAnalyzer', 'Universal', 'Spectrum Analyzer')
plugin_obj.replace('universal', 'spectrum_analyzer', None)
return 1

return 2
7 changes: 6 additions & 1 deletion plugins/plugconv/universal__n_soundbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config):
downsample = plugin_obj.params.get('downsample', 0).value
plugin_obj.replace('universal', 'bitcrush', None)
plugin_obj.params.add('bits', bits*30 + 1, 'float')
plugin_obj.params.add('freq', 22050/(downsample*40), 'float')
plugin_obj.params.add('freq', 22050/((downsample*40)+1), 'float')
return 1

if plugin_obj.type.check_wildmatch('native', 'soundbridge', 'analyzer'):
extpluglog.convinternal('SoundBridge', 'Analyzer', 'Universal', 'Spectrum Analyzer')
plugin_obj.replace('universal', 'spectrum_analyzer', None)
return 1

return 2
2 changes: 1 addition & 1 deletion plugins/plugconv/universal__n_waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config):
delay_obj.feedback_cross[1] = crossR/100
delay_obj.cut_low = lowcut
delay_obj.cut_high = highcut
plugin_obj = delay_obj.to_cvpj(convproj_obj, pluginid)
plugin_obj, pluginid = delay_obj.to_cvpj(convproj_obj, pluginid)
plugin_obj.fxdata_add(None, mix)

if plugin_obj.type.check_wildmatch('native', 'tracktion', 'naturalReverb'):
Expand Down
4 changes: 2 additions & 2 deletions plugins/plugconv_ext/n_flstudio_foss.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config, extplugtype):
exttype = plugins.base.extplug_exists('socalabs', extplugtype, 'spectrumanalyzer')
if exttype:
extpluglog.extpluglist.success('FL Studio', 'Fruity Spectroman')
plugin_obj.plugts_transform('./data_ext/plugts/flstudio_vst.pltr', 'vst2_fruity_spectroman', convproj_obj, pluginid)
plugin_obj.plugts_transform('./data_ext/plugts/flstudio_vst.pltr', 'fruity_spectroman__socalabs', convproj_obj, pluginid)
plugin_obj.user_to_external(convproj_obj, pluginid, exttype, 'any')
return True

Expand All @@ -493,7 +493,7 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config, extplugtype):
exttype = plugins.base.extplug_exists('socalabs', extplugtype, 'stereoprocessor')
if exttype:
extpluglog.extpluglist.success('FL Studio', 'Fruity Stereo Enhancer')
plugin_obj.plugts_transform('./data_ext/plugts/flstudio_vst.pltr', 'vst2_fruity_stereo_enhancer', convproj_obj, pluginid)
plugin_obj.plugts_transform('./data_ext/plugts/flstudio_vst.pltr', 'fruity_stereo_enhancer__socalabs', convproj_obj, pluginid)
plugin_obj.user_to_external(convproj_obj, pluginid, exttype, 'any')
return True

Expand Down
1 change: 1 addition & 0 deletions plugins/plugconv_ext/n_onlineseq_foss.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import struct
from functions_plugin_ext import plugin_vst2
from functions import extpluglog

class plugconv(plugins.base):
def __init__(self): pass
Expand Down
8 changes: 8 additions & 0 deletions plugins/plugconv_ext/v_universal_foss.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ def convert(self, convproj_obj, plugin_obj, pluginid, dv_config, extplugtype):
plugin_obj.user_to_external(convproj_obj, pluginid, 'vst2', 'any')
return True

if plugin_obj.type.check_wildmatch('universal', 'spectrumanalyzer', None):
extpluglog.extpluglist.add('FOSS', 'VST2', 'SpectrumAnalyzer', 'SocaLabs')
exttype = plugins.base.extplug_exists('socalabs', extplugtype, 'spectrumanalyzer')
if exttype:
extpluglog.extpluglist.success('Universal', 'Spectrum Analyzer')
plugin_obj.user_to_external(convproj_obj, pluginid, exttype, 'any')
return True

if plugin_obj.type.check_wildmatch('universal', 'synth-osc', None):
if plugin_obj.oscs:
osc_obj = plugin_obj.oscs[0]
Expand Down

0 comments on commit a197729

Please sign in to comment.