<h2>Name</h2>

<b>muzic</b> - a MIDI sound package compatible with <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 built-in software synthesizer of 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

    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

    Assigns an instrument to a channel. 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

    Plays a note on specified at specified and The pitch is the raw MIDI pitch, as per the general midi standard - where middle C is 60 (see <a which has a table of MIDI pitch values). is a number between 0 and 100. 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.