SM87

SM-87

SM-87 turns the M-VAVE FM-1 into a 1987 studio: an Alesis MMT-8 style part and song sequencer, playing an Akai S700/X7000 style sampler and an Alesis HR-16 style drum machine. It records from the FM-1's keys or from MIDI, plays samples sent over USB, and keeps its sequences, samples and settings in the FM-1's flash.

SM-87 hasn't run on an FM-1 yet. It works in the host simulator and in the browser emulator, which run the same code. Try it in the emulator first, and install it at your own risk.

SM-87 playing a part: PART 00 BT 003 on the LCD, tracks 1 and 2 lit, part 00 playing large under the strip
The sequencer


1Install

An install writes the firmware only: the FM-1 keeps its sequences, its settings and the samples sent to it. The installer's last section puts M-VAVE's own firmware back.

To try it without an FM-1, open the emulator. It runs the same code in your browser, with sound, and talks MIDI with SysEx both ways, so Axs7 can send it samples too. In the bar under the panel:


2What it does


3Controls

KeysPlay the sampler on its channel (and out over USB); OCT- / OCT+ shift them
SEQThe sequencer's page; again (stopped): PART ↔ SONG
PLAYPlay from the top / stop; SEL + PLAY continues from the beat (where it stopped, or where SELECT put it)
RECArm recording on the part's lowest empty track (or the one chosen with REC + its key); again: disarm; while a take runs: punch out (the part plays on)
SEL + first 8 white keysTrack mutes (on the SEQ page; in a song: the step's mutes); the 9th: the drums on or muted
REC + first 8 white keysThe record track; the armed track's key again: none (until REC + a key chooses one)
PRESETThe part or song (SEQ page; while a part plays, the next, queued for its end), else the sampler's program: the one the keys play
K1 / K2 (SEQ)Tempo / the armed record track's channel (UNCHANGED, 1-16): what the keys and MIDI in play on (MIDI ECHO), and what the track plays back on. With no track armed it changes nothing (NO TRACK ARMED), so the tracks playing keep their sounds
K4 (SEQ)The drum pattern that plays with the parts, or none below 00 (DRUMS NONE on the strip: the part plays alone); in a song (stopped): the step's drum pattern, or none (the step's row shows it: P05 12345678 D07, D-- none)
ALGO (SEQ)The MMT-8's functions, below; SEQ goes back to the part or song
SELECT (SEQ)The place, as the MMT-8's fast-forward and rewind (below): a part by beats (SEL: by four); a song by steps (SEL: by beats)
SELECT / K3 (SONG, stopped)The step, shown and edited, and where SEL + PLAY goes on from / its part (at the END: appends the last part; past 99: the song ends there)
ARPThe drum machine's page (below); from one of its functions: back to the pattern
EDITThe sampler's pages round: POINTS (START, END), LOOP (LOOP, MODE), TUNE (ROOT, FINE, RATE), KEYS (LO, HI, TRANSPOSE, CONSTANT), CLEAR (REC empties the slot)
ENVOUT (FILTER, RELEASE, LEVEL), then the velocity amounts
LFOSPEED, DEPTH, DELAY, PRESSURE
SELECT / K1-K4 (sampler pages)The slot / the page's values. The strip under the LCD shows the slot, its sample and the program
HOMEThe sampler's overview
GLOMIDI: K1 the sampler's channel, K2 its mode (OMNI OFF, ON, then MULTI with the programs channels 1-16 play: 1-16, 2-17 .. 32-15), K3 the pitch bend's range, K4 the drums' channel. GLO again: the MIX, and again the VOICES (below)
FXThe effect, the MIDIVerb: K1 its program, K2 its return, K3 the channel whose program changes choose it, K4 on or off. FX again: each slot's send; again: each pad's (below)
SAVELit when something isn't saved: settings, the sample parameters, the sequencer (stopped)

The channel lights, the row of 16 between the LCD and the strip, flash as a message on their MIDI channel comes in or is played: from MIDI in, the keys, the sequencer, the drums, or MIDI ECHO. They go in pairs over the track buttons, channels 1 and 2 over track 1 through 15 and 16 over track 8, so a track's channel is easy to find (channel 5 is the left light over track 3). They're on every page, which helps to see what channel a keyboard sends on.

Under the strip on the SEQ page, the part playing and the one after it, large, with their names (the drum page has the same for its patterns):

The SEQ page with part 01 queued while part 00 plays: PART 00>01 B004 on the LCD, and under the strip LOOP PARTS beside part 00, and NEXT 01 lit, in 2 beats
The next part queued

SELECT moves the place, as the MMT-8's fast-forward, rewind and auto-locate:

MIDI modes (GLO)

The S700's MIDI modes, from its manual (33-37), set with K2 on the GLO page:

On the S700 the program chosen is channel 1's, so choosing another moves all 16 ("P1-16 (17-32)" in its manual is P1 or P17 chosen). On SM-87 the two are separate, so a sequence can play 3-18 while you play P1 on the keys:

Channel 10 is the drums' too. In MULTI it also plays a program (program 10 with 1-16), and the keys on channel 10 play the pads whose notes they reach.

OVS (Akai's overall settings) carries the mode both ways.

The mix (GLO, then GLO again)

LEV PAN SLOT DRM / 99 L20 01 99:

The S700 is mono, so by default every slot is at full level in the middle, and sounds as before. The level and pan belong to the slot, like a mixer's channel strip, so a sample sent to the slot keeps them. They act at once, on notes already sounding too, and are kept in the settings (SAVE).

Voices (GLO a third time)

VOICES (S700) 6 / PLAYING 2: K1 sets the number of voices the sampler may play at once, from 6 (as the S700, shown (S700)) up to 16. A seventh note on six voices takes over a voice that is fading, or else the oldest, as on the S700; with more voices that happens later. PLAYING counts the voices sounding now. A key whose note is in several samples (keygroups that overlap) takes a voice for each.

Every voice costs the audio interrupt time: the strip under the LCD shows CPU while notes play. The FM-1's limit isn't measured yet; if the sound breaks up with many notes held, lower it. Lowered while more play, the voices over the new number fade as if their notes were let go. The drums have their own 8 voices and aren't counted. It's kept in the settings (SAVE).

The effect (FX)

The effect is an Alesis MIDIVerb, the 1986 reverb, on an aux send, as it would have been on the mixer's send in a 1987 studio. Its 63 programs come from Eric Brombaugh's reverse engineering of the MIDIVerb (MIDIVerb_RE): his compiler turned its program ROM into C, which his g081_audio module runs. SM-87 runs that code as it is, at the MIDIVerb's own rate (23.4 kHz, so delays and decays are its own), between models of its input and output filters, and returns its stereo output into the mix. Its mono input is the sum of the sends.

FX 29 2.0 M Wm / RET 99 CH -- ON:

FX again, SND SLOT / 40 01: K1 sets a sampler slot's send, 0-99, after its level (a mixer's post-fader send, without the pan); K3 or SELECT chooses the slot. FX a third time, SND PAD / 60 01 KICK: the same for each drum pad, after its level and the drums' bus. A pad's send is the pads' global set-up's: a pattern with its own sounds keeps none of its own. Every send starts at 0, so nothing goes to the effect until one is turned up. All of it is kept in the settings (SAVE).

The effect costs the audio interrupt time, a few per cent of the CPU at a guess; the strip shows CPU. If the sound breaks up, turn it off (K4) and see if CPU drops. A build can leave it out altogether: SM87_FX in app/config.h.

The drum machine (ARP)

The drum page playing a pattern: PATT 00 BT 001, 8 BEATS 5 HITS, the pads KIC SNA CLH OPH CRA RID, and pattern 00 playing large under the strip
The drum machine

The LCD shows the pattern and its beat (PATT 05 BT 003, PATT 05>07 with 07 queued, PATT -- none), then its length and hits (NO DRUMS for none), or while recording the quantize and swing. The strip shows the 16 pads, lit as they sound. Under it, as on the SEQ page, the pattern playing and the next show large, with their lengths and hits: a pattern queued with PRESET lit, with the beats to go (IN 3 BEATS); in a song, the step's pattern and the next step's (NO DRUMS for a step without). The drums muted beside a part show MUTED.

White keysThe 16 pads, by velocity (the black keys do nothing here)
PLAYThe drums alone, from the top / stop; SEL + PLAY: on from the beat
PRESETThe pattern, or none below 00 (--, as a song step without drums: they stay quiet); while playing, queued for the end of the one playing
K1 / K2 / K3Tempo / quantize (1/4, 1/8, 1/12, 1/16, 1/24, 1/32, 1/48, 1/64, off; another: no swing again) / swing, the HR-16's clocks (below)
RECRecording on or off: the hits played (pads, or MIDI in on the drums' channel) go into the pattern as it loops
SEL + a pad, recordingErases that pad's hits as they come by, while held (the HR-16's ERASE + a pad)
OCT+ heldFILL: a pad held repeats at the quantize rate (off: 1/32), at the velocity it was hit at, while the drums play; recorded when recording. (The pads have no octave: OCT- and OCT+ don't change it here)
ALGOThe functions below; ARP goes back to the pattern

A new pattern is 8 beats long, as on the HR-16. A hit is placed on the nearest step of the quantize grid. It's heard as it's played, and played back from the next time round. Recording counts with the click (the SEQ page's LOOP/CLICK: its record click, at its value). It records when the drums play alone, or beside a part; it doesn't record in a song.

Swing is the HR-16's: K3 sets how many clocks (96ths of a beat) every second step of the quantize grid comes late, so a hit recorded or step-edited lands there; hits already in the pattern stay where they are. How far it goes depends on the quantize, as in the HR-16's table, and choosing another quantize sets it back to none. The strip shows it as the HR-16 does beside its number, as a percentage: where the second step falls in the pair, 50.0% none.

Quantize1/41/81/121/161/241/321/481/64off
Swing, clocks00-160-120-80-60-40-20-10
At most50%66.7%68.8%66.7%68.8%66.7%62.5%58.3%50%

The HR-16's 1/6 (0-24, up to 68.8%) isn't one of SM-87's quantize values. A swing saved by an earlier SM-87, as a percentage, loads as the clocks nearest it.

FunctionK1K2K3K4REC
STEP EDITThe hit's place, a clock (SEL: a step)Its velocityIts padThe gridErases the hit shown
LENGTHBeats, 1-682 (SEL: tens)Sets the pattern's length (stopped): hits past the end go
ERASEA pad, or all (a pad's key chooses it)Erases that pad's hits, or the whole pattern
COPYThe pattern toThe pad from, or ALL (a pad's key chooses it)The pad to (the next pad key)ALL: appends the pattern to the other (an empty one gets a copy; itself: twice as long). A pad: merges its hits onto the pad to (below)
OFFSETClocks, -99..99 (384ths; SEL: tens)A pad, or all (a pad's key chooses it)Moves the hits that much later (+) or earlier; past the end round to the start, and back. Again: as much again
PAD SOUNDThe sound: the kit's, then SLOT01-16Tuning, ±24LevelPan, <3 .. 3>Keeps the pads' sounds with the pattern; SEL + REC: lets them go (the global set-up again)
PAD MIDIIts noteIts group (pads that cut each other)Voices, 1 or 2The drums' channelThe pad as the kit sets it (sound and MIDI); SEL + REC: all of them
PROGRAM CHANGEPATT SELECT ON or OFF: a program change on the drums' channel chooses the pattern (below)
MIDI DUMPSends the drum patterns as an HR-16's SysEx dump, over USB (below)

On a pad's function, a pad's key chooses it (and plays it); so does SELECT.

COPY a pad's hits, as on the HR-16: on COPY, a pad's key chooses the pad to copy from (KICK > ?), and the next pad key the pad to copy to (KICK > TOM1); K2 and K3 choose them too. K1 is the pattern to copy to, this one or another. REC merges the hits onto that pad: the pattern keeps its length (hits past its end aren't copied), and a hit the pad already has at the same clock takes the copied one's velocity. The pad to keeps its own sound. Until a pad to is chosen REC does nothing (A PAD TO COPY TO). K2 turned past the last pad goes back to ALL, the whole pattern.

A pattern's own sounds are the HR-16's VOICE, TUNE and MIX stored with a pattern: each pad's sound, tuning, level and pan. PAD SOUND's top line says whose the pads have:

Program change (the HR-16's MIDI PROGRAM CHANGE) lets a part choose its drums. It's off until PROGRAM CHANGE says PATT SELECT ON, as on the HR-16, and is kept in the settings (SAVE).

STEP EDIT is the HR-16's step mode. STEP 001 + 24/96 is beat 1, clock 24 of 96, and below it is the hit there (CLHAT V 40 2/2: the closed hat at velocity 40, the second of two hits), or EMPTY.

The HR-16's memory dump, as its service manual has it (documentation/hr16-sysex.md):

| Pads 1-6 | Pads 7-8 | Pads 9-12 | Pads 13-16 | |---|---|---|---| | KICK, SNARE, CLS HAT, OPN HAT, CRASH, RIDE | MID HAT, CLAPS | TOM 1-4 | PERC 1-4 |

With the sequencer, the two share one clock, one tempo and one transport. Which pattern plays depends on how PLAY was started:

The drums' hits go out over USB on the drums' channel (10 unless set), and notes coming in on that channel play the pads. So an MMT-8 track on channel 10 plays them too.

Recording a part

  1. SEQ, and PRESET to the part. The LCD's top left says PART (SEQ again switches to SONG, which plays parts but doesn't record).
  2. REC: it lights, and the LCD shows REC TRK 1, the part's lowest empty track. REC + a track key chooses another; it stays chosen until you change part. REC + the armed track's key again leaves none chosen, as on the MMT-8: REC then says NO TRACK CHOSEN until REC + a key chooses one, or you change part. While it's armed, K2 sets its channel (REC TRK 2 CH 03): the keys and MIDI in play on it as you play along (MIDI ECHO), and the track plays back on it. UNCHANGED keeps the channel each note came on.
  3. PLAY: four clicks of count-in (COUNT IN 4 .. 1), then it records from beat 1. Notes in the count-in aren't recorded, except one played in its last sixteenth, which lands on beat 1. LOOP/CLICK sets the count-in's length; with none, recording starts at once.
  4. REC punches out: the take ends and the part plays on, as on the MMT-8. On an empty part this sets its length, to the nearest beat, and the part goes round at it (until then PRESET waits: the LCD says FIRST TAKE, REC SETS LENGTH). PLAY stops instead, setting the length the same way. Later takes end at the part's end: the part plays on, or with LOOP OFF it stops there. The LCD says RECORDED TRACK 1, or NOTHING RECORDED when nothing was played after the count-in (then it stops).
  5. PLAY plays it back. Another REC arms the next empty track, so takes don't record over each other unless you choose a recorded track yourself (like tape, that replaces it).
  6. SAVE (lit while something isn't saved) keeps it in the flash. Without it, the part is gone after a power cycle (or a reload of the emulator page).

The MMT-8's functions (ALGO on the SEQ page)

As on the MMT-8, where you hold a function's button: the first eight white keys are the track buttons, K1-K4 set the function's values, and REC does it (RECORD). Nothing changes before REC. The functions that change the part's events wait until the sequencer stops ("STOP FIRST"). A function is the part's shown: when a part queued takes over, its page starts again from the new part's values (a name half typed is let go). The tracks: a function starts with all eight lit; a track key chooses only its own, then the keys add and take away. COPY and MERGE take a track from (lit) and one to (flashing; red on the screen). The strip under the LCD shows the tracks and the function.

FunctionK1K2REC
LENGTHBeats, 1-682 (SEL: tens)At the end / at the topSets the part's length: events past a new end go, a note held over it is cut; at the top, the beats are added or taken off at the start
ERASEWhat: all, notes, bend, controllers, programs, aftertouch, or channel 1-16Erases it from the tracks lit; all of everything: EMPTY PART. In a song: the song
COPYThe part (song) toWhat, as ERASEAll tracks: the part goes after the other's end (an empty one gets a copy; itself: twice as long). One track (and one to): over that track, cut to the other part's length. In a song: after the other song's steps
MERGEThe track lit onto the flashing one, both channels baked in, the merged track UNCHANGED
QUANTIZE1/2 ... 1/64Note start / start & end / note end / keep durationThe notes of the tracks lit
QUANTIZE (SONG)The track's offset, ±48 clocks (384ths), at once
TRANSPOSESemitones, ±99 (SEL: octaves)The tracks lit; out of range folds back by octaves
MIDI CHANNELThe track's channel, UNCHANGED or 1-16, at once
NAMEThe cursorThe characterStores the 14-character name (a part once used)
EDITThe event's place (SEL: by beats)Key, controller, program, bend (SEL: the channel)Adds a C3 note where the event shown is; SEL + REC erases the event
CLOCKIn: INTERNAL or MIDIOut: ON or OFF(at once; SAVE keeps it)
LOOP/CLICKLOOP PARTS, ALL or OFFThe count-in, 0-99 beats(at once; SAVE keeps it) K3 the click's value, K4 when it clicks (below)
MIDI FILTERBend recorded or notControllers(at once; SAVE keeps it) K3 programs, K4 aftertouch, SELECT the channel (below)
MIDI DUMPSends the whole memory as an MMT-8's SysEx dump, over USB

EDIT shows one track's events (the track key chooses which), as the MMT-8: 1 001.05 E3 100 is track 1, beat 1, clock 5, E3 at velocity 100, and DUR 001.00 CH01 its duration (a beat) and channel (in brackets when the track plays on a channel of its own). SELECT goes from event to event; K3 is the velocity (a controller's value, the bend fine), K4 the duration (SEL: by beats; not a note: the channel). Past the last is END OF TRACK: K1 is where REC adds, K2 what (a note, a program change, a controller, bend, aftertouch). In a song, EDIT shows its steps: SELECT the step, K1 its part, the track keys its tracks, REC puts a step in before it (at the end: the part K1 chose), SEL + REC takes it out; the steps change only while stopped (STOP FIRST). While playing, EDIT follows: the last event played on the track (in a song, the step playing); stopped, it stays on it, ready to edit.

QUANTIZE in a song sets each track's clock offset, as the MMT-8's: the track key chooses the track (track 1 first), K1 moves it up to 48 clocks (half a beat) late (+) or early (-), to make up for a slow attack or MIDI delay. The offsets are every song's, kept with the sequencer's memory, and take effect from the next PLAY. An early track reads into the next step's part; at the song's start its first clocks play at once (the MMT-8's first beat can't be advanced), and a late track's last clocks are cut when the song ends.

LOOP/CLICK is the MMT-8's LOOP button and CLICK pages: LOOP PARTS IN 4 / CLICK 1/4 REC.

A take on a part with a length ends at the part's end; with LOOP OFF the sequencer stops there too.

MIDI FILTER is the MMT-8's: what a take records besides notes. FILTER CH ALL / BEND CC PROG ---.

MIDI clock in (CLOCK, K1 to MIDI): the sequencer follows MIDI clock from USB or the TRS jack. F8 moves it on (each plays 4 of its 96 clocks a beat, spaced by the last beat's clocks); FA starts from the top at the next clock, FC stops, F2 (song position) sets the place while stopped and FB goes on from there. PLAY still plays, but waits for clocks. The strip shows the tempo the clocks come at (MIDI 120). MIDI clock out (K2) goes on as it was, so the FM-1 passes the clock on. Clocks are timed in rendered frames, to a block (2.9 ms); the notes land on them.

The MMT-8's memory dump, as its SysEx document has it (documentation/manuals.md lists the manuals):

A slot into a program: PRESET to the program, EDIT to the KEYS page, SELECT to the slot. LO and HI show -- while the slot isn't in the program (the strip says OUT). One detent of K1 (LO) or K2 (HI) puts it in with the whole keyboard, C0-D#6; then K1 raises the low key and K2 lowers the high one. Turning LO past HI (or HI under LO) takes the slot out again, and one detent back puts it in on the same keys. SAVE keeps it.

Clearing a slot: EDIT to the CLEAR page (the last of the round), SELECT to the slot, then REC.

Samples received over MIDI are written to the flash at once. The slots (the sample each one plays, and every slot's parameters, panel edits too) are saved 3 s after the transfer goes quiet. If the power goes before that, the slots come back as they were last saved. A slot cleared or replaced since then comes back empty (the test tone) when the new sample took its flash, never playing the new sample's data: a dump saves the slots first before writing over a sample they still name.


4Samples

SM-87's sampler answers over USB as an X7000 with 16 slots does, so Axs7 sends and fetches samples as it does with one: from WAV files, the sampler's .qd disk images, or a real S700/X7000. Choose the FM-1's port in Axs7's MIDI view and set SLOTS to 16 (Axs7's wiki, Connecting the sampler).

The sampler's EDIT page: START and END of slot 1, the test tone
The sampler

While a sample comes in or goes out, the LCD shows its slot and the words so far (DUMP IN SLOT 07, WORDS 12000 37%), then RECEIVED or SENT. Its parameters (PARAMETERS IN, PARAMETERS SENT) and the MIDI settings Axs7 reads or changes (MIDI SETTINGS) show for a moment as they come and go. In the browser emulator a dump arrives all at once, as the browser passes a SysEx on only when it is whole, so only what came of it shows. A slot going out goes out whole as it began, even if a dump for the same slot comes in meanwhile: that one is taken into other memory (MEMORY FULL if there's no room beside the one going out), and the slot plays it from then on.

A dump that stops before its sample's end lost bytes on the way: a long SysEx through a virtual MIDI cable can. The LCD then says DUMP CUT SHORT with the words that came of those the sample has (S10 21000/28752), and again when its parameters come after it. SM-87 keeps what came, so the sample stops early and its loop turns at the last word that came, though START, END and LOOP show the sample's own. Send it again. (A sender announces up to 200 words more than it sends, so a dump may end a little before its header's count; it always comes up to its loop end, the sample's end.)

Samples sent go into the sample pool, about 292 KB, and the strip shows how much is FREE. Samples and a drum kit can also be built into the firmware, about 270 KB more (the effect's code takes about 95 KB of the same room: a build without it, SM87_FX 0 in app/config.h, leaves about 365 KB): from Axs7 (its wiki's SM-87 page), or with tools/mkrom.py (the README). Try such a package in the emulator first: its Load .fwsc plays what it holds.


5When something goes wrong

If an install goes wrong:

If a dump sent to SM-87 ends with DUMP CUT SHORT, bytes were lost on the way to it: send it again, in pieces if the sender can (the MMT-8's memory dump, under Controls, says more).

SM-87 is new and untried on the FM-1 itself. Report what happens at github.com/rogerkl/sm-87/issues.