Documentation ¶
Overview ¶
Package vst2 provides interface to VST2 plugins.
Index ¶
- Constants
- func ScanPaths() (paths []string)
- type DoubleBuffer
- type EffectFlags
- type EffectOpcode
- type FloatBuffer
- type HostCallbackFunc
- type HostOpcode
- type Index
- type Opt
- type Plugin
- func (p *Plugin) CanProcessFloat32() bool
- func (p *Plugin) CanProcessFloat64() bool
- func (p *Plugin) Close() error
- func (p *Plugin) Dispatch(opcode EffectOpcode, index Index, value Value, ptr Ptr, opt Opt) Return
- func (p *Plugin) ProcessDouble(in, out DoubleBuffer)
- func (p *Plugin) ProcessFloat(in, out FloatBuffer)
- func (p *Plugin) SetBufferSize(bufferSize int)
- func (p *Plugin) SetSampleRate(sampleRate int)
- func (p *Plugin) SetSpeakerArrangement(in, out *SpeakerArrangement)
- func (p *Plugin) Start()
- func (p *Plugin) Stop()
- type PluginOpcode
- type ProcessLevels
- type Processor
- type Ptr
- type Return
- type SMPTEFrameRate
- type Speaker
- type SpeakerArrangement
- type SpeakerArrangementType
- type SpeakerType
- type TimeInfo
- type TimeInfoFlags
- type VST
- type Value
Constants ¶
const ( // SpeakerUndefined is undefined. SpeakerUndefined SpeakerType = 0x7fffffff // SpeakerM is Mono (M). SpeakerM = iota // SpeakerL is Left (L). SpeakerL // SpeakerR is Right (R). SpeakerR // SpeakerC is Center (C). SpeakerC // SpeakerLfe is Subbass (Lfe). SpeakerLfe // SpeakerLs is Left Surround (Ls). SpeakerLs // SpeakerRs is Right Surround (Rs). SpeakerRs // SpeakerLc is Left of Center (Lc). SpeakerLc // SpeakerRc is Right of Center (Rc). SpeakerRc // SpeakerS is Surround (S). SpeakerS // SpeakerCs is Center of Surround (Cs) = Surround (S). SpeakerCs = SpeakerS // SpeakerSl is Side Left (Sl). SpeakerSl // SpeakerSr is Side Right (Sr). SpeakerSr // SpeakerTm is Top Middle (Tm). SpeakerTm // SpeakerTfl is Top Front Left (Tfl). SpeakerTfl // SpeakerTfc is Top Front Center (Tfc). SpeakerTfc // SpeakerTfr is Top Front Right (Tfr). SpeakerTfr // SpeakerTrl is Top Rear Left (Trl). SpeakerTrl // SpeakerTrc is Top Rear Center (Trc). SpeakerTrc // SpeakerTrr is Top Rear Right (Trr). SpeakerTrr // SpeakerLfe2 is Subbass 2 (Lfe2). SpeakerLfe2 )
const (
// EffectMagic is constant in every plugin.
EffectMagic = "VstP"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DoubleBuffer ¶
type DoubleBuffer struct {
// contains filtered or unexported fields
}
DoubleBuffer is a samples buffer for VST ProcessDouble function. C requires all buffer channels to be coallocated. This differs from Go slices.
func NewDoubleBuffer ¶
func NewDoubleBuffer(numChannels, bufferSize int) DoubleBuffer
NewDoubleBuffer allocates new memory for C-compatible buffer.
func (DoubleBuffer) CopyFrom ¶
func (b DoubleBuffer) CopyFrom(s signal.Float64)
CopyFrom copies values from signal.Float64. If dimensions differ - the lesser used.
func (DoubleBuffer) CopyTo ¶
func (b DoubleBuffer) CopyTo(s signal.Float64)
CopyTo copies values to signal.Float64 buffer. If dimensions differ - the lesser used.
type EffectFlags ¶
type EffectFlags int32
EffectFlags values.
const ( // EffFlagsHasEditor is set if the plugin provides a custom editor. EffFlagsHasEditor EffectFlags = 1 << iota // EffFlagsCanReplacing is set if plugin supports replacing process mode. EffFlagsCanReplacing // EffFlagsProgramChunks is set if preset data is handled in formatless chunks. EffFlagsProgramChunks // EffFlagsIsSynth is set if plugin is a synth. EffFlagsIsSynth // EffFlagsNoSoundInStop is set if plugin does not produce sound when input is silence. EffFlagsNoSoundInStop // EffFlagsCanDoubleReplacing is set if plugin supports double precision processing. EffFlagsCanDoubleReplacing )
type EffectOpcode ¶
type EffectOpcode uint64
EffectOpcode is sent by host in dispatch call to effect. It relfects AEffectOpcodes and AEffectXOpcodes opcodes values.
const ( // EffOpen passed to open the plugin. EffOpen EffectOpcode = iota // EffClose passed to close the plugin. EffClose // EffSetProgram passed to set program. // Value: new program number. EffSetProgram // EffGetProgram passed to get program. // Return: current program number. EffGetProgram // EffSetProgramName passed to set new program name. // Ptr: *[maxProgNameLen]uint8 buffer with new program name. EffSetProgramName // EffGetProgramName passed to get current program name. // Ptr: *[maxProgNameLen]uint8 buffer for current program name. EffGetProgramName // EffGetParamLabel passed to get parameter unit label: "db", "ms", etc. // Index: parameter index. // Ptr: *[maxParamStrLen]uint8 buffer for parameter unit label. EffGetParamLabel // EffGetParamDisplay passed to get parameter value label: "0.5", "HALL", etc. // Index: parameter index. // Ptr: *[maxParamStrLen]uint8 buffer for parameter value label. EffGetParamDisplay // EffGetParamName passed to get parameter label: "Release", "Gain", etc. // Index: parameter index. // Ptr: *[maxParamStrLen]uint8 buffer for parameter label. EffGetParamName // EffSetSampleRate passed to set new sample rate. // Opt: new sample rate value. EffSetSampleRate // EffSetBufferSize passed to set new buffer size. // Value: new buffer size value. EffSetBufferSize // EffStateChanged passed when plugin's state changed. // Value: 0 means disabled, 1 means enabled. EffStateChanged // EffEditGetRect passed to get editor size. // Ptr: ERect** receiving pointer to editor size. EffEditGetRect // EffEditOpen passed to get system dependent window pointer, eg HWND on Windows. // Ptr: window pointer. EffEditOpen // EffEditClose passed to close editor window. EffEditClose // EffEditIdle passed to notify effect that host goes idle. EffEditIdle // EffGetChunk passed to get chunk data. // Ptr: pointer for chunk data address (void**) uint8. // Index: 0 for bank, 1 for program. // Return: length of data. EffGetChunk // EffSetChunk passed to set chunk data. // Ptr: pointer for chunk data address (void*). // Value: data size in bytes. // Index: 0 for bank, 1 for program. EffSetChunk // EffProcessEvents passed to communicate events. // Ptr: *Events. EffProcessEvents // EffCanBeAutomated passed to check if parameter could be automated. // Index: parameter index. // Return: 1 for true, 0 for false. EffCanBeAutomated // EffString2Parameter passed to convert parameter value to string: "mono" to "1". // Index: parameter index. // Ptr: parameter string. // Return: true for success. EffString2Parameter // EffGetProgramNameIndexed passed to get program name by index. // Index: program index. // Ptr: *[maxProgNameLen]uint8 buffer for program name. // Return: true for success. EffGetProgramNameIndexed // EffGetInputProperties passed to check if certain input configuration is supported. // Index: input index. // Ptr: *PinProperties. // Return: 1 if supported. EffGetInputProperties // EffGetOutputProperties passed to check if certain output configuration is supported. // Index: output index. // Ptr: *PinProperties. // Return: 1 if supported. EffGetOutputProperties // EffGetPlugCategory passed to get plugin's category. // Return: VstPlugCategory value. EffGetPlugCategory // EffOfflineNotify passed to notify about offline file processing. // Ptr: []AudioFile. // Value: count. // Index: start flag. EffOfflineNotify // EffOfflinePrepare passed to trigger offline processing preparation. // Ptr: []OfflineTask. // Value: count. EffOfflinePrepare // EffOfflineRun passed to trigger offline processing execution. // Ptr: []OfflineTask. // Value: count. EffOfflineRun // EffProcessVarIo passed to provide variable I/O processing (offline e.g. timestretching). // Ptr: *VariableIo. EffProcessVarIo // EffSetSpeakerArrangement passed to set speakers configuration. // Value: input *SpeakerArrangement. // Ptr: output *SpeakerArrangement. EffSetSpeakerArrangement // EffSetBypass passed to make effect bypassed. // Value: 1 is bypass, 0 is no bypass. EffSetBypass // EffGetEffectName passed to get a name of the effect. // Ptr: *[maxEffectNameLen]uint8 buffer for effect name. EffGetEffectName // EffGetVendorString passed to get vendor string. // *[maxVendorStrLen]uint8 buffer for effect vendor string. EffGetVendorString // EffGetProductString passed to get product string. // *[maxProductStrLen]uint8 buffer for effect product string. EffGetProductString // EffGetVendorVersion passed to get vendor-specific version. // Return: vendor-specific version. EffGetVendorVersion // EffVendorSpecific passed to get vendor-specific string. // No definition, vendor specific handling. EffVendorSpecific // EffCanDo passed to check capabilities of effect. // Ptr: "can do" string // Return: 0 is don't know, -1 is no, 1 is yes. EffCanDo // EffGetTailSize passed to check if "tail" data is expected. // Return: tail size (e.g. reverb time). 0 is defualt, 1 means no tail. EffGetTailSize // EffGetParameterProperties passed to get parameter's properties. // Index: parameter index. // Ptr: *ParameterProperties. // Return: 1 if supported EffGetParameterProperties // EffGetVstVersion passed to get VST version of effect. // Return: VST version, 2400 for VST 2.4. EffGetVstVersion // EffEditKeyDown passed when key is pressed. // Index: ASCII character. // Value: virtual key. // Opt: ModifierKey flags. // Return: 1 if key used. EffEditKeyDown // EffEditKeyUp passed when key is released. // Index: ASCII character. // Value: virtual key. // Opt: ModifierKey flags. // Return: 1 if key used. EffEditKeyUp // EffSetEditKnobMode passed to set knob Mode. // Value: knob mode 0 is circular, 1 is circular relative, 2 is linear. EffSetEditKnobMode // EffGetMidiProgramName passed to get a name of used MIDI program. // Index: MIDI channel. // Ptr: *MidiProgramName. // Return: number of used programs, 0 if unsupported. EffGetMidiProgramName // EffGetCurrentMidiProgram passed to get a name of current MIDI program. // Index: MIDI channel. // Ptr: *MidiProgramName. // Return: index of current program . EffGetCurrentMidiProgram // EffGetMidiProgramCategory passed to get a category of MIDI program. // Index: MIDI channel. // Ptr: *MidiProgramCategory. // Return: number of used categories, 0 if unsupported. EffGetMidiProgramCategory // EffHasMidiProgramsChanged passed to check if MIDI program has changed. // Index: MIDI channel. // Return: 1 if the MidiProgramNames or MidiKeyNames have changed. EffHasMidiProgramsChanged // EffGetMidiKeyName passed to // Index: MIDI channel. // Ptr: *MidiKeyName. // Return: true if supported, false otherwise. EffGetMidiKeyName // EffBeginSetProgram passed before preset is loaded. EffBeginSetProgram // EffEndSetProgram passed after preset is loaded. EffEndSetProgram // EffGetSpeakerArrangement passed to get a speaker configuration of plugin. // Value: input *SpeakerArrangement. // Ptr: output *SpeakerArrangement. EffGetSpeakerArrangement // EffShellGetNextPlugin passed to get unique id of next plugin. // Ptr: *[maxProductStrLen]uint8 buffer for plug-in name. // Return: next plugin's unique ID. EffShellGetNextPlugin // EffStartProcess passed to indicate that the process call might be interrupted. EffStartProcess // EffStopProcess passed to indicate that process call is stopped. EffStopProcess // EffSetTotalSampleToProcess passed to identify a number of samples to process. // Value: number of samples to process. Called in offline mode before processing. EffSetTotalSampleToProcess // EffSetPanLaw passed to set pan law type and gain values. // Value: PanLawType value. // Opt: gain value. EffSetPanLaw // EffBeginLoadBank is passed when VST bank loaded. // Ptr: *PatchChunkInfo. // Return: -1 is bank can't be loaded, 1 is bank can be loaded, 0 is unsupported. EffBeginLoadBank // EffBeginLoadProgram is passed when VST preset loaded. // Ptr: *PatchChunkInfo. // Return: -1 is bank can't be loaded, 1 is bank can be loaded, 0 is unsupported. EffBeginLoadProgram // EffSetProcessPrecision passed to set processing precision. // Value: 0 if 32 bit, anything else if 64 bit. EffSetProcessPrecision // EffGetNumMidiInputChannels passed to get a number of used MIDI inputs. // Return: number of used MIDI input channels (1-15). EffGetNumMidiInputChannels // EffGetNumMidiOutputChannels passed to get a number of used MIDI outputs. // Return: number of used MIDI output channels (1-15). EffGetNumMidiOutputChannels )
func (EffectOpcode) String ¶
func (i EffectOpcode) String() string
type FloatBuffer ¶
type FloatBuffer struct {
// contains filtered or unexported fields
}
FloatBuffer is a samples buffer for VST Process function. It should be used only if plugin doesn't support EffFlagsCanDoubleReplacing.
func NewFloatBuffer ¶
func NewFloatBuffer(numChannels, bufferSize int) FloatBuffer
NewFloatBuffer allocates new memory for C-compatible buffer.
func (FloatBuffer) CopyFrom ¶
func (b FloatBuffer) CopyFrom(s signal.Float64)
CopyFrom copies values from signal.Float64. If dimensions differ - the lesser used.
func (FloatBuffer) CopyTo ¶
func (b FloatBuffer) CopyTo(s signal.Float64)
CopyTo copies values to signal.Float64 buffer. If dimensions differ - the lesser used.
type HostCallbackFunc ¶
HostCallbackFunc used as callback function called by plugin. Use closure wrapping technique to add more types to callback.
type HostOpcode ¶
type HostOpcode uint64
HostOpcode is sent by plugin in dispatch call to host. It relfects AudioMasterOpcodes and AudioMasterOpcodesX opcodes values.
const ( // HostAutomate passed to when parameter value is automated. // Index: parameter index. // Opt: parameter value. HostAutomate HostOpcode = iota // HostVersion passed to get VST version of host. // Return: host VST version (for example 2400 for VST 2.4). HostVersion // HostCurrentID passed when unique ID is requested. // Return: current unique identifier on shell plug-in. HostCurrentID // HostIdle passed to indicate that plugin does some modal action. HostIdle // HostGetTime passed when plugin needs time info. // Return: *TimeInfo or null if not supported. // Value: request mask. HostGetTime // HostProcessEvents passed when plugin has MIDI events to process. // Ptr: *Events the events to be processed. // Return: 1 if supported and processed. HostProcessEvents // HostIOChanged passed when plugin's IO setup has changed. // Return: 1 if supported. HostIOChanged // HostSizeWindow passed when host needs to resize plugin window. // Index: new width. // Value: new height. HostSizeWindow // HostGetSampleRate passed when plugin needs sample rate. // Return: current sample rate. HostGetSampleRate // HostGetBlockSize passed when plugin needs buffer size. // Return: current buffer size. HostGetBlockSize // HostGetInputLatency passed when plugin needs input latency. // Return: input latency in samples. HostGetInputLatency // HostGetOutputLatency passed when plugin needs output latency. // Return: output latency in samples. HostGetOutputLatency // HostGetCurrentProcessLevel passed to get current process level. // Return: ProcessLevel value. HostGetCurrentProcessLevel // HostGetAutomationState passed to get current automation state. // Return: AutomationState value. HostGetAutomationState // HostOfflineStart is sent when plugin is ready for offline processing. // Index: number of new audio files. // Value: number of audio files. // Ptr: *AudioFile the host audio files. Flags can be updated from plugin. HostOfflineStart // HostOfflineRead is sent when plugin reads the data. // Index: boolean - if this value is true then the host will read the original // file's samples, but if it is false it will read the samples which the plugin // has written via HostOfflineWrite. // Value: see OfflineOption // Ptr: *OfflineTask describing the task. // Return: 1 on success. HostOfflineRead // HostOfflineWrite is sent when plugin writes the data. // Value: see OfflineOption // Ptr: *OfflineTask describing the task. HostOfflineWrite // HostOfflineGetCurrentPass is unknown. HostOfflineGetCurrentPass // HostOfflineGetCurrentMetaPass is unknown. HostOfflineGetCurrentMetaPass // HostGetVendorString is sent to get host vendor string. // Ptr: *[maxVendorStrLen]uint8 buffer for host vendor name. HostGetVendorString // HostGetProductString is sent to get host product string. // Ptr: *[maxProductStrLen]uint8 buffer for host product name. HostGetProductString // HostGetVendorVersion is sent to get host version. // Return: vendor-specific version. HostGetVendorVersion // HostVendorSpecific is sent vendor-specific handling. HostVendorSpecific // HostCanDo passed to check capabilities of host. // Ptr: "can do" string // Return: 0 is don't know, -1 is no, 1 is yes. HostCanDo // HostGetLanguage passed to get a language of the host. // Return: HostLanguage value. HostGetLanguage // HostGetDirectory passed to get the current directory. // Return: *[]uint8 with path. HostGetDirectory // HostUpdateDisplay passed to request host screen refresh. HostUpdateDisplay // HostBeginEdit passed to notify host that it should capture parameter changes. // Index: index of the control. // Return: true on success. HostBeginEdit // HostEndEdit passed to notify that control is no longer being changed. // Index: index of the control. // Return: true on success. HostEndEdit // HostOpenFileSelector passed to open the host file selector. // Ptr: *FileSelect. // Return: true on success. HostOpenFileSelector // HostCloseFileSelector passed to close the host file selector. // Ptr: *FileSelect. HostCloseFileSelector )
func (HostOpcode) String ¶
func (i HostOpcode) String() string
type Plugin ¶
Plugin is VST2 plugin instance.
func (*Plugin) CanProcessFloat32 ¶
CanProcessFloat32 checks if plugin can process float32.
func (*Plugin) CanProcessFloat64 ¶
CanProcessFloat64 checks if plugin can process float64.
func (*Plugin) ProcessDouble ¶
func (p *Plugin) ProcessDouble(in, out DoubleBuffer)
ProcessDouble audio with VST plugin.
func (*Plugin) ProcessFloat ¶
func (p *Plugin) ProcessFloat(in, out FloatBuffer)
ProcessFloat audio with VST plugin.
func (*Plugin) SetBufferSize ¶
SetBufferSize sets a buffer size
func (*Plugin) SetSampleRate ¶
SetSampleRate sets a sample rate for plugin
func (*Plugin) SetSpeakerArrangement ¶
func (p *Plugin) SetSpeakerArrangement(in, out *SpeakerArrangement)
SetSpeakerArrangement creates and passes SpeakerArrangement structures to plugin
type PluginOpcode ¶
type PluginOpcode struct { Opcode EffectOpcode Index Index Value Value Ptr Ptr Opt Opt }
type ProcessLevels ¶
type ProcessLevels int32
ProcessLevels are used as result for in HostGetCurrentProcessLevel call. It tells the plugin in which thread host is right now.
const ( // ProcessLevelUnknown is returned when not supported by host. ProcessLevelUnknown ProcessLevels = iota // ProcessLevelUser is returned when in user thread (GUI). ProcessLevelUser // ProcessLevelRealtime is returned when in audio thread (where process is called). ProcessLevelRealtime // ProcessLevelPrefetch is returned when in sequencer thread (MIDI, timer etc). ProcessLevelPrefetch // ProcessLevelOffline is returned when in offline processing and thus in user thread. ProcessLevelOffline )
type Processor ¶
type Processor struct { VST // contains filtered or unexported fields }
Processor represents vst2 sound processor
type SMPTEFrameRate ¶
type SMPTEFrameRate int32
SMPTEFrameRate values, used in TimeInfo.
const ( // SMPTE24fps is 24 fps. SMPTE24fps SMPTEFrameRate = iota // SMPTE25fps is 25 fps. SMPTE25fps // SMPTE2997fps is 29.97 fps. SMPTE2997fps // SMPTE30fps is 30 fps. SMPTE30fps // SMPTE2997dfps is 29.97 drop. SMPTE2997dfps // SMPTE30dfps is 30 drop. SMPTE30dfps // SMPTEFilm16mm is Film 16mm. SMPTEFilm16mm // SMPTEFilm35mm is Film 35mm. SMPTEFilm35mm // SMPTE239fps is HDTV 23.976 fps. SMPTE239fps // SMPTE249fps is HDTV 24.976 fps. SMPTE249fps // SMPTE599fps is HDTV 59.94 fps. SMPTE599fps // SMPTE60fps is HDTV 60 fps. SMPTE60fps )
type Speaker ¶
type Speaker struct { Azimuth float32 Elevation float32 Radius float32 Reserved float32 Name [64]byte Type SpeakerType Future [28]byte }
Speaker configuration.
type SpeakerArrangement ¶
type SpeakerArrangement struct { Type SpeakerArrangementType NumChannels int32 Speakers [8]Speaker }
SpeakerArrangement contains information about a channel.
func (*SpeakerArrangement) Ptr ¶
func (sa *SpeakerArrangement) Ptr() Ptr
Ptr cast used in EffSetSpeakerArrangement call.
func (*SpeakerArrangement) Value ¶
func (sa *SpeakerArrangement) Value() Value
Value cast used in EffSetSpeakerArrangement call.
type SpeakerArrangementType ¶
type SpeakerArrangementType int32
SpeakerArrangementType indicates how the channels are intended to be used in the plugin. Only useful for some hosts.
const ( // SpeakerArrUserDefined is user defined. SpeakerArrUserDefined SpeakerArrangementType = iota - 2 // SpeakerArrEmpty is empty arrangement. SpeakerArrEmpty // SpeakerArrMono is M. SpeakerArrMono // SpeakerArrStereo is L R. SpeakerArrStereo // SpeakerArrStereoSurround is Ls Rs. SpeakerArrStereoSurround // SpeakerArrStereoCenter is Lc Rc. SpeakerArrStereoCenter // SpeakerArrStereoSide is Sl Sr. SpeakerArrStereoSide // SpeakerArrStereoCLfe is C Lfe. SpeakerArrStereoCLfe // SpeakerArr30Cine is L R C. SpeakerArr30Cine // SpeakerArr30Music is L R S. SpeakerArr30Music // SpeakerArr31Cine is L R C Lfe. SpeakerArr31Cine // SpeakerArr31Music is L R Lfe S. SpeakerArr31Music // SpeakerArr40Cine is L R C S (LCRS). SpeakerArr40Cine // SpeakerArr40Music is L R Ls Rs (Quadro). SpeakerArr40Music // SpeakerArr41Cine is L R C Lfe S (LCRS+Lfe). SpeakerArr41Cine // SpeakerArr41Music is L R Lfe Ls Rs (Quadro+Lfe). SpeakerArr41Music // SpeakerArr50 is L R C Ls Rs. SpeakerArr50 // SpeakerArr51 is L R C Lfe Ls Rs. SpeakerArr51 // SpeakerArr60Cine is L R C Ls Rs Cs. SpeakerArr60Cine // SpeakerArr60Music is L R Ls Rs Sl Sr. SpeakerArr60Music // SpeakerArr61Cine is L R C Lfe Ls Rs Cs. SpeakerArr61Cine // SpeakerArr61Music is L R Lfe Ls Rs Sl Sr. SpeakerArr61Music // SpeakerArr70Cine is L R C Ls Rs Lc Rc. SpeakerArr70Cine // SpeakerArr70Music is L R C Ls Rs Sl Sr. SpeakerArr70Music // SpeakerArr71Cine is L R C Lfe Ls Rs Lc Rc. SpeakerArr71Cine // SpeakerArr71Music is L R C Lfe Ls Rs Sl Sr. SpeakerArr71Music // SpeakerArr80Cine is L R C Ls Rs Lc Rc Cs. SpeakerArr80Cine // SpeakerArr80Music is L R C Ls Rs Cs Sl Sr. SpeakerArr80Music // SpeakerArr81Cine is L R C Lfe Ls Rs Lc Rc Cs. SpeakerArr81Cine // SpeakerArr81Music is L R C Lfe Ls Rs Cs Sl Sr. SpeakerArr81Music // SpeakerArr102 is L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2. SpeakerArr102 )
type TimeInfo ¶
type TimeInfo struct { // Current Position in audio samples. SamplePos float64 // Current Sample Rate in Herz. SampleRate float64 // System Time in nanoseconds. NanoSeconds float64 // Musical Position, in Quarter Note (1.0 equals 1 Quarter Note). PpqPos float64 // Current Tempo in BPM (Beats Per Minute). Tempo float64 // Last Bar Start Position, in Quarter Note. BarStartPos float64 // Cycle Start (left locator), in Quarter Note. CycleStartPos float64 // Cycle End (right locator), in Quarter Note. CycleEndPos float64 // Time Signature Numerator (e.g. 3 for 3/4). TimeSigNumerator int32 // Time Signature Denominator (e.g. 4 for 3/4). TimeSigDenominator int32 // SMPTE offset in SMPTE subframes (bits; 1/80 of a frame). // The current SMPTE position can be calculated using SamplePos, SampleRate, and SMPTEFrameRate. SMPTEOffset int32 // SMPTEFrameRate value. SMPTEFrameRate // MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest clock). SamplesToNextClock int32 // TimeInfoFlags values. Flags TimeInfoFlags }
TimeInfo describes the time at the start of the block currently being processed.
type TimeInfoFlags ¶
type TimeInfoFlags int32
TimeInfoFlags used in TimeInfo.
const ( // TransportChanged is set if play, cycle or record state has changed. TransportChanged TimeInfoFlags = 1 << iota // TransportPlaying is set if Host sequencer is currently playing TransportPlaying // TransportCycleActive is set if Host sequencer is in cycle mode. TransportCycleActive // TransportRecording is set if Host sequencer is in record mode. TransportRecording // AutomationWriting is set if automation write mode active. AutomationWriting // AutomationReading is set if automation read mode active. AutomationReading // NanosValid is set if TimeInfo.NanoSeconds are valid. NanosValid // PpqPosValid is set if TimeInfo.PpqPos is valid. PpqPosValid // TempoValid is set if TimeInfo.Tempo is valid. TempoValid // BarsValid is set if TimeInfo.BarStartPos is valid. BarsValid // CyclePosValid is set if both TimeInfo.CycleStartPos and TimeInfo.CycleEndPos are valid. CyclePosValid // TimeSigValid is set if both TimeInfo.TimeSigNumerator and TimeInfo.TimeSigDenominator are valid. TimeSigValid // SMPTEValid is set if both TimeInfo.SMPTEOffset and TimeInfo.SMPTEFrameRate are valid. SMPTEValid // ClockValid is set if TimeInfo.SamplesToNextClock are valid. ClockValid )
type VST ¶
type VST struct { Name string Path string DispatchBeforeStart []PluginOpcode // contains filtered or unexported fields }
VST used to create new instances of plugin. It also keeps reference to VST handle to clean up on Close.
func (VST) Load ¶
func (v VST) Load(c HostCallbackFunc) *Plugin
Load new instance of VST plugin with provided callback. This function also calls dispatch with EffOpen opcode.