Package: neil-vst
py-neil-vstCython-based simple VST 2.4 Host and VST Plugins wrapper. Fast work and clean python object-oriented interface, minimum memory required for the one VST HOST instance.Supported platforms:Windows 64bitSupported python versions:3.7,3.8,3.9Supported VST Plugins: only64-bit/VST2Create VST host and the one VST plugin (XILS DeeS) example:fromneil_vstimportVstHost,VstPlugin# create VST hostvst_host=VstHost(samplerate=44100,buffer_size=1024,log_level="DEBUG")# create VST plugin effectplugin=VstPlugin(host=vst_host,vst_path_lib="C:/Program Files/Common Files/VST2/XILS DeeS.dll",sample_rate=44100,block_size=1024,max_channels=4,self_buffers=True,log_level="DEBUG",)print(plugin.info())Process stereo audio file with Raum VST plugin:importnumpyfromsoundfileimportSoundFilefromneil_vstimportVstHost,VstPlugin# open input audio filein_file=SoundFile(infilepath,mode='r',closefd=True)# create output audio fileout_file=SoundFile(outfilepath,mode='w',samplerate=in_file.samplerate,channels=in_file.channels,subtype=in_file.subtype,closefd=True)# sample buffer sizebuffer_size=1024# create VST hostvst_host=VstHost(samplerate=in_file.samplerate,buffer_size=buffer_size,log_level="DEBUG")# create VST plugin effectplugin=VstPlugin(host=vst_host,vst_path_lib="C:/Program Files/Common Files/VST2/Raum.dll",sample_rate=in_file.samplerate,block_size=buffer_size,max_channels=8,self_buffers=True,log_level="DEBUG",)# process stereo audio fileforblockinin_file.blocks(blocksize=self._buffer_size,always_2d=True):# prepare buffer from numpy arrayblock_rl=block.transpose()buf_in=[block_rl[0].astype(numpy.float32).ctypes.data,block_rl[1].astype(numpy.float32).ctypes.data]# VST process replasingplugin.process_replacing(buf_in,plugin.out_buffers,len(block))# get back to numpy array for save to output audio fileout_left=numpy.ctypeslib.as_array(ctypes.cast(plugin.out_buffers[0],ctypes.POINTER(ctypes.c_float)),shape=(len(block),))out_right=numpy.ctypeslib.as_array(ctypes.cast(plugin.out_buffers[1],ctypes.POINTER(ctypes.c_float)),shape=(len(block),))# write out data to output audio fileout_file.write([out_left,out_right])Open VST plugin GUI with PyQt5 QWidget with callback example:importsysimportloggingfromPyQt5importQtWidgetsfromneil_vstimportVstHost,VstPluginclassVSTPluginWindowExample(QtWidgets.QWidget):def__init__(self,plugin,parent=None):super(VSTPluginWindowExample,self).__init__(parent)# set self window nameself.setWindowTitle(plugin.name)# set self size corresponding to plugin sizerect=plugin.edit_get_rect()self.resize(rect["right"],rect["bottom"])# open plugin GUI to selfplugin.edit_open(int(self.winId()))# self showself.show()if__name__=='__main__':app=QtWidgets.QApplication(sys.argv)vst_host=VstHost(44100,log_level=logging.DEBUG)plugin=VstPlugin(vst_host,"C:/Program Files/Common Files/VST2/TDR VOS SlickEQ.dll",log_level=logging.DEBUG)plugin_window=VSTPluginWindowExample(plugin)sys.exit(app.exec_())CLI util example:>>> neil_vst_chain -husage: neil_vst_chain [-h] [-f FOLDER] [-j JOB] [-o OUTPUT] [-b BUFFERSIZE] [-v] [-i]optional arguments:-h, --help            show this help message and exit-f FOLDER, --folder FOLDERfolder with input audio files (default: .)-j JOB, --job JOB     JSON job file-o OUTPUT, --output OUTPUToutput folder for audio files (default: ./out)-b BUFFERSIZE, --buffersize BUFFERSIZEbuffer size in bytes [1024...65536] (default: 8096)-v, --verbose         verbose logging (default: False)-i, --info            show all parameters info for loaded VST (default: False)Process all files in selected folder from CLI example:>>> neil_vst_chain -f in_folder -j job_file.json -o out_folder -b 16192or>>> neil_vst_chain --folder in_folder --job job_file.json --output out_folder --buffersize 16192