<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>vstinit</title> <link rel="stylesheet" type="text/css" href="csound.css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="vstedit.html" title="vstedit" /> <link rel="next" href="vstinfo.html" title="vstinfo" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">vstinit</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="vstedit.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="vstinfo.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="vstinit"> <a id="vstinit"></a> <div class="titlepage"></div> <a id="IndexVstInit" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">vstinit</span> </h2> <p>vstinit — Load a VST plugin into memory for use with the other vst4cs opcodes. </p> </div> <div class="refsect1" title="Syntax"> <a id="idp52993712"></a> <h2>Syntax</h2> <pre class="synopsis">instance <span class="command"><strong>vstinit</strong></span> ilibrarypath [,iverbose]</pre> </div> <div class="refsect1" title="Description"> <a id="idp52994808"></a> <h2>Description</h2> <p><span class="emphasis"><em>vstinit</em></span> is used to load a VST plugin into memory for use with the other vst4cs opcodes. Both VST effects and instruments (synthesizers) can be used.</p> </div> <div class="refsect1" title="Initialization"> <a id="idp52995792"></a> <h2>Initialization</h2> <p><span class="emphasis"><em>instance</em></span> - the number which identifies the plugin, to be passed to other vst4cs opcodes.</p> <p><span class="emphasis"><em>ilibrarypath</em></span> - the full path to the vst plugin shared library (DLL, on Windows). Remember to use '/' instead of '\' as separator.</p> <p><span class="emphasis"><em>iverbose</em></span> - show plugin information and parameters when loading.</p> </div> <div class="refsect1" title="Examples"> <a id="idp53033920"></a> <h2>Examples</h2> <p> Here is an example of the use of the <span class="emphasis"><em>vstinit</em></span> opcode. It uses the file <a class="ulink" href="examples/vst4cs.csd" target="_top"><em class="citetitle">vst4cs.csd</em></a>. </p> <div class="example"> <a id="idp53035120"></a> <p class="title"> <strong>Example 974. Example of the <span class="emphasis"><em>vstinit</em></span> opcode.</strong> </p> <div class="example-contents"> <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p> <pre class="programlisting"> <span class="csdtag"><CsoundSynthesizer></span> <span class="csdtag"><CsOptions></span> <span class="comment">; Credits: Adapted by Michael Gogins </span> <span class="comment">; from code by David Horowitz and Lian Cheung. </span> <span class="comment">; The "--displays" option is required in order for </span> <span class="comment">; the Pianoteq GUI to dispatch events and display properly.</span> -m3 --displays -odac <span class="csdtag"></CsOptions></span> <span class="csdtag"><CsInstruments></span> <span class="ohdr">sr</span> <span class="op">=</span> 44100 <span class="ohdr">ksmps</span> <span class="op">=</span> 20 <span class="ohdr">nchnls</span> <span class="op">=</span> 2 <span class="comment">; Load the Pianoteq into memory.</span> gipianoteq <span class="opc">vstinit</span> "C<span class="op">:</span>\\Program Files\\Steinberg\\VstPlugins\\Pianoteq 3.0 Trial\\Pianoteq30 Trial.dll", 1 <span class="comment">; Print information about the Pianoteq, such as parameter names and numbers.</span> <span class="opc">vstinfo</span> gipianoteq <span class="comment">; Open the Pianoteq's GUI.</span> <span class="opc">vstedit</span> gipianoteq <span class="comment">; Send notes from the score to the Pianoteq.</span> <span class="oblock">instr</span> 1 <span class="comment">; MIDI channels are numbered starting at 0.</span> <span class="comment">; p3 always contains the duration of the note.</span> <span class="comment">; p4 contains the MIDI key number (pitch),</span> <span class="comment">; p5 contains the MIDI velocity number (loudness),</span> imidichannel <span class="opc">init</span> 0 <span class="opc">vstnote</span> gipianoteq, imidichannel, p4, p5, p3 <span class="oblock">endin</span> <span class="comment">; Send parameter changes to the Pianoteq.</span> <span class="oblock">instr</span> 2 <span class="comment">; p4 is the parameter number.</span> <span class="comment">; p5 is the parameter value.</span> <span class="opc">vstparamset</span> gipianoteq, p4, p5 <span class="oblock">endin</span> <span class="comment">; Send audio from the Pianoteq to the output.</span> <span class="oblock">instr</span> 3 ablankinput <span class="opc">init</span> 0 aleft, aright <span class="opc">vstaudio</span> gipianoteq, ablankinput, ablankinput <span class="opc">outs</span> aleft, aright <span class="oblock">endin</span> <span class="csdtag"></CsInstruments></span> <span class="csdtag"><CsScore></span> <span class="comment">; Turn on the instrument that receives audio from the Pianoteq indefinitely.</span> <span class="stamnt">i</span> 3 0 -1 <span class="comment">; Send parameter changes to Pianoteq before sending any notes.</span> <span class="comment">; NOTE: All parameters must be between 0.0 and 1.0.</span> <span class="comment">; Length of piano strings:</span> <span class="stamnt">i</span> 2 0 1 33 0.5 <span class="comment">; Hammer noise:</span> <span class="stamnt">i</span> 2 0 1 25 0.1 <span class="comment">; Send a C major 7th arpeggio to the Pianoteq.</span> <span class="stamnt">i</span> 1 1 10 60 76 <span class="stamnt">i</span> 1 2 10 64 73 <span class="stamnt">i</span> 1 3 10 67 70 <span class="stamnt">i</span> 1 4 10 71 67 <span class="comment">; End the performance, leaving some time </span> <span class="comment">; for the Pianoteq to finish sending out its audio,</span> <span class="comment">; or for the user to play with the Pianoteq virtual keyboard.</span> <span class="stamnt">e</span> 20 <span class="csdtag"></CsScore></span> <span class="csdtag"></CsoundSynthesizer></span> </pre> </div> </div> <p><br class="example-break" /> </p> </div> <div class="refsect1" title="Credits"> <a id="idp53037560"></a> <h2>Credits</h2> <p>By: Andrés Cabrera and Michael Gogins</p> <p>Uses code from Hermann Seib's VSTHost and Thomas Grill's vst~ object.</p> <p>VST is a trademark of Steinberg Media Technologies GmbH. VST Plug-In Technology by Steinberg.</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="vstedit.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="vstinfo.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">vstedit </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> vstinfo</td> </tr> </table> </div> </body> </html>