Artifact [ce8b4cb84a]
Not logged in

Artifact ce8b4cb84a42bcea2e87bad84a276e5b6d3b8694:

Wiki page [Muzic MIDI sound package] by chw 2017-11-09 13:03:11.
D 2017-11-09T13:03:11.671
L Muzic\sMIDI\ssound\spackage
P ab33252ff9cc7e5e559fbd3f6f8d18b63482e24e
U chw
W 2108
<h2>Name</h2>

<b>muzic</b> - a MIDI sound package compatible with <a href="http://wiki.tcl.tk/14652">Muzic</a>.

<h2>Synopsis</h2>

<tt>package require Muzic</tt><br>
<tt>muzic::<i>subcommand</i> ...</tt>

<h2>Description</h2>

<b>muzic</b> is a Tcl music interface to the Sonivox MIDI rendering (software synthesis) library on Android. The original package was developed by Steve Landers and is Copyright (c) 2005 Eolas Technologies Inc. It is released under a Tcl/BSD style license.

To use Muzic, no special provisions are needed, since it is fully integrated in [AndroWish].

The Muzic API contains just five procedures:

<tt>muzic::init</tt>

    Must be called once to initialize audio playback.

<tt>muzic::soundfont </i>file</i></tt>

    This command exists for compatibility with the original package. It can be called with no arguments or with <tt>builtin</tt>. Everything else throws an error since the Android software synthesizer has no support for SoundFont files.

<tt>muzic::channel <i>channel instrument</i></tt>

    Assigns an instrument to a channel. <tt><i>channel</i></tt> is an integer  from 0 to 15 identifying the MIDI channel. <tt><i>instrument</tt> is the instrument number, typically a MIDI instrument number from 0 to 127.

<tt>muzic::playnote <i>channel pitch volume ?duration?</i></tt>

    Plays a note on specified <tt><i>channel</i></tt>, at specified <tt><i>pitch</i></tt> and <tt><i>volume</i></tt>. The pitch is the raw MIDI pitch, as per the general midi standard - where middle C is 60 (see <a href="http://www.mozart.co.uk/information/articles/midinote.htm">http://www.mozart.co.uk/information/articles/midinote.htm</a> which has a table of MIDI pitch values). <tt><i>volume</i></tt> is a number between 0 and 100. <tt><i>duration</i></tt> is optional, and defaults to 500 (i.e. 500 ms). If a negative duration is given, the note is played continuously. If a volume of zero is given, playback of the note ends.

<tt>muzic::close</tt>

    To be called when MIDI audio playback shall be stopped in order to conserve battery power.

Z f672e0feab646284f4b77dea5fc311a6