<?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>fluidAllOut</title> <link rel="stylesheet" href="csound.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /> <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="FLupdate.html" title="FLupdate" /> <link rel="next" href="fluidCCi.html" title="fluidCCi" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">fluidAllOut</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="FLupdate.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="fluidCCi.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="fluidAllOut"> <a id="fluidAllOut"></a> <div class="titlepage"></div> <a id="IndexFluidAllOut" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">fluidAllOut</span> </h2> <p>fluidAllOut — Collects all audio from all Fluidsynth engines in a performance </p> </div> <div class="refsect1" title="Syntax"> <a id="id2896656"></a> <h2>Syntax</h2> <pre class="synopsis">aleft, aright <span class="command"><strong>fluidAllOut</strong></span></pre> </div> <div class="refsect1" title="Description"> <a id="id2897242"></a> <h2>Description</h2> <p>Collects all audio from all Fluidsynth engines in a performance </p> </div> <div class="refsect1" title="Performance"> <a id="id2897254"></a> <h2>Performance</h2> <p><span class="emphasis"><em>aleft</em></span> -- Left channel audio output.</p> <p><span class="emphasis"><em>aright</em></span> -- Right channel audio output.</p> <p>Invoke fluidAllOut in an instrument definition numbered higher than any fluidcontrol instrument definitions. All SoundFonts send their audio output to this one opcode. Send a note with an indefinite duration to this instrument to turn the SoundFonts on for as long as required.</p> <p>In this implementation, SoundFont effects such as chorus or reverb are used if and only if they are defaults for the preset. There is no means of turning such effects on or off, or of changing their parameters, from Csound.</p> </div> <div class="refsect1" title="Examples"> <a id="id2897296"></a> <h2>Examples</h2> <p> Here is an example of the fluidsynth opcodes. It uses the file <a class="ulink" href="examples/fluidAllOut.orc" target="_top"><em class="citetitle">fluidAllOut.orc</em></a>. </p> <pre class="programlisting"> <span class="ohdr">sr</span> <span class="op">=</span> 44100 <span class="ohdr">kr</span> <span class="op">=</span> 4410 <span class="ohdr">ksmps</span> <span class="op">=</span> 10 <span class="ohdr">nchnls</span> <span class="op">=</span> 2 <span class="ohdr">0dbfs</span> <span class="op">=</span> 32767 <span class="comment">; LOAD SOUNDFONTS</span> gienginenum1 <span class="opc">fluidEngine</span> gienginenum2 <span class="opc">fluidEngine</span> isfnum1 <span class="opc">fluidLoad</span> "Piano Steinway Grand Model C (21,738KB).sf2", gienginenum1, 1 <span class="comment">; Bright Steinway, program 1, channel 1</span> <span class="opc">fluidProgramSelect</span> gienginenum1, 1, isfnum1, 0, 1 <span class="comment">; Concert Steinway with reverb, program 2, channel 3</span> <span class="opc">fluidProgramSelect</span> gienginenum1, 3, isfnum1, 0, 2 isfnum2 <span class="opc">fluidLoad</span> "63.3mg The Sound Site Album Bank V1.0.SF2", gienginenum2, 1 <span class="comment">; General MIDI, program 50, channel 2</span> <span class="opc">fluidProgramSelect</span> gienginenum2, 2, isfnum2, 0, 50 <span class="comment">; SEND NOTES TO STEINWAY SOUNDFONT</span> <span class="oblock">instr</span> 1 <span class="comment">; FluidSynth Steinway Rev</span> <span class="comment">; INITIALIZATION</span> <span class="opc">mididefault</span> 60, p3 <span class="comment">; Default duration of 60 -- overridden by score.</span> <span class="opc">midinoteonkey</span> p4, p5 <span class="comment">; Channels MIDI input to pfields.</span> <span class="comment">; Use channel assigned in fluidload.</span> ichannel <span class="op">=</span> 1 ikey <span class="op">=</span> p4 ivelocity <span class="op">=</span> p5 istatus <span class="op">=</span> 144 <span class="opc">fluidControl</span> gienginenum1, istatus, ichannel, ikey, ivelocity <span class="oblock">endin</span> <span class="oblock">instr</span> 2 <span class="comment">; GM soundfont</span> <span class="comment">; INITIALIZATION</span> <span class="opc">mididefault</span> 60, p3 <span class="comment">; Default duration of 60 -- overridden by score.</span> <span class="opc">midinoteonkey</span> p4, p5 <span class="comment">; Channels MIDI input to pfields.</span> <span class="comment">; Use channel assigned in fluidload.</span> ichannel <span class="op">=</span> 2 ikey <span class="op">=</span> p4 ivelocity <span class="op">=</span> p5 istatus <span class="op">=</span> 144 <span class="opc">fluidNote</span> gienginenum2, ichannel, ikey, ivelocity <span class="oblock">endin</span> <span class="oblock">instr</span> 3 <span class="comment">; FluidSynth Steinway Rev</span> <span class="comment">; INITIALIZATION</span> <span class="opc">mididefault</span> 60, p3 <span class="comment">; Default duration of 60 -- overridden by score.</span> <span class="opc">midinoteonkey</span> p4, p5 <span class="comment">; Channels MIDI input to pfields.</span> <span class="comment">; Use channel assigned in fluidload.</span> ichannel <span class="op">=</span> 3 ikey <span class="op">=</span> p4 ivelocity <span class="op">=</span> p5 istatus <span class="op">=</span> 144 <span class="opc">fluidNote</span> gienginenum1, ichannel, ikey, ivelocity <span class="oblock">endin</span> <span class="comment">; COLLECT AUDIO FROM ALL SOUNDFONTS</span> <span class="oblock">instr</span> 100 <span class="comment">; Fluidsynth output</span> <span class="comment">; INITIALIZATION</span> <span class="comment">; Normalize so iamplitude for p5 of 80 == ampdb(80).</span> iamplitude <span class="op">=</span> ampdb(p5) <span class="op">*</span> (10000.0 <span class="op">/</span> 0.1) <span class="comment">; AUDIO</span> aleft, aright <span class="opc">fluidAllOut</span> <span class="opc">outs</span> aleft <span class="op">*</span> iamplitude, aright <span class="op">*</span> iamplitude <span class="oblock">endin</span> </pre> <p> Here is another more complex example of the fluidsynth opcodes written by Istvan Varga. It uses the file <a class="ulink" href="examples/fluidcomplex.csd" target="_top"><em class="citetitle">fluidcomplex.csd</em></a>. </p> <pre class="programlisting"> <span class="csdtag"><CsoundSynthesizer></span> <span class="csdtag"><CsOptions></span> <span class="comment">; Select audio/midi flags here according to platform</span> <span class="comment">; Audio out Audio in No messages Load external midi file</span> -d -m2 -o dac -T -F Anna.mid <span class="comment">;;;RT audio I/O</span> <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> 128 <span class="ohdr">nchnls</span> <span class="op">=</span> 2 <span class="ohdr">0dbfs</span> <span class="op">=</span> 1 <span class="comment">; Example by Istvan Varga</span> <span class="comment">; disable triggering of instruments by MIDI events</span> ichn <span class="op">=</span> 1 <span class="olabel">lp1</span><span class="op">:</span> <span class="ohdr">massign</span> ichn, 0 <span class="octrl">loop_le</span> ichn, 1, 16, <span class="olabel">lp1</span> <span class="ohdr">pgmassign</span> 0, 0 <span class="comment">; initialize FluidSynth</span> gifld <span class="opc">fluidEngine</span> gisf2 <span class="opc">fluidLoad</span> "07AcousticGuitar.sf2", gifld, 1 <span class="comment">; k-rate version of fluidProgramSelect</span> <span class="oblock">opcode</span> fluidProgramSelect_k, 0, kkkkk keng, kchn, ksf2, kbnk, kpre <span class="opc">xin</span> <span class="octrl">igoto</span> skipInit doInit<span class="op">:</span> <span class="opc">fluidProgramSelect</span> <span class="opc">i</span>(keng), <span class="opc">i</span>(kchn), <span class="opc">i</span>(ksf2), <span class="opc">i</span>(kbnk), <span class="opc">i</span>(kpre) <span class="opc">reinit</span> doInit <span class="opc">rireturn</span> skipInit<span class="op">:</span> <span class="oblock">endop</span> <span class="oblock">instr</span> 1 <span class="comment">; initialize channels</span> kchn <span class="opc">init</span> 1 <span class="octrl">if</span> (kchn <span class="op">==</span> 1) then <span class="olabel">lp2</span><span class="op">:</span> <span class="opc">fluidControl</span> gifld, 192, kchn <span class="op">-</span> 1, 0, 0 <span class="opc">fluidControl</span> gifld, 176, kchn <span class="op">-</span> 1, 7, 100 <span class="opc">fluidControl</span> gifld, 176, kchn <span class="op">-</span> 1, 10, 64 <span class="octrl">loop_le</span> kchn, 1, 16, <span class="olabel">lp2</span> <span class="octrl">endif</span> <span class="comment">; send any MIDI events received to FluidSynth</span> <span class="olabel">nxt</span><span class="op">:</span> kst, kch, kd1, kd2 <span class="opc">midiin</span> <span class="octrl">if</span> (kst <span class="op">!=</span> 0) then <span class="octrl">if</span> (kst <span class="op">!=</span> 192) then <span class="opc">fluidControl</span> gifld, kst, kch <span class="op">-</span> 1, kd1, kd2 <span class="octrl">else</span> fluidProgramSelect_k gifld, kch <span class="op">-</span> 1, gisf2, 0, kd1 <span class="octrl">endif</span> <span class="octrl">kgoto</span> <span class="olabel">nxt</span> <span class="octrl">endif</span> <span class="comment">; get audio output from FluidSynth</span> aL, aR <span class="opc">fluidOut</span> gifld <span class="opc">outs</span> aL, aR <span class="oblock">endin</span> <span class="csdtag"></CsInstruments></span> <span class="csdtag"><CsScore></span> <span class="stamnt">i</span> 1 0 3600 <span class="stamnt">e</span> <span class="csdtag"></CsScore></span> <span class="csdtag"></CsoundSynthesizer></span> </pre> </div> <div class="refsect1" title="See Also"> <a id="id2897343"></a> <h2>See Also</h2> <p><a class="link" href="fluidEngine.html" title="fluidEngine"><em class="citetitle">fluidEngine</em></a>, <a class="link" href="fluidNote.html" title="fluidNote"><em class="citetitle">fluidNote</em></a>, <a class="link" href="fluidLoad.html" title="fluidLoad"><em class="citetitle">fluidLoad</em></a></p> </div> <div class="refsect1" title="Credits"> <a id="id2897373"></a> <h2>Credits</h2> <p>Opcode by Michael Gogins (gogins at pipeline dot com). Thanks to Peter Hanappe for Fluidsynth, and to Steven Yi for seeing that it is necessary to break up the Fluidsynth into several different Csound opcodes.</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="FLupdate.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="fluidCCi.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">FLupdate </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> fluidCCi</td> </tr> </table> </div> </body> </html>