\documentstyle[a4,makeidx,verbatim,texhelp,fancyhea]{report}%
\parskip=10pt%
\parindent=0pt%
\title{The JAZZ midi sequencer}%
\author{Andreas Voss $<$andreas@avix.rhein-neckar.de$>$\\
Per Sigmond $<$Per.Sigmond@hia.no$>$}%
\date{December 1995}%
\makeindex%
\begin{document}%
\maketitle%
\pagestyle{fancyplain}%
\tableofcontents%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Introduction}\label{introduction}

jazz is a full size MIDI sequencer providing functions like record /
play and many edit functions as quantize, copy, transpose, graphical
pitch editing, ...  multiple undo. It has two main windows oprating on
whole tracks and single events.  There are special functions like
GS sound editing and random rhythm generation.

jazz is still under development, so this document may not be up to date,
see file CHANGELOG for latest changes.




\section{Supported platforms}\label{platforms}

jazz is known to run under Linux (xview and motif), Solaris (xview and
motif), SunOS4.1.x (xview) and MS-Windows.

jazz was developed using wxwin (a free platform independend GUI
library written by Juilian Smart). 

Beside its own drivers for Linux (MPU-401, intelligent mode only) and
MS-Windows (any midi card) jazz supports Hannu Savolainen's VoxWare 
drivers. These drivers are portable to other UNIXes and support many 
different midi cards.

Because of the client/server design of jazz's own driver, non-Linux Unix 
users are able to play/record by accessing a driver on a Linux machine
via the network (TCP/IP).

Please note, that jazz does {\em not} support patch loading for soundcards
at the moment. So you probably need a separate midi sound module unless
you have a very intelligent soundcard, that simulates a GS MIDI
equipment.




\section{Where to get it}\label{wheretoget}

The latest version of jazz is available at
{\tt ftp://rokke.grm.hia.no/pub/midi/jazz/}.
You are welcome to join the jazz mailing list by sending mail to 
{\tt jazz-users-request@hia.no}. with subject-field containing
{\tt subscribe}. Or you may look at the jazz homepage
at {\tt http://rokke.grm.hia.no/per/jazz.html}.

We'd be happy to receive your bugreports (well, somehow) or success
stories. And - of course - you are welcome to contribute to the jazz
project by sending code, suggestions, ..., or corrections for this
manual (I know, my English is bad).

To compile jazz you need wxwin which can be found at 
ftp.aiai.ed.ac.uk.




\section{Copyright}\label{copyright}

This software is Copyright (C) by Andreas Voss and Per
Sigmond. All rights reserved. 

The software may be used, copied and
redistributed under the terms of the GNU General Public License as
published by the Free Software Foundation, 675 Mass Ave, Cambridge, MA
02139, USA. This software is provided "as is" without any expressed or
implied warranty.

For details look at the file COPYING which you should have received with
this distribution.




\section{Installation and Startup}

For unix installation look at the file {\tt install.txt} which contains
up to date instructions. For MS-Windows there is an install utility.

On startup jazz looks for its configuration file
\begin{enumerate}
\item in the current directory
\item in the home directory (where the environment variable HOME points to)
\item in the directory from where jazz itself was started.
\end{enumerate}
The file is named {\tt .jazz} in unix and {\tt jazz.cfg} in MS-Windows.
Then jazz seaches for a song named {\tt jazz.mid} in the current directory
and loads it - if found. This song may contain default settings for your
midi equipment.


\subsection{Commandline options}

(Note that this applies for Unix versions only.)

Command line options (in any order): 

\begin{itemize}
\item {\tt jazz -h}                                   -- Print help text
\item {\tt jazz -v}                                   -- Print help text
\item {\tt jazz -f filename}                          -- Input midi file 
\item {\tt jazz -trackwin xpos ypos [width height]}   -- Position/size of main window
\item {\tt jazz -pianowin xpos ypos [width height]}   -- Position/size of piano roll window
\end{itemize}


\section{Acknowledgements}

jazz is based on the work of countless other people who have have made
their software freely available. Beside all the people who made Linux,
GNU and X11 possible, I'd like to mention

\begin{itemize}
\item Hannu Savolainen for writing all these excellent midi drivers, so
jazz can talk to nearly every midi card.
\item Julian Smart who wrote the free, portable GUI library
wxwin, so jazz runs with XView, Motif and MS-Windows now.
\end{itemize}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Track window}\label{trackwin}

The trackwindow shows bars and tracks of your song in opposite to the
pianowin which shows single events of one track. Events are shown like
barcode, every event is shown as a short vertical line.


\section{Toolbar}\label{twtoolbar}

From left to right there are the following buttons:
\begin{enumerate}
\item open a file
\item save actual song to file
\item clear song (start a new one)
\item \popref{Replicate}{replicate}
\item \popref{Delete}{delete}
\item \popref{Quantize}{quantize}
\item \popref{Mixer}{mixer}
\item \popref{Undo}{undo}
\item \popref{Panic}{panic}
\item Help
\end{enumerate}

\section{Selecting events}\label{select}

Many functions (e.g delete from the edit menu) require that you have
selected some range of bars and tracks that will be affected by the
selected operation. You can drag a rectangle to select a range. Holding
the shift-key down while pressing the left mouse button will continue a
selection. This way, you can select a range bigger than the window by
continuing a selection after scrolling. Alternatively, you can click
into the leftmost column to select a whole track.

The selection indicates a range of tracks (y-axis) and a range of bars (x-axis).
These values are copied to the Eventfilter from Settings-Menu. In the eventfilter 
you can specify more precice, which events shall be worked with.

Example: To delete all events but program changes from bar 5 to 15 on track 1 to 3,
mark bars and tracks by dragging a rectangle. Then select the eventfilter and
disable program-changes (patch). Finally select Delete from Edit-Menu.


\section{Record and play}

To start play, click in the top line of the Trackwindow. If some bars on one track
are selected, the events of the selection will be replaced by recorded events.
If you start record/play with the right mouse button, the track will be muted before
play starts and recorded events will be replaced. Klicking the left button, the
track is not muted and recorded events are merged.

A click with middle mouse button (shift+left when configured for 2-button mouse)
starts cycle record/play, the \popref{selected}{select} bars are played
over and over again until you stop play by clicking into the top line
again.

Also, you can start and stop play by hitting the space bar. When you start play
with the mouse, jazz will remember the start position. On spacebar jazz starts play
at this position again.

\section{Speed adjustment}\label{speed}

A single click with left/right mouse button into the speed field will
increase / decrease the speed by one beat / minute. Keep the mouse button
down to make bigger changes. Hold down the shift key to change
values in steps of 10 bpm.


\section{Track Defaults (program, volume etc)}\label{trackdefs}

Clicking at the top of the column named Prg cycles through the available
defaults (Prg = program change, Bnk = program bank (used in combination
with Prg for GS sounds), Vol = volume, Pan = pan, Rev = reverb,
Cho = chorus). These events are sent before play starts. To adjust a
value, click left or right mouse button to increase or decrease the
value (use the shift key for quick increase or decrease). A value of 0
means there is no event to be sent. Please note that the defaults can also be
edited (graphically) in the {\em Mixer} dialog selected from the {\em Parts}
menu.

Clicking the unnamed column containing P's toggles the Trackstatus:
P=play, S=solo, M=mute.

Clicking into the top of the leftmost column (labeled 'M') toggles
display of midi channel and track number.

\section{Trackname, midi channel etc}

Klick on the name-field will open a Dialog. You can enter a new name for
the track and a midi channel. If 'force all events to midi channel' is
selected this is done, otherwise the midi channel will not affect events
already on the track.  The default program change, Volume etc are sent
on this channel always.



\section{File menu}

Load/Save MIDI-Standard files. jazz will always save Format 1. Load Pattern saves
the selected events into a midi standard file. Load Pattern merges a midi standard
file into the song. After selecting the file click with the left button to the
destination position. To abort loading after selecting the file click with the
right mouse button somewhere.


\section{Edit menu}


\subsection{Replicate}\label{replicate}

The selected range will be copied to another place. After invoking 'replicate', click
the destination with the left mouse button. The right mousebutton will abort replication.
After clicking destination position, you get a dialog box:

\begin{description}
\item[Erase Destin] Checked: destination will be replaced by source. Unchecked: Events
will be merged.

\item[Erase Souce]  source will be moved to destination

\item[Repeat Copy] After clicking ok, you can click at the end of the desination range.
Repeated copies of source will fill the desination range. 

\item[Insert Space] All Events right from the destination point will be moved to the
right to make room for the copied events.

\end{description}

Source and destin may overlap.


\subsection{Delete}\label{delete}

Selected events are removed. The button 'Leave Space' indicates, whether
the deleted events leave a hole or the events from right are moved to the left to
fill up the hole.


\subsection{Quantize}\label{quantize}

Quantize will put Note-On events 'in time'. Only Note-On events are changed.


\subsection{Set MIDI Channel}

The selected events will forced to the selected MIDI Channel.


\subsection{Transpose}

If no scale is selected, Amount is the number of semitones to transpose, e.g. an
Amount of 1 will change C to C\#, C\# to D etc. If the scale C is selected, C
will become D, D will become E, E will become F etc. jazz tries to analyze
the key of the selection and displays it in the dialog.

The scale 'selected' is the set of notes in the selection. If eg the selection
contains the notes C, D, E an amount of 1 will change C's to D's, D's to E's and
E's to C's. Its useful in the piano window create inversions of chords. 

Fit into scale with an amount of 0 will change all notes to the nearest one
contained in the selected scale. If eg the selection contains some C\# and you
select C scale, all C\#'s will become C's (D would be possible too, but transpose
down is preferred in this case). If amount is not 0, the selection is transposed
in semitones first and 'Fit into scale' afterwards.

Only Note-On events are changed.


\subsection{Velocity}\label{veloc}

Changes the velocity of Note-On events. If Stop is 0, all Note-On events will get
the Start velocity. If Stop is greater 0, events at the beginning of the selection
will get the Start velocity, those at the end will get the Stop velocity
(e.g. crescendo). The choice Add/Sub/Set determines, how the value is applied.


\subsection{Length}

Adjust length of Note-On events. see \popref{Velocity}{veloc}.


\subsection{Shift}

Moves events left or right in amounts smaller than a bar. The snap value is
adjusted in the pianowin.

\subsection{Cleanup}

Deletes note-on events that are shorter than a selected length. 

Accidental keyboard hits often leave very short notes on the track that 
distorts the music. This cleanup function effectively solve such problems.

\subsection{Search Replace}

Searches for controller events and changes the controller number, eg
transforms modulation wheel to volume.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Parts menu}\label{partsmenu}

This menu deals with all kinds of track settings, or {\em parts} settings
as the GS terminology would name it. Some of the parameters will work with
almost any General Midi (GM) equipment (like Volume and Pan settings) while
others only work with GS compatible synthesizers (many
synths support GS, even if they don't tell you).

All parameters are operated with sliders per track (part). Note that for some
platforms the number of adjustable parameters are restricted because of
the size of the dialogs.

Please note that only one {\em parts} dialog can be opened at a time.

\subsection{Mixer and Master}\label{mixer}

Setting of default {\em Volume}, {\em Pan}, {\em Reverb} and {\em Chorus}.

\subsection{Sound, Vibrato and Envelope}

Sound dialog - change sound colour:

\begin{itemize}
\item {\em Cutoff frequency} - filter high frequencies
\item {\em Resonance} - make the sound more 'synthetic' (wha-wha sound)
\end{itemize}

Vibrato dialog - change the way the tone's vibrato develops in time:

\begin{itemize}
\item {\em Vibrato Rate}
\item {\em Vibrato Depth}
\item {\em Vibrato Delay}
\end{itemize}

Envelope dialog - change the way the tones envelope (amplitude) develops in
time:

\begin{itemize}
\item {\em Envelope Attack}
\item {\em Envelope Decay}
\item {\em Envelope Release}
\end{itemize}

\subsection{Controller dialogs}
These dialogs change the way the different controllers affect the sound.

Controllers are:

\begin{itemize}
\item {\em Pitch Bender}
\item {\em Modulation Wheel}
\item {\em Channel Aftertouch (CAf)}
\item {\em Polyphonic Aftertouch (PAf)}
\item {\em Continous Controller 1 (CC1)}
\item {\em Continous Controller 2 (CC1)}
\end{itemize}

All the controllers have three associated types dialogs with sliders;
{\em Basic}, {\em LFO1} and {\em LFO2}.
The settings tell how much the controller will trigger the 
sound-change described by each parameter. Parameters are:

\begin{itemize}
\item {\em Pitch Control} - pitch in half-tone steps
\item {\em TVF Cutoff} - controls high frequency cutoff (TVF = 
Time Variant Filter)
\item {\em Amplitude} - controls amplitude (dynamic volume)
\item {\em LFO1 Rate, Pitch, TVF and TVA} - controls the rate of the Low
Frequency Oscillator 1 (LFO1) and how it affects pitch, TVF and TVA (TVA =
Time Variant Amplitude)
\item {\em LFO2 Rate, Pitch, TVF and TVA} - controls the rate of the Low
Frequency Oscillator 2 (LFO2) and how it affects pitch, TVF and TVA (TVA =
Time Variant Amplitude)
\end{itemize}


\subsection{Drum Instrument Parameters}

This is a dialog for controlling different parameters of the individual drum
instruments of the primary drum part. The track selected is the first track
with channel equal to the {\em .drumchannel} setting (in the configuration
file ). Note that the name of the track also has to be set.

Drum instruments are listed in a list box. The sliders are valid for the
instrument currently selected from the list. Listed instruments to be 
controlled are added/deleted by using the {\em Add} and {\em Del} buttons.

The controllable parameters are:

\begin{itemize}
\item Drum instrument {\em pitch coarse}
\item Drum instrument {\em TVA} (volume)
\item Drum instrument {\em panpot} (a value of -64 will give random pan)
\item Drum instrument {\em reverb send}
\item Drum instrument {\em chorus send}
\end{itemize}


\subsection{Partial Reserve}

Sound generators have a limited amount of tones that can be played 
simultanously. This is sometimed referred to as 'maximum polyphony'.
When the maximum polyphony is exceeded the synthesizer will start
cutting tones, which can cause audible 'distortion' to the music.

In GS equipment you can assign the number of tones (oscillators)
that is assigned to each part (track) thereby control which instruments
are 'more important'. This is what this dialog is for.

\subsection{Part Mode}

Here you can set two things:

\begin{itemize}
\item {\em Rx Channel} - the channel to be received by the part
\item {\em Use for rythm} - sets the part to normal mode (value 0)
or drum modes (value 1 and 2). Part 10 (channel 10) has default value 1,
all others have default value 0.
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Settings menu}

\subsection{Filter}

After \popref{selecting}{select} a range of events, you can specify what
events shall be processed. The entries From Time, To Time, From Track,
To Track are automatically set by selecting a range with the mouse.


\subsection{Window}
adjust size of fonts (y-axis) and events (x-axis).


\subsection{Song}

adjust the overall resolution of the song in ticks per quarter. The
native jazz driver (MPU-401) supports distinct values only. With voxware
and on MS-Windows you can use any value here.  If you change this value,
all event timings are recomputed.


\subsection{Effects}

Adjust GS effect settings.

Effects can be adjusted in two modes; macro mode and inividual parameter
mode. The mode is set with the checkboxes at the bottom of the dialog. 
The current mode will exclude the other; the parameter settings will 
have no effect when in macro mode and vice versa.

Macro mode will be sufficient in most practical cases. Setting of individual
parameters is more difficult, but can give very good results when done right.

The modes settings can be saved with the "Save settings" menu entry.

\subsection{Timing}

Controls clock source and realtime output.

For clock source the available choices will vary depending on system
platform:

\begin{description}
\item[Internal] The sequencer is itself the source of the clock timing
(available on all system platforms).
\item[Song Pointer] The sequencer clock locks to midi realtime messages
received from midi input. The source of these messages is typically a 
tape-machine with an external sync-box or just another sequencer. Song
pointer sync is available on Unix with jazz-native MPU-401 driver and on
MS-Windows.
\item[Midi Time Code] The sequencer clock locks to Midi Time Code
(MTC) messages received from midi input. The source is typically a 
tape-machine with an external sync-box doing SMPTE-to-MTC convertion or
a MTC-capable recording machine. MTC sync is available on MS-Windows platform.
\item[FSK] The sequencer clock locks to FSK information received from
tape. This is available on Unix with an MPU-401 card supporting FSK
sync.
\end{description}

How to sync?

\begin{description}
\item[Internal] Just play.
\item[Song Pointer] Make sure the device (here called "tape") you are syncing
to sends midi realtime messages (songpointer, midi clock etc.) This could
involve recording a "songpointer strip" to a tape track by means of
a sync box. To do this you must play the song with the sequencer in 
"Internal" sync mode and with "Realtime to MIDI Out" enabled. (For more info
refer to the instructions of the sync box.)
To play, enable "Song pointer" sync mode on sequencer, start play on sequencer
first, then start tape at any point in the song. The sequencer is now locked 
to the movements of the tape. (Note that some sync boxes don't send 
song-pointer at beginning of the song. In this situation you must manually 
start sequencer at song-start before running tape.)
\item[Midi Time Code] Make sure the device (tape) you are syncing to sends
MTC messages (could involve recording an SMPTE stripe). Set the MTC offset
and the MTC type either manually or by recording it while listening to the
tape. (The MTC offset is the point in time when the sequencer is supposed
to start playing the song.) When recording MTC offset the sequencer will
automatically be set into MTC sync mode.
To play, set sequencer to MTC sync mode, start play on sequencer, then start
tape at any point in the song. The sequencer is now locked to the movements
of the external device.
\item[FSK] An "FSK strip" must first be recorded to a tape track. To do
this you must play the song with the sequencer in "Internal" sync mode. Be 
sure to start FSK stripe recording some time before sequencer is started
(must record the pilot tone).
To play, set sequencer to FSK sync mode, start tape in the pilot-tone area, 
then start sequencer before pilot tone ends. (Note that with FSK play must 
always start at beginning of the song.)
\end{description}

The "Realtime to Midi Out" choice is useful for syncing another sequencer
to this one or to record a "songpointer stripe" to tape via a sync box.
Note that "Realtime to Midi Out" will only work properly for a clock-per-beat
resolution dividable by 24 (see "Song" settings).


\subsection{Midi Thru}
Enable/disable midi thru.


\subsection{Midi Device}

MS-Windows only. You may select the input and output devices from the
list of installed drivers.


\subsection{Save Settings}
Save settings to config file.
Affected settings: midi thru, clock source, realtime out, effect macro modes.


\section{Misc menu}

\subsection{Undo}\label{undo}

Undo the last operation. The last 10 operations can be undone.


\subsection{Merge / Split Tracks}

Split tracks places all events from track 0 to track 1..16 depending on
the midi channel (useful for file format 0). Merge tracks moves all events
to track 0.

\subsection{Meterchange}

Changes the meter starting from specified bar to the end of song or to the
next meterchange. Meterchange events are placed on track 0 always.

\subsection{Midi reset}\label{panic}

Sends an initialize message (GS Sysex) to the midi port.


\subsection{Harmony browser}\label{hbrowser}

The harmony browser shows the 4-tuned jazz harmonies of the four scales
types major, harmonic minor, melodic minor and harmonic major. 

The first thing you can do is to click on chords and listen how they sound (eg
examples from a song book or a book about harmony theory). The selected
chord is placed into the pianowin copy buffer and can be pasted into
your song with the middle (shift+left if configured for 2 button mouse)
button in the pianowin.

The harmony browser is also able to analyze a section of your song and
to transpose parts of your song into new scales and chords. Also you may generate
chords thru the random rhythm generator into your song.

What you can do with the mouse:
\begin{itemize}
\item left click on a chord: selects the chord and marks related chords (see below).
\item shift + left click: selects the chord and appends it to the chord sequence
you need to transpose parts of your song
\item right click: just listen to the chord, dont select it
\item right click on {\em the last} chord of the chord sequence removes this
chord from the sequence.
\end{itemize}

There is a toolbar with the following icons (from left to right):

\begin{itemize}

\item The left four Buttons switch the scale type for which the standard
chords are displayed: major, harmonic minor, melodic minor and harmonic
major which is also known as ionic b13.

\end{itemize}

The following five Icons (with the cyan right arrow and the piano)
specify what related chords are marked when you select a chord:

\begin{itemize}

\item 1/2: marks all chords, that differ from the selected chord by exactly
one half note

\item 251: marks all chords, that would come next in the 2-5-1 move

\item =B: marks all chords, that share the same bass note with the selected chord

\item Tri: marks all chords, that could be tritone substitutes (their bass note
is at a tritone interval from the selected chord).

\item (piano): mark all chords, that contain all of the keys in the pianowin 
copy buffer. So you could select a few notes (max 4) in the pianowin and select
copy from the edit menu. Now the harmony browser will mark all chords that contain
those notes.

If the piano button is not selected, the harmony browser works the other way round.
Whenever you select a chord, the chord is placed into the pianowin buffer so you
can paste it into your song. The parameters (midi channel, length etc) can be set
in the midi-entry of the harmony browser menu.

\end{itemize}

The last four buttons do different things:

{\bf Haunschild layout} shows harmonies and scales in an order proposed
in a book about harmony theory by the german author Haunschild. If selected,
chords are shown in a way that 'valid moves' are 

\begin{itemize}
\item from left to right, e.g the 2-5-1 move is displayed as three neighboured
chords. In general, all horizontal moves are allowed.
\item vertical moves are allowed, they change one semitone of a chord (at most).
\item diagonal from top-left to bottom right. I don't know why, but it sounds
nice.
\end{itemize}

{\bf Transpose} lets you change parts of your song to the harmonies and chords
of the chord sequence. When you select some bars in the trackwin and
click on transpose, then the selection is mapped to the chord sequence.
The default is, that on chord lasts one bar, but you may change this in the
settings menu in the harmony browser. If the results are not satisfying, you
should try to transpose track by track, this often works better. All in all,
transposing works better, when the selected material is not too complicated.

I had nice results with the following procedure: I recorded (very slow, as I am
not a good pianoplayer) cj7 chords on one track, some monphone bass line on the
second track and a solo on the third track. Everything was in c major (white keys
only). Then I selected some chords and transposed each track on its own.

{\bf Analyze} Tries to find the chords and scales from the selection in the
trackwin. Again, the default is one harmony per bar which can be changed in the
settings menu. The algorithm looks at the length of the notes and chooses the
longest notes to be the notes of the chord.

{\bf Clear chord sequence} removes all chords from the chord sequence.

{\bf Menu entries}

\begin{itemize}
\item edit chord: often, you may want to have chords/scales that are not displayed
in the harmony browser. You can select a chord from the chord sequence and change
it in this dialog.

\item settings: adjust parameters for transpose and analyze as explained above.
A value of 0 quarters per chord when transposing will map the chords to the length
of the selection, e.g if you have selected 16 Bars and your sequence has 4 chords,
every chord will last 4 bars. If you had choosen 4 quarters insted, the chord
sequence would have been repeated 4 times to fill the 16 bars of the trackwin selection.

\item midi: these settings affect what you hear, when clicking on a chord and what
is put into the pianowin buffer.

\end{itemize}

{\bf Generating chords with the random rhythm generator}

After defining a chord sequence, you may open the random rhythm
generator. When adding an instrument, it will show (beside drums) the
instrument 'chords from harmony browser'. You select it and define a more or
less randomized rhythm and proceed as described \popref{here}{randrhy}.

\subsubsection{Transpose Algorithm}

This one is somewhat difficult to explain, but its probably the most
interesting feature of the Harmony Browser.  Lets assume, you have a
sequence of 4 chords. Then you select 4 bars in the track window (all
tracks) and you press the transpose button.  Now, the Harmony Browser
tries to change the harmonies and scales from the trackwindow selection
into the selected chords.

The algorithm looks at the first bar from the trackwin selection and
sums up the length of all different notes. It assumes, that the 4 notes with the
largest sum of length are the chords present in the song and changes them
to the 4 notes from the first chord of your chord selection. Afterwards,
the remaining notes from the trackwin selection are mapped to the remaining
notes of the scale the chord was taken from.



\subsection{Random rhythm generator}\label{randrhy}

This dialog generates rhythms from some kind of statistical specification.
You define probabilties for timing, velocity and note-length and from these
the rhythm is generated.

The three sliders you specify the meter and (with \# Bars) how many probabilities
you want to define. Next, you can add or remove instruments to the listbox. Then
you specify the probabilities for rhythm, velocity and length for each instrument.
Probabilities are set with the mouse where

\begin{itemize}
\item left button: draw some kind of curve
\item right button: clear values to zero
\item + shift: adjust all values simultanously
\item + ctrl: adjust exactly one value
\end{itemize}

In the rhythm field you specify the probabilities for every time
position. A high value means a high probability that the instrument is
played definitely at that time. A low value means, that the instrument
{\em may} be played at that time. By adjusting high values only, you
can specify a definite rhythm without any randomization.

The velocity (and length) values are looked up by the generator, whenever
it decides to play a beat.  It chooses one value from 1..127 (x-axis,
1..8 for length) where positions with high probabilities are choosen more often. 

If the choosen length is greater than 1 step, there
are no more events generated until the note quits, even if there are high probabilities
in the rhythm field. You can abuse this, to make shure that there are not too many events
generated (example: you have rhythm probabilities at step 4 and 5, but you want exactly
{\em one} beat to be played at either of these. Specifying a length of 2 will do this, 
if step 4 is choosen, there cannot be an event on step 5).

I had the best results with the following: I define every instrument
twice. In the first definition, I select high probabilities on a few
timing positions together with high velocities, this makes the base
groove - it is loud and does not change very much. In the second
definition, I have little probabilities on many timing positions with
a low velocity, this makes randomized background fills, which make the
whole thing more interesting and that do not override the base groove
because of the low velocity.

Aside from drums there are some special 'Instruments' you can select:

\begin{description}
\item[Controller] opens another dialog to select a controller. Randomizing works the same
like with drum keys except that instead of velocity the controller value is generated. With
this, you may generate for example random panpot events that move the sound between left and
right speaker or, in conjunction with the \popref{Parts Menu}{partsmenu}, you can generate
many different randomized sound effects.
\item[Pianowin Buffer] places the events currently in the pianowin cut/paste buffer. You
could eg copy a chord into the buffer an then replicate it on random timing positions.
\item[Harmony: chord, harmony: bass] only available, if the
\popref{harmony browser}{hbrowser} is opened and a chord sequence is defined. Places
the selected chords or bass note randomly.
\end{description}

To generate, you select some bars on one track in the trackwin and press the gen button.

\subsection{Music copyright}\label{muscopyr}
This copyright notice is put into the midi file as a 'copyright' meta event.
It is intended to be used for copyrighting the music.


\section{Help menu}

Some of the submenus (not the 'Mouse' or 'About' items) requires access to 
the wxWin help system. The help system acts a little different dependent
on the system platform:

\begin{description}
\item[On Unix] a copy of the '{\em wxhelp}' utility program has to be present
in the path. If the program cannot be found there will be a timeout message 
after a while (repeated two times). Also a copy of the help file 
{\em jazz.xlp} has to be present in the path.
\item[On Windows] the native help system is used, which requires that the help
file is present in 'Windows help' format ({\em jazz.hlp}).
\end{description}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Piano window}\label{pianowin}

The pianowindow shows Note-On events of a single Track.
Displayed track and bar is selected by clicking with the right
mouse button into the trackwindow. You may change the track by shift + cursor keys.


\section{Toolbar}\label{pwtoolbar}

From left to right there are the following buttons:
\begin{enumerate}
\item 4 buttons for the most common \popref{snap}{snap} values
\item \popref{Cut and Delete}{pwcutpaste}
\item \popref{Quantize}{quantize}
\item Show all events from all tracks as described \popref{here}{pwevents}
\item \popref{Undo}{undo}
\item \popref{Panic}{panic}
\item Help
\end{enumerate}


\section{Mouse actions}

Events can be selected by dragging a
rectangle with the left mouse button. A selection is continued by
dragging while holding the shiftkey down.

{\bf Mouse actions in the event area}

\begin{description}

\item[left, shift+left] select events

\item[middle] cut / paste. Clicking on an event cuts the event to the
internal cut/paste buffer, clicking on an empty position pastes the
buffer contents. middle+shift means copy instead of cut.  Multiple
events can be cut/copied into the internal buffer by marking
some events and select cut/copy from the edit menu. middle+ctrl plays the note without
cut / copy.

\item[right] adjust note length by dragging.

\item[right+shift] opens a dialog box to modify the values of the event
or to create a new event.

\item[ctrl+left, ctrl+right] Holding the controlkey while pressing the
left or right button increments/decrements the velocity of an event.

\end{description}

For 2 button mouse (configured in the .jazz / jazz.cfg file) cut / paste
is on ctrl+left and play a note on ctrl+right. Adjustment of velocity
has to be done via the dialog (shift+right).


{\bf Mouse actions in the top line}

\begin{description}
\item[left] start / stop play (record is not available in the pianowin)
\item[middle or shift+left] start cycle play. If there is a selection active,
the selection is cycled otherwise 4 bars are cycled.
\end{description}



\section{Edit menu}

Some entries work the same way as discussed in the trackwindow section.

\subsection{Cut, Copy, Paste}\label{pwcutpaste}
Copies selected events into an internal buffer. Events are pasted by
clicking the middle button (ctrl+left) to an empty space. Cut is like Copy + delete.

\subsection{Shift}

Moves selected events to the left or right. The amount is snaps, which can be adjusted
in the settings-menu.

\subsection{Quantize}
Quantizes selected events to the current snap-setting.

\subsection{Left - Right, Up - Down}

Exchanges the position of selected events. Try it.

\section{Settings menu}


\subsection{Events}\label{pwevents}
You can specify what events are to be shown in the pianowin.

\begin{description}
\item[NoteOn, Cotroller, Program] these events can be shown and edited in the pianowin. If 
you select exactly one, the piano at the left hand side will be replaced by a list of
controller- or program names.
\item[show drumnames] switch it off if you prefer to see the piano keyboard instead of
drumnames
\item[show events from all tracks] displays all events. Events from active track are shown
black, the others grey. Clicking with the right mouse button on a gray event changes the
actual track.
\item[show harmonies from harmonybrowser] displays the chords and scales from the
harmony browser. To see the chords, you must first open the harmonybrowser and
define a chord sequence. Then you have to mark some bars in the trackwin to show,
where the chords should go. Now the pianowin shows notes from chords in light blue
and notes from the scale in light green.

\end{description}

\subsection{Snap}\label{snap}

The start time of pasted events will be quantized to this value. This value is also
used in the quantize- and shift dialogs in pianowin and trackwin.


\section{Misc menu}

\subsection{Edit Pitch and others}

Opens a painting area where you can paint values of the specified type (pitch, controller, ...).
Painting with mouse is done analogous to the \popref{random rhythm generator}{randrhy}, make shure
you use the right button to set values to zero because you can't paint an exact zero because
of limited screen resolution. Use the Apply button to make your changes take effect.

You can - for example - assign the Cutoff Frequency to CC1 Controller
in the \popref{Parts Menu}{partsmenu} and paint some wah wah effect here.


\subsection{Guitar board}

Opens a window displaying the frets of a guitar. Moving the mouse over the guitar board shows
the names of the notes and moves the black bar in the pianowin. Same works the other way round,
moving the mouse in the pianowin shows the notes on the guitar board.

Also, the actual contents of the pianowin cut / paste buffer is shown (this may be set from the
harmony browser too, so you can see how chords could be played).

Clicking with the left button adds events to the pianowin buffer so you can paste them into
your song. In chord mode (settings dialog), if you add several events to the buffer, they all
start at the same time, otherwise they are generated one after the other (length is the
current snap setting).


\section{Help menu}
See 'Help menu' in the {\em Track Window} chapter.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Examples}\label{examples}

\section{random rhythm and harmonizer}

This section documents the demo example.

\begin{enumerate}

\item I prepared the tracks for the song and assigned names and channels for
drums, bass, piano and melody. Then I generated the drums with the
random rhythm generator.

\item open the random rhythm generator and load the file demo.rhy. Lets take a
look at the adjustemnts for the instruments:

The first kick drum defines high probabilities at beat 1/4 and 3/4 -
this makes the basic groove. The probabilites at 3/16 and 9/16 are a
little lower, so the kick drum will not play these beats always. The
velocity ranges from about 70 to 100, so the loudness of the beats varies.

The snare drum plays at 2/4 and 4/4 but probabilities are less than 100\%, so
it will play most of the time but not always. The velocity is about 80 .. 100, so
the snare is loud always, there is not much dynamic.

The third entry, closed hihat, plays at 2/8, 4/8, 6/8 and 8/8 - the probabilities 
are 100\% and velocity is high - these beats ar played always and all of them are
loud.

The ride cymbal plays most of 1/4, 2/4, 3/4 and 4/4 and sometimes on 16/16. Also
it plays at 9/16 - just to make things more interesting.

The next entry, snare drum again, plays with low probability on all 1/16 timings - 
so not all of them are played - the probabilities would lead to about every 2nd
1/16 would be played. For every beat that is played, the generator selects a
length from the length field. Valid lenght values are 1/16, 2/16 and 3/16 where
1/16 is choosen most often because it has the highest probability. When a length
greater 1 is selected, then the generator will not produce a beat on the following
1/16 step, because the previous note has not finished. Anyway, the velocity is
very low compared to the other snare drum entry. Together both snare drum entries
produce a loud and steady beat from the first entry and a lot of low-velocity
fillin's from the second entry.

The last entry, closed hihat again, is similar. It does not play on the timing positions
where the first closed hihat plays its loud and steady beats. It plays at the other
timing position inbetween with a very wide range of velocity - so some of these
inbetween beats will be dominant while others will sound like background.


\item To produce the rhythm I selected bar 5 to 20 on the drum track and then
clicked on the 'gen' button. This gives demo1.mid

\item next I recorded 2 bars of a bass line and some chords. I quantized
this and set the velocity to 90. Last I choose repeat copy to duplicate
the material to the full length of 16 bars. This is demo2.mid.

\item next I recorded a melody and did some corrections in the pianowin editor.
This is demo3.mid.

\item last I wanted some more interesting harmonies. To reproduce this step
you may open the harmony browser and load the file demo.har. 

The first 4 chord
are from the original recording Am7 and D7. These are step II and V from G major.
So I choosed Gj7 as the next 2 chords to establish that scale.

The next 6 chords are a minor II-V-I move, which leads to Bbm7 in the
scale of Ab major - notice, that the V was taken from the harmonic scale. 
The last chords are a V-I move in Ab major.


\item to perform the transposition, transpose every track on its own. Mark the
bass track in the trackwin and select transpose in the harmony browser (the button
where the arrow points from the rectangle to the note). Then do the same for
piano and melody. This should result in demo4.mid.

demo4.mid is not perfectly transposed, but it could serve as a starting point and
you could correct some notes in the pianowin editor. The pianowin editor can
show the chords and scales in colors, look at \popref{Pianowin Menu Events}{pwevents}
for details.

\end{enumerate}


\end{document}

