Artifact 6ed39b268e1b789d9b29caed6709419483d54dff:
Wiki page
[
Muzic MIDI sound package] by
chw
2019-04-26 06:41:44.
D 2019-04-26T06:41:44.419
L Muzic\sMIDI\ssound\spackage
P ce8b4cb84a42bcea2e87bad84a276e5b6d3b8694
U chw
W 2134
<h2>muzic command</h2>
<h3>Name</h3>
<b>muzic</b> - a MIDI sound package compatible with <a href="http://wiki.tcl.tk/14652">Muzic</a>.
<h3>Synopsis</h3>
<tt>package require Muzic</tt><br>
<tt>muzic::<i>subcommand</i> ...</tt>
<h3>Description</h3>
<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 7f7df5bcb9b0f1b5d4dd0423c61c781a