Artifact [ab33252ff9]
Not logged in

Artifact ab33252ff9cc7e5e559fbd3f6f8d18b63482e24e:

Wiki page [Muzic MIDI sound package] by chw 2017-01-15 12:00:50.
D 2017-01-15T12:00:50.577
L Muzic\sMIDI\ssound\spackage
P 1ec6f71bec0bb5dc2f547090e9feac253e3ffc65
U chw
W 2086
<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 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 </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 423cd4d540b71182f6673d6cdc9d9385