Music Sequencer Written in
FoxPro 2.6 (Windows)

Screen Shots and Descriptions of Hobby Project
 
(Updated 6/19/2002)
Thumbnails
Thumbnails (Click to jump to)

Introduction

These are some screen shots of a hobby music sequencer that I wrote in FoxPro 2.6 for Windows around 1994 and 1995. I first started it in C, but I found C to require painstaking detail. FoxPro allowed me to use it's built-in and easy-to-use collection handling operations (relational table handling) to increase my productivity by about a factor of 5 to 10 of what it was in C.

It is not meant for commercial purposes. However, I will send anybody a copy who is interested. Compared to commercial systems, it is more modal and probably harder to learn. (It is optimized for how I work on sequencing, not for how others may do it.) I would not recommend writing a commercial sequencing system in FoxPro because FoxPro is really meant for custom business projects. However, it worked out well for this project, being a hobby-only project.

I wrote it because I could not at the time find a commercial PC product that had the features I wanted. Such features include:

The actual playing and input of the music is currently driven by a Visual Basic utility that I wrote using Mabry Midi components. The VB portion communicates with FoxPro via file polling. There were some problematic timing bugs with the Mabry component, but I eventually worked around them using the "direct" mode. However, this required that my VB program control the timing instead of letting the component do it. It took some tricky programming.

Because the timing is controlled by Visual Basic (VB), it sometimes suffers problems when the CPU is busy. Thus, for final cuts I actually use an old DOS shareware tool that converts codes into a Midi file. I then have FoxPro use the Windows Media Player to play the midi file. The VB portion is perfectly acceptable for drafts.

Before I had the VB component, I used to use a C program portion for the playing. It was left over from the scrapped C version. I linked in a small binary controller that I got from a book called Midi Sequencing in C from M&T books (1989).

However, the component proved too flakey when I upgraded from a 386 to a Pentium. (A reading of the assembly code revealed that the wait-loop only iterated up to only 255 before continuing. It appears that the Pentium's speed exceed this value at times.) I thus decided to try VB components. The architecture of the FoxPro program is such that it is fairly easy to swap to other devices if needed. The FoxPro software thus never has to directly talk to the Midi systems.

One drawback is the lack of an active marker bar. A marker bar shows what portion is currently being played. It is analogous to the bouncing ball or lyrics cursor on Kareoke-like screens. However, I have not found this to be a significant drawback.

I have done some initial tests to port it over to newer versions of FoxPro, but discovered some problems converting the menus. (The newer versions are supposed to be backward compatible, but there are some slight variations, especially with regard to GUI features.) I will need to study this issue more. For the time being, I still run it in version 2.6.

Uggg, the colors are so glaring on modern monitors. They were more muted on older models.


Typical Detail Screen with Note Detail Box Shown

screen shot

This shot shows a typical sequence detail screen, but with a note detail screen box popping up. The detail screen is brought up by moving the cursor over a note image, and pressing "E" (which has nothing to do with this example being a note from Track "E".)

Most commands are done via a similar "point-and-letter" approach. This simplifies the mouse/keystrokes that would normally be done via pull-down menus in commercial systems.

Note that velocity (how hard a note is played) is represented both as a Midi value ("Vel") and as a short-hand single digit code ("Vdig"). The single digit code is used for display in the note bars (see the green-gray digits?) Ideally the velocity digit would be calculated on the fly instead of stored in the table, but I felt at the time it would slow things down on my 386. It is of course possible to view note details in a tabular format (not shown).

(It seems I never quite got around to cleaning up those ugly field descriptor names. They look like darn Unix commands.)


Track and Note Operations

screen shot

This shot shows the "Phrase Tools" screen in front of note detail. This screen does most of the "aggregate" operations on notes, tracks, and phrases. It is probably the most complex screen besides the note grid screen (shown in the background).

The target tracks (letters), a note row, and range are displayed and entered on the right side. The operation buttons and value boxes reference the specified tracks by the "box numbers," such as "#2" for tracks E, F and K.


Track Settings

screen shot

This shows the Track Settings table. "Snd" (sound) is the Midi "program number," which corresponds to an instrument. Most of the standard Midi controls are available here, such as volume, modulation, panning, etc.

Some of the less standard Midi controller settings are on the right side. Release, Attack, Chorus, and Reverb are based on the Korg O5R/W, which is what I currently use. (I also have a Roland D-5, but I don't use it much except as a keyboard controller. I want to get a Roland Sound Canvas next.) Any other special Midi controllers can be set via the "Ctrlno" and "Value" column. (In this case, I used Korg-specific named constants instead of numbers.)

They also double for special commands, such as bank switching. Bank switching can also be done via regular controller commands, but the Korg required too many commands. So I eventually added the bank shortcut commands. (Ideally, I should have made a "bank" column, but this kludge works.)

All the values are in percents except the "value" column for the controller. This is because it is not necessarily continuous and may need a specific value.

The "Alt" column is used to provide variations of a give phrase. A zero or blank Alt number is the default upon song startup. Alt rows with numbers are only triggered if the sequence references that Alt number (see next screen). In this example you can see that the volume for track E is being changed for subsequent Alt's.

Volume is not the only thing that can be changed. Even the instrument (Midi program) can be changed. this allows a sequence to use say a guitar for one pass, and a flute for another on the same track. (This practice is sometimes not recommended because some synthesizers pause to switch sounds. Even my Korg has a slight pause, but it can be masked with a few musical tricks.)


Sequence Table

screen shot

This shot shows the Sequence Table. It is used to put together the various phrases (segments) for playing. I usually use sequence number ("Seqno") "1" for the primary sequence. Other numbers are generally used for experimentation or variations. Sequence "9" is reserved for a temporary sequence. Thus, I can have up to 8 variations of a song (but never needed that many yet).

Note how phrase 5 has Alt's of "1" and "2" (one 1 and two 2's) for sequence 1. This means that variations are being specified. (This sequence list is from a different song than the Track Settings example, so they won't match here.) Alt 1 may be one volume and alt 2 may be another, for example.

The order (sort) specification method is admittedly a little goofy, but it works. A commercial system would probably have a marker that one drags to change the order. However, FoxPro does not support that in it's GUI. (I was thinking about implementing that myself, but never got around to it.)


Navigation Screen

screen shot


Main Screen

screen shot


Phrase Table

screen shot


Visual Basic Player & Recorder

screen shot

The Visual Basic player (described in Introduction) is shown against a portion of a detail screen. The Pause button is currently not implemented, just Stop, but I generally draft with shorter song segments anyhow. The "no buffer" setting means to use my timing algorithm instead of Mabry's built-in timing (described in intro). The VB screen layout is a bit "hacky" I will admit. It went through a lot of experiments and I never got around to cleaning up the "lab". I figure I will have to overhaul it anyhow when I upgrade my PC just like I had to do with the play/record driver on the last upgrade. Fortunately, the FoxPro portion stayed mostly the same.


Main | Back | Top
© Copyright 1999 by Findy Services and B. Jacobs

1 1