vst2
implements VST2 SDK API. It provides capabilities to build both VST2 hosts and plugins.
$ go get -u pipelined.dev/audio/vst2
Refer godoc
documentation for example.
vst2
is licensed under MIT license.
Build vst2 plugins and hosts with Go
License: MIT License
The test plugin for windows (TAL-Reverb-4) is crashing when single-channel data is being processed.
Validation plan:
Received opcode: HostGetCurrentProcessLevel
Received opcode: HostGetCurrentProcessLevel
Exception 0xc0000005 0x1 0x0 0x7ffea0b2b7a4
PC=0x7ffea0b2b7a4
runtime: unknown pc 0x7ffea0b2b7a4
stack: frame={sp:0x7dfae8, fp:0x0} stack=[0x0,0x7dfdc0)
00000000007df9e8: 00000000004b0706 0000000000000000
00000000007df9f8: 0000000000000000 0000000000000000
00000000007dfa08: 0000000000000000 0000000000000000
00000000007dfa18: 00000000004b043d 0000000000000000
00000000007dfa28: 0000000000000000 0000000000000000
00000000007dfa38: 0000000000000000 0000000000000000
00000000007dfa48: 0000000000000017 0000000000000000
00000000007dfa58: 00000000004b0270 0000000000000086
00000000007dfa68: 0000000000177f60 0000000000000000
00000000007dfa78: 0000000000000005 0000000000930b50
00000000007dfa88: 0000000000000017 0000000000000000
00000000007dfa98: 0000000000000000 0000000000000000
00000000007dfaa8: 00007ffe00000000 0000000000000000
00000000007dfab8: 0000000000000000 000000c000147a28
00000000007dfac8: 0000000000000000 000000c00014a020
00000000007dfad8: 000000c0001479e8 0000000000000200
00000000007dfae8: <00007ffea0a92d4a 0000000000000106
00000000007dfaf8: 00007ffed787b997 0000000000e50000
00000000007dfb08: 0000000000000000 0000000000000000
00000000007dfb18: 00007ffe00000000 0000000200000001
00000000007dfb28: 0000000000000002 0000000000000002
00000000007dfb38: 0000000000000008 00000000008b7dc0
00000000007dfb48: 0000000000171c62 000000000c00000c
00000000007dfb58: 0000000000000000 fffffffffffffffe
00000000007dfb68: 0000000000000000 000000000c00000c
00000000007dfb78: 0000000000000008 000000000000000c
00000000007dfb88: 00000000008b7d70 0000000000000000
00000000007dfb98: 00000000004e4160 0000000000000000
00000000007dfba8: 0000000000001000 0000000000000000
00000000007dfbb8: 0000000000000000 0000000000000081
00000000007dfbc8: 0000000000001010 0000000000170000
00000000007dfbd8: 00007ffed787ba3b 0000000000170000
runtime: unknown pc 0x7ffea0b2b7a4
stack: frame={sp:0x7dfae8, fp:0x0} stack=[0x0,0x7dfdc0)
00000000007df9e8: 00000000004b0706 0000000000000000
00000000007df9f8: 0000000000000000 0000000000000000
00000000007dfa08: 0000000000000000 0000000000000000
00000000007dfa18: 00000000004b043d 0000000000000000
00000000007dfa28: 0000000000000000 0000000000000000
00000000007dfa38: 0000000000000000 0000000000000000
00000000007dfa48: 0000000000000017 0000000000000000
00000000007dfa58: 00000000004b0270 0000000000000086
00000000007dfa68: 0000000000177f60 0000000000000000
00000000007dfa78: 0000000000000005 0000000000930b50
00000000007dfa88: 0000000000000017 0000000000000000
00000000007dfa98: 0000000000000000 0000000000000000
00000000007dfaa8: 00007ffe00000000 0000000000000000
00000000007dfab8: 0000000000000000 000000c000147a28
00000000007dfac8: 0000000000000000 000000c00014a020
00000000007dfad8: 000000c0001479e8 0000000000000200
00000000007dfae8: <00007ffea0a92d4a 0000000000000106
00000000007dfaf8: 00007ffed787b997 0000000000e50000
00000000007dfb08: 0000000000000000 0000000000000000
00000000007dfb18: 00007ffe00000000 0000000200000001
00000000007dfb28: 0000000000000002 0000000000000002
00000000007dfb38: 0000000000000008 00000000008b7dc0
00000000007dfb48: 0000000000171c62 000000000c00000c
00000000007dfb58: 0000000000000000 fffffffffffffffe
00000000007dfb68: 0000000000000000 000000000c00000c
00000000007dfb78: 0000000000000008 000000000000000c
00000000007dfb88: 00000000008b7d70 0000000000000000
00000000007dfb98: 00000000004e4160 0000000000000000
00000000007dfba8: 0000000000001000 0000000000000000
00000000007dfbb8: 0000000000000000 0000000000000081
00000000007dfbc8: 0000000000001010 0000000000170000
00000000007dfbd8: 00007ffed787ba3b 0000000000170000
goroutine 1 [syscall]:
pipelined.dev/vst2._Cfunc_processDouble(0x930b50, 0x20000000001, 0xc00014a020, 0xc00014a028)
_cgo_gotypes.go:151 +0x4c
pipelined.dev/vst2.(*Plugin).ProcessDouble.func1(0xc000126360, 0xc000147ab0, 0xc000147ad8)
C:/dev/vst2/vst2/vst2.go:184 +0x161
pipelined.dev/vst2.(*Plugin).ProcessDouble(0xc000126360, 0x1, 0x200, 0xc00014a020, 0x1, 0x1, 0x1, 0x200, 0xc00014a028, 0x1, ...)
C:/dev/vst2/vst2/vst2.go:184 +0x46
main.main()
C:/dev/vst2/vst2/examples/example_vst2.go:85 +0x4a1
rax 0xffffffffffffffff
rbx 0x200
rcx 0x10
rdi 0x0
rsi 0x1
rbp 0x2
rsp 0x7dfae8
r8 0xff0
r9 0x1f
r10 0x177f70
r11 0x0
r12 0x930dc0
r13 0x2
r14 0xc00014a028
r15 0x930b00
rip 0x7ffea0b2b7a4
rflags 0x10213
cs 0x33
fs 0x53
gs 0x2b
exit status 2
Existing implementation returns constant value hardcoded in the vst2.Parameter
struct. It should call a user-defined function that will return display value based on current parameter value.
Currently compilation on windows is not possible. Context and details are available here.
It seems that the following command is enough to produce working plugin for Windows/Linux:
go build --buildmode c-shared --tags plugin
Confirmation is required.
Since vst2 is obsolete than README looks a little bit ambiguous. The Steinberg site offers to download vst3 SDK version at the moment, so for newcomers, it's not obvious what they should do next: to download vst3, to try to find a vst2 archive etc.
Would you mind explaining this on the README page, please?
P.S. Does it make sense to use vst2 if it's discontinued? Or the naming of the project doesn't mean that it relies on the vst2 exactly?
Can you create a MIDI effect plugin with only MIDI on inputs and outputs?
The demo plugin does have the default MIDI events-in input, didn't find any info on adding more and creating a MIDI output in the docs.
The idea is modifying incoming MIDI CC commands on certain channels.
Version of VST 2 SDK used in this project is no more publicly available. The only way to get SDK is still thorough Steinberg Portal. They offer VST 3 SDK that still contains VST 2 SDK within.
However, new version has different header names, so code has to change.
Provide host callback API, so plugin developers won't have to deal with unsafe casting.
Provide CLI that would bundle compiled plugin to OS X bundle. Here is the example of bundler from rust vst2 project.
Command to compile plugin into Mach-O bundle:
go build --buildmode c-archive --tags plugin -o demoplugin.a
clang -bundle -o demoplugin -all_load demoplugin.a
I just happened upon this project while searching for Golang / VST SDK bindings. Looks promising!
Are you at a point where it makes sense to have other people try out this package? I'm a Go developer, although I haven't worked with the VST SDK yet and I'm not educated on the common patterns. As such, a passthrough audio example like this for JACK would be really helpful.
I can't build this on Linux AMD64 because of the following error:
../../../go/pkg/mod/pipelined.dev/audio/[email protected]/plugin.go:141:97: cannot use _Ctype_longlong(flags) (value of type _Ctype_longlong) as _Ctype_long value in variable declaration
Changing the given line to
return (*TimeInfo)(unsafe.Pointer(uintptr(C.callbackHost(h.callback, cp, C.int(HostGetTime), 0, C.long(flags), nil, 0))))
seems to fix the issue and it builds successfully.
Good Evening,
thanks for you effort to bring vst to golang!
Just tried to get the example up and running, but ran into some minor problems:
var data = signal.Float64([][]float64{
//Cannot convert expression of type [][]float64 to type Float64
Please consider to rename all of your modules from pipelined.dev to github.com/pipelined/:
go get: github.com/pipelined/[email protected]: parsing go.mod:
module declares its path as: pipelined.dev/vst2
but was required as: github.com/pipelined/vst2
Iam new to vst programming, so a few questions arise.
It would be awesome if you can give me a hint to the right direction :
To fully support VST2 api, all types from SDK should be present in the package.
This types could be moved to go as they don't contain pointers.
This types might stay in C as they have pointers inside.
When working with a language server for go I encounter the following errors
error PluginAllocator not declared by package vst2
error Dispatcher not declared by package vst2
error unknown field UniqueID in struct (vst2.Plugin) literal
error unknown field Version in struct (vst2.Plugin) literal
error unknown field InputChannels in struct (vst2.Plugin) literal
error unknown field OutputChannels in struct (vst2.Plugin) literal
error unknown field Name in struct (vst2.Plugin) literal
error unknown field Vendor in struct (vst2.Plugin) literal
error unknown field Category in struct (vst2.Plugin) literal
error unknown field Parameters in struct (vst2.Plugin) literal
error unknown field ProcessDoubleFunc in struct (vst2.Plugin) literal
error unknown field ProcessFloatFunc in struct (vst2.Plugin) literal
Can anything be changed in the implementation to address these issues or is this sworn to be another issue of "cgo is not go"?
If the former, I don't know C or CGo, but I'd be happy to learn if you've got any good places to start on the issue
Cheers.
I'd like to use this library to build a synth instead of an effect plugin, but just changing the category was not enough. The synth would need to receive MIDI messages and produce sound in response. Is it currently possible?
VST2 in linux is a .so file.
Use TAL-Baseline as it's available for all 3 target systems.
Hello, I'm on go version go1.16.2 windows/amd64
trying to run the demoplugin/demo.go file but keep getting the following error
# command-line-arguments
.\demo.go:14:2: undefined: vst2.PluginAllocator
.\demo.go:14:57: undefined: vst2.Dispatcher
.\demo.go:21:4: unknown field 'InputChannels' in struct literal of type vst2.Plugin
.\demo.go:22:4: unknown field 'OutputChannels' in struct literal of type vst2.Plugin
.\demo.go:23:4: unknown field 'Parameters' in struct literal of type vst2.Plugin
.\demo.go:26:4: unknown field 'ProcessDoubleFunc' in struct literal of type vst2.Plugin
.\demo.go:36:4: unknown field 'ProcessFloatFunc' in struct literal of type vst2.Plugin
.\demo.go:46:6: undefined: vst2.Dispatcher
Publish vst2 project to awesome go list
What's needed:
Add godoc with build instructions.
Currently plugin doesn't implement any clean-up. What needs to be freed:
Because resources allocated by both a user and a library must be freed, it's not enough to just provide a hook for the user.
CopyTo
/CopyFrom
functions with ReadT/WriteT;size
with length
;nil
valuesCurrently demoplugin uses linear scale for gain. It should use a logarithmic scale with proper to-decibel conversion for display label.
Sample code from thread on JUCE forum:
float LinearToDecibel(float linear)
{
float db;
if (linear != 0.0f)
db = 20.0f * log10(linear);
else
db = -144.0f; // effectively minus infinity
return db;
}
Dispatch and host callback functions have vague semantics that treat parameters depending on what opcode is provided. It's not user-friendly and error prone. The more convenient approach would be to provide wrapper functions where user can always provide exact parameters and avoid error-prone and unsafe castings.
Strikethroughopcodes are deprecated
Opcodes:
Provide dispatch API, so plugin developers won't have to deal with unsafe casting in dispatch calls.
Travis CI provides an early-version of windows environments to execute pipelines. Since there are test cases for windows, it might be a nice idea to include it to current setup.
go build --buildmode c-shared
produces Mach-O dynamically linked shared library x86_64. This is different from what other plugins do.
Some DAWs would still recognise (tested with Renoise) plugin if this dylib is placed in the bundle. However, Ableton doesn't detect such plugin.
In theory this package should allow people building VST2 plugins in go. This issue will track the progress in this effort.
Compilation and build:
Build command (OS X):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.