|
This is a product plan and
preliminary functional specification for a program to simulate the operation of
the Triadex Muse. For more information about the original Muse, see the
Muse Home Page.
Please send comments to Paul Geffen.
Platform and Architecture
The Muse Simulator runs under 32-bit versions of the Windows operating system,
Windows 95 and NT.
It is written in C++ and uses the Microsoft Foundation Classes.
The application uses the Single Document Interface (SDI) pattern.
Ports to other platforms, including 16-bit Windows, may be attempted, but not by me.
If anyone is interested in porting this program to the Mac, please let me know.
Front Panel
The panel is in two sections.
The right hand section consists of eight large sliders, each with forty (40) positions.
These sliders control the sequence of musical notes. This section also has check boxes
which are used to add a rest to the sequence, and to enable polyphonic operation.
The left hand section has four small sliders for volume, tuning (offset), and tempo; and
buttons for Start, Reset, Hold, and Step. This section also has a set of four radio
buttons which allow selection of one of four sets of controls for polyphonic programming.
The first four large sliders, marked A-B-C-D, control the intervals of the melody,
and the second set of four sliders, marked W-X-Y-Z, control the melody pattern.
Colored lights to the right of the large sliders
show the state of lines which can be selected by the large sliders. These lines
are the outputs of counters and a shift register.
Menus
The top-level menus are: File, Settings, and Help.
File menu
New Load Settings Save Settings Save Settings As
Save Sequence As
(File) New
Clears all front-panel settings.
(File) Load Settings
The Load command brings up a standard Windows File Open dialog.
When a file is selected, and the OK button is pushed,
program (slider) settings are loaded from that file. The sliders move to
reflect the new settings.
(File) Save Settings
If a file name has been selected then this saves the current front panel settings
in the file. If no file has been selected, then this command
triggers a File Save dialog. Saves current settings to the specified file.
(File) Save Settings As
Triggers File Save dialog and saves settings in the specified file.
(File) Save Sequence As
If the sequence length setting from the MIDI settings dialog is not zero,
then this triggers a File Save dialog. A sequence of notes is generated and
saved to the specified file. A default file extension of "mid" is used.
The output file is a Standard MIDI File, of type 0, containing note-on and
note-off messages, plus the tempo setting.
Settings menu
MIDI
Wave
The Settings commands trigger the Settings dialogs, which are described below.
If the OK button on a settings dialog is pushed, the Muse will switch into the
corresponding mode. The MIDI mode is active on start-up, and generates MIDI
messages. The Wave mode is entered when the user hits OK on the Wave Settings
dialog. The Wave mode generates sound output through the Windows Wave mapper,
directly to the sound card, without MIDI.
Help menu
Index About
Toolbar
The Muse has a dockable toolbar. The MIDI and Wave buttons bring up the corresponding
dialogs. The Patch buttons change the current patch number and send a MIDI Program
Change message to the current MIDI device. The current patch number is displayed in the
MIDI settings dialog.
(The program change buttons only work when the Muse is in MIDI mode.)
Dialogs
Standard Windows File dialogs for Open, Save, and Save As.
The MIDI settings dialog includes: Device selection via list box, Channel and Program
selection via spin buttons, and an edit control for sequence length for MIDI file output.
(See File menu, Save Sequence As command.)
The Wave dialog allows selection of waveform, sample rate, and sample size.
Polyphony
The Muse Simulator
is capable of generating four voices simultaneously. The same panel controls are used to
control all four voices. The radio buttons in the upper left corner are used to control
which of the four sets of controls is displayed. When the Muse starts, only the first
of the four panels is active. To make the other panels active, select a radio button
and check the "External" box in the lower right corner. Only the panels with "External"
checked will generate notes.
Note that polyphonic operation is only possible in MIDI mode, and that some control
settings are always the same for all voices. Specifically, these are Tempo, Pitch,
Fine Pitch, and the MIDI Channel and Program Number.
The Muse Simulator is currently configured to play up to four voices, but this number
could be increased with very little effort. It may also be possible to allow other
controls, except for tempo, to be changed per voice.
The File Save and Load commands work only on the current voice. It is not possible to
save settings for all four voices in one file. This limitation will be removed in a
future build.
Internal Logic and Algorithms
Summary
A timer is used to drive two counters and a single 31-stage shift register.
A parity generator determines the shift register input.
Interval logic translates a four bit value to a note number.
Windows Multimedia API calls are used to send MIDI messages and wave data
to available devices.
Simple wave rendering converts a note number to a square wave at the correct pitch.
Timer
A single Windows Timer resource is used to generate timer messages.
The timer interval is set from the Tempo slider. The Tempo is variable from 12
to 600 beats per minute. This slider setting is converted into milliseconds per
message for Windows, which calls a message handler when the interval is over.
The message handler for the timer calls routines for timer, parity, shift register,
and MIDI or Wave output.
Counters
Two counters are implemented as integer variables. The timer message handler calls
a routine to increment the counters. One counter variable is reset when it reaches
the value 32. The second counter is reset when it reaches the value 12.
Sliders
Each slider takes the value of the Windows slider control, a number between zero and
39, and uses that number to obtain one bit from either a counter or the shift
register, or a constant. The constants zero and one are obtained at the top
of the slider range. Slider settings in the counter range apply a mask to the
counter values to obtain a bit, and slider settings in the shift register range
apply a mask to the shift register value. The effect is to get the current value of the
lamp to the right of the current position of the slider.
Parity Generator
The parity generator is called by the timer message handler. The parity generator calls
each melody slider and gets one bit of data (a value of one or zero) from each slider.
The parity generator takes the outputs of the four melody sliders and adds them.
It then masks all but the low bit of the sum to produce a result which indicates
whether the sum of the slider values is odd or even. The output of the parity
generator is used as the input of the shift register.
Shift Register
The shift register is implemented as a single 32-bit integer variable.
When the shift register is called by the timer message handler it multiplies
its current value by two and adds the result of the parity generator.
Scale translation (interval logic)
This module takes the values of the four interval sliders and computes a note number
based on a lookup in a table that represents the major scale. This table contains
the numbers 2, 4, 5, 7, 9, and 11, which are the number of semitones from the
first note of the scale to the desired note.
The input to the table lookup is first slider value plus two times the second slider
value plus four times the third slider value. The fourth slider value is used
to generate an octave offset.
Wave rendering
The Wave rendering module takes the MIDI note number, Volume setting,
and a Fine Tune offset,
and creates a waveform at the specified pitch. The waveform is sent to the
Windows multimedia API.
MIDI rendering
The MIDI note number, the current velocity, and the current channel number
are sent to the Windows multimedia API. A Program Change message is sent when
the OK button on the MIDI Settings dialog is pushed.
Buttons
Start. The Start button starts the clock.
Pause. The Pause button stops the clock temporarily.
Push Pause again to restart the clock.
Reset. The Reset button clears the counters and shift register. It does not
stop the clock.
Step. The Step button stops the clock and calls the timer message handler.
Push Step again to generate another note.
Rest. The Rest checkbox, when set, causes the scale translation logic
to substitute a rest for the lowest note.
External. The External checkbox, when set, causes the Muse to take its
clock and tuning setting from another Muse running on the same machine.
Interfaces
Output MIDI and Wave data via Windows Multimedia API.
Output of Wave and MIDI formats via ActiveMovie interfaces (output pins).
Connection to another Muse in a Master-Slave configuration.
Collateral
Help file (accessible through Help menu)
License agreement
Packaging and Distribution
ZIP file contains the executable code and a license agreement in text form.
Schedule
An early beta version is available. It works, but all features
have not been implemented.
The main components are working; what's missing is:
- Complete front panel graphics
- Help file and license agreement
- Installer
and there may be bugs, of course.
Here's a (slightly out of date) screen shot.
And here's a sample MIDI file.
|