Sophie

Sophie

distrib > Mandriva > 8.0 > i586 > media > main > by-pkgid > 6a3ae4e037535c68bd8a5fcce387b3cb > files > 756

kdemultimedia-2.1.1-5mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>Mapped Instruments</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
"><LINK
REL="HOME"
TITLE="The aRts Handbook"
HREF="index.html"><LINK
REL="UP"
TITLE="MIDI"
HREF="midi.html"><LINK
REL="PREVIOUS"
TITLE="Creating Instruments"
HREF="midi-creating-instruments.html"><LINK
REL="NEXT"
TITLE="MCOP: Object Model and Streaming"
HREF="mcop.html"><META
HTTP-EQUIV="Content-Style-Type"
CONTENT="text/css"><LINK
REL="stylesheet"
HREF="common/kde-common.css"
TYPE="text/css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=iso-8859-1"><META
HTTP-EQUIV="Content-Language"
CONTENT="en"><LINK
REL="stylesheet"
HREF="common/kde-localised.css"
TYPE="text/css"
TITLE="KDE-English"><LINK
REL="stylesheet"
HREF="common/kde-default.css"
TYPE="text/css"
TITLE="KDE-Default"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#AA0000"
VLINK="#AA0055"
ALINK="#AA0000"
STYLE="font-family: sans-serif;"
><DIV
CLASS="logoheader"
><A
HREF="http://www.kde.org/"
><IMG
SRC="common/logotp3.png"
BORDER="0"
ALT="The K Desktop Environment"
HEIGHT="62"
WIDTH="229"></A
></DIV
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The <SPAN
CLASS="APPLICATION"
>aRts</SPAN
> Handbook</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="midi-creating-instruments.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 5. <SPAN
CLASS="ACRONYM"
>MIDI</SPAN
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="mcop.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="MAPPED-INSTRUMENTS"
>5.6. Mapped Instruments</A
></H1
><P
>Mapped instruments are instruments, that behave differently depending
on the pitch, the program, the channel or the velocity. You could for instance
build a piano of 5 octaves, using one sample for each octave (pitchshifting
it accordingly). That sounds a whole lot better than only using one sample.</P
><P
>You could also build a drum map, that plays one specific drum sample per
key.</P
><P
>Finally, it is very useful if you put quite some different sounds into
one mapped instrument on different programs. That way, you can use your
sequencer, external keyboard or other midi source to switch between the sounds
without having to tweak aRts as you work. A good example for this is the
instrument "arts_all", which just puts together all instruments that come
with aRts in one map. That way, you just need to setup once in aRtscontrol to
use this "instrument", and then, you can compose a whole song in a sequencer
without ever bothering about aRts. Need another sound? Simply change the
program in the sequencer, and aRts will give you another sound.</P
><P
>Creating such maps is pretty straightforward. You just need to create a
textfile, and write rules which look like this:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>   1&nbsp;ON <TT
CLASS="REPLACEABLE"
><I
>[ conditions ...]</I
></TT
> DO structure=<TT
CLASS="REPLACEABLE"
><I
>somestructure</I
></TT
>.arts</PRE
></TD
></TR
></TABLE
></P
><P
>The conditions could be one or more than one of the following</P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>pitch</DT
><DD
><P
>  The pitch that is being played. You would use this if you want to split
  your instrument depending on the pitch. In our initial examples, a piano
  which uses different samples for different octaves would use this as
  condition. You can specify a single pitch, like
  pitch=<TT
CLASS="REPLACEABLE"
><I
>62</I
></TT
> or a range of pitches, like
  pitch=<TT
CLASS="REPLACEABLE"
><I
>60</I
></TT
>-<TT
CLASS="REPLACEABLE"
><I
>72</I
></TT
>.
  The possible pitches are between 0 and 127.
  </P
></DD
><DT
>program</DT
><DD
><P
>  The program that is active on the channel that the note is being sent on.
  Usually, sequencers let you choose the "instrument" via the program setting.
  Single programs or ranges are allowed, that is
  program=<TT
CLASS="REPLACEABLE"
><I
>3</I
></TT
> or
  program=<TT
CLASS="REPLACEABLE"
><I
>3</I
></TT
>-<TT
CLASS="REPLACEABLE"
><I
>6</I
></TT
>.
  The possible programs are between 0 and 127.
  </P
></DD
><DT
>channel</DT
><DD
><P
>  The channel that that the note is being sent on. 
  Single channels or ranges are allowed, that is
  channel=<TT
CLASS="REPLACEABLE"
><I
>0</I
></TT
> or
  channel=<TT
CLASS="REPLACEABLE"
><I
>0</I
></TT
>-<TT
CLASS="REPLACEABLE"
><I
>8</I
></TT
>.
  The possible channels are between 0 and 15.
  </P
></DD
><DT
>velocity</DT
><DD
><P
>  The velocity (volume) that that the note has.
  Single velocities (who would use that?) or ranges are allowed, that is
  velocity=<TT
CLASS="REPLACEABLE"
><I
>127</I
></TT
> or
  veclocity=<TT
CLASS="REPLACEABLE"
><I
>64</I
></TT
>-<TT
CLASS="REPLACEABLE"
><I
>127</I
></TT
>.
  The possible velocities are between 0 and 127.
  </P
></DD
></DL
></DIV
><P
>A complete example for a map would be (this is taken from the current
instrument_arts_all.arts-map):</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>   1&nbsp;ON program=0 DO structure=instrument_tri.arts
   2&nbsp;ON program=1 DO structure=instrument_organ2.arts
   3&nbsp;ON program=2 DO structure=instrument_slide1.arts
   4&nbsp;ON program=3 DO structure=instrument_square.arts
   5&nbsp;ON program=4 DO structure=instrument_neworgan.arts
   6&nbsp;ON program=5 DO structure=instrument_nokind.arts
   7&nbsp;ON program=6 DO structure=instrument_full_square.arts
   8&nbsp;ON program=7 DO structure=instrument_simple_sin.arts
   9&nbsp;ON program=8 DO structure=instrument_simple_square.arts
  10&nbsp;ON program=9 DO structure=instrument_simple_tri.arts
  11&nbsp;ON program=10 DO structure=instrument_slide.arts
  12&nbsp;ON program=11 pitch=60 DO structure=instrument_deepdrum.arts
  13&nbsp;ON program=11 pitch=61 DO structure=instrument_chirpdrum.arts</PRE
></TD
></TR
></TABLE
></P
><P
>As you see, the structure is choosen depending on the program. On
program 11, you see a "drum map" (with two entries), which would play
a "deepdrum" on C-5 (pitch=60), and a "chirpdrum" on C#5 (pitch=61).</P
><P
>To make map files automatically appear in artscontrol as choice for
the instrument, they have to be called
"instrument_<TT
CLASS="REPLACEABLE"
><I
>something</I
></TT
>.arts-map" and reside either
in your Home-Directory, under $HOME/arts/structures, or in the KDE directory
under $KDEDIR/usr/local/kde/share/apps/artsbuilder/examples. Structures that
are used by the map can either be given with an absolute path, or relative
to the directory the map file resides in.</P
><P
>Extending the arts_all map or even making a complete general midi map
for <SPAN
CLASS="APPLICATION"
>aRts</SPAN
> is a good idea for making <SPAN
CLASS="APPLICATION"
>aRts</SPAN
> easier to use out-of-the-box.
Please consider contributing interesting instruments you make, so that they
can be included in further version of <SPAN
CLASS="APPLICATION"
>aRts</SPAN
>.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="midi-creating-instruments.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="mcop.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Creating Instruments</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="midi.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>MCOP: Object Model and Streaming</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>