Roland MPU-401 Technical Reference Manual
Hide thumbs Also See for MPU-401:

Advertisement

S R o lan d
MIDI PROCESSING UNIT
MPU-401
TECHNICAL REFERENCE MANUAL

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MPU-401 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Roland MPU-401

  • Page 1 S R o lan d MIDI PROCESSING UNIT MPU-401 TECHNICAL REFERENCE MANUAL...
  • Page 2 MIDI PROCESSING UNIT MPU-401 TECHNICAL REFERENCE MANUAL [CPU Version 1.5A 5/31/85] [This Manual Version 1.5 5/29/85] © Copyright Roland Corporation 1985...
  • Page 3 Warning This equipment has been certified to comply with the limits for a Class B computing device, pursuant to Subpart J of Part 15 of FCC Rules. Only Computer certified to comply with the Class B limits may be attached to this equipment. Operation with non-certified computing device is likely to result in interference to radio and T V reception.
  • Page 4 OTHER FUNCTIONS Metronome Operation, DIN Sync, The Conductor SAMPLE COMMAND SEQUENCES Internal Sync Mode, MIDI Sync Mode, Use Of FSK, Receiving MIDI Data From The MPU-401, Sending MIDI Data To The MPU-401 EXAMPLES OF PROGRAMMING Machine language subroutines for MPU-401 drivers...
  • Page 5 ROM VERSIONS DELTA GUIDE Delta guide to all releases of the MPU-401 Reference Glossary The MPU Command Table The MPU-401 Circuit Diagram...
  • Page 6: About This Manual

    M I D I The MPU-401 connects to a HOST computer via the DATA bus and uses handshaking and interrupts. The MPU-401 may be used as a memory-mapped or I/O mapped device. Roland recognizes the difficulties and weaknesses of using a simple...
  • Page 7 4 CHANNEL REFERENCE TABLES which flag all MIDI NOTE ONS played by the MPU-401 and clears them when sending a NOTE OFF, an ALL NOTES OFF or a STOP PLAY; a 8 PLAY BUFFERS which hold the next MIDI note event to be played in each track;...
  • Page 8 A NOTE TO PROGRAMMERS Programming the MPU-401 for various MIDI applications is not a difficult endeavor. Required however is a working knowledge of the following: A sound understanding of programming in the language of one's choice and at least a basic knowledge of the computer being written for.
  • Page 9 Connection to the HOST The MPU-401 connection to the HOST computer may be memory or I/O mapped. Connection is made to 8 DATA BUS lines, 1 RD*, 1 WR*, 1 RESET*, 1 SELECT*, 3 ADDRESS, 1 DSR*, 2 GROUND and 2 VCC of 5 volt dc.
  • Page 10 MIDI IN 1. a MIDI MESSAGE with a leading timing byte 2. an MPU MARK with a leading timing byte 3. an MPU MESSAGE .. to DATAPORT MPU-401 HOST transmi ts receives MIDI MESSAGE an MPU COMMAND. from COMPORT to MIDI OUT 1.
  • Page 11 HOST while PLAYING in the format shown here. The HOST should read or send the exact number of bytes defined. Reading or sending fewer than expected will cause the MPU-401 to experience a 'loop problem' as it waits for a certain sized data packet. 3rd BYTE...
  • Page 12 If the leading timing value is zero, the MPU-401 will transmit the message out and request the next data immediately. - While playing: when the MPU-401 requests next track data, if...
  • Page 13 NO OPERATION - While recording: the MPU-401 does not sent out this mark. - While playing: the MPU-401 will send nothing out the MIDI OUT port if sent this mark and then will request next track data. MEASURE END - While recording:...
  • Page 14 **** MIDI THIRD BYTE - With two byte MIDI messages such as $Cn and $Dn, only 1 byte of data is sent while recording or is requested while playing. ( n is a value from $0 to $F which indicates any MIDI channel 1 to 16 ) .
  • Page 15: Single Byte Messages

    ACK (ACKNOWLEDGE OF COMMAND) - The ACK is used by the MPU-401 to let the HOST know that any commands sent have been properly received and will be acted As an example, when the HOST sends a SET TEMPO command to...
  • Page 16 The MPU-401 will not send an ACK for commands sent as CONDUCTOR data. - When the counter reaches zero, the MPU-401 sends another $F9 to the HOST, and then executes the latest command. - The HOST can also use an MPU MESSAGE $F8 for loading...
  • Page 17: System Message

    - When MPU COMMANDS $D0 to $DF which require a following data byte (such as WANT TO SEND DATA) are sent to the conductor, only the leading timing byte and command should be sent at the first CONDUCTOR REQUEST. When the timer has counted down and it is time to execute the command, the CONDUCTOR will send another CONDUCTOR REQUEST ($F9) at which time the data for the command should be sent followed by the next timing byte and...
  • Page 18 HOST. Then the record counter cleared. : START RECORDING or RECORD STAND-BY This prepares the MPU-401 to begin recording sequence. RECORD STAND-BY MIDI START) with REAL TIME AFFECTION : ON the MPU will wait until it receives either...
  • Page 19 POLY passed to the HOST. However command $35 will allow them to be passed. the MPU-401 is set to MIDI SYNC mode with the $82 command it will begin recording at a tempo based on incoming MIDI CLOCKS ($F8s). If the MPU-401 is in...
  • Page 20 It will transmit to the MIDI OUT port of the MPU-401 the NOTE OFF messages (with velocity zero) of the notes which have been turned on while in PLAY mode. The CHANNEL REFERENCE TABLES will be cleared. : START PLAYING The MPU-401 will start to decrease the PLAY COUNTERS for all active tracks.
  • Page 21 This table shows each bit mapped possibility for the START, STOP, and CONTINUE commands of the MPU-401. FUNCTION PLAY RECORD COMMAND MIDI ====== = = = = ======= ==== ======== Do Not Use Stop Start Continue Stop STOP PLAY Stop...
  • Page 22 NOTES: Codes marked with **'s are the most commonly used ones. others are usually not used alone. MIDI timing condition has already been started another MPU COMMAND (such as $0A), or by MIDI START ($FA) CONTINUE ($FB) from MIDI IN (with REAL TIME AFFECTION : ON), then these commands will turn RECORD ON.
  • Page 23 MIDI data without timing bytes in DATA IN STOP mode. MODE MESS : ON - Normally the MPU-401 masks all MODE MESSAGES received from MIDI IN. This command allows the host to see all MODE MESSAGES (OMNI ON / OFF, POLY, MONO, LOCAL ON / OFF) except ALL NOTE ($Bn, $7B, $00).
  • Page 24 SYSTEM RESET ($FF). All functions, timers and tables are disabled. UART mode. - The MPU-401 will act as a simple UART. This function is used when the programmer wishes to disable all MPU functions, that the MIDI bus can directly be accessed by the HOST.
  • Page 25 NOTE ON. The CHANNEL REFERENCE TABLES are also used to wait until the notes all tracks become OFF before transmitting a NOTE OFF message to MIDI OUT of the MPU-401. (See diagram below.) Overlap Timing Diagram O F F...
  • Page 26 LSBs of the command. SWITCHES INT CLOCK - This allows use of the INTERNAL clock of the MPU-401 by the HOST for recording or playing. INT CLOCK is used if the MPU- 401 is to be the master clock of the MIDI system.
  • Page 27: Voice Messages

    This table shows the effect of commands $86 and $87 on incoming MIDI VOICE MESSAGES: Voice Message note off event note on event note after touch control change 0 - 6 3 64 - 95 program change channel after touch pitch wheel are LSBs ($0 to $F ) indicating MIDI channels 1 to 16...
  • Page 28 NOTE OFF, the MPU-401 will not transmit the NOTE OFF. If the MPU-401 is playing and NOTE ON events of the same key number and channel come from the HOST and MIDI IN, the CHANNEL REFERENCE TABLES and MIDI IN TABLE are used...
  • Page 29 (See $E4 and $E6 commands.) CONDUCTOR : OFF CONDUCTOR : ON - While in PLAY mode: with the CONDUCTOR : ON the MPU-401 will request CONDUCTOR data by sending MPU MESSAGE $F9. When the HOST receives the $F9, it must send conductor data which should consist of: a.
  • Page 30 REAL TIME AFFECTION while in RECORD or PLAY modes. - This command also allows MIDI REAL TIME MESSAGES ($FA, $FB, SFC) to pass through from MIDI IN to MIDI OUT of the MPU-401. FSK TO INTERNAL - Sets...
  • Page 31 - The CHANNEL REFERENCE TABLES are used by the MPU-401 while playing back track data. If more than one if the same MIDI key number is sent over the same MIDI channel (either from multiple tracks or from 'merged' data) the REFERENCE TABLES will automatically turn the note off and the retrigger it again.
  • Page 32: Reading Data

    READING DATA When these commands are received, the MPU-401 will send 1 byte data back to the HOST. The HOST MUST read the MPU-401 data byte in order to continue the activity of either. $A0 - $A7 Requests PLAY COUNTER value of tracks 1-8.
  • Page 33 PLAY counters must be cleared. This command clears PLAY counters of all tracks and the CONDUCTOR. It also clears the PLAY MAP so that the MPU-401 will not transmit any messages for the first time. Use this command before any START PLAY sequence.
  • Page 34 SET TIMEBASE $C2 - $C8 Sets Timebase. - These commands select the internal TIMEBASE of the MPU-401. Only one may be selected at a time. TIMEBASE refers to number of clock pulses the counters will use per beat. COMMAND TIMEBASE...
  • Page 35 WANT TO SEND DATA When sent these commands, the MPU-401 expects a MIDI VOICE MESSAGE without a leading timing byte. For example, to send MIDI NOTE ON #69 on with velocity value #55 in channel 1 the HOST would send $90 $45 $37.
  • Page 36 HOST. The HOST must always send this byte. SET TEMPO - Sets the TEMPO of the MPU-401's internal clock in Beats Per Minute. RELATIVE TEMPO - This command can be used in PLAY mode to change the tempo of the MPU-401 temporarily.
  • Page 37 METRO/MEAS - This command sets the number of beats per measure, based on number of MIDI CLOCKS/METRONOME BEEP. For example, when metronome is set to 1/4 notes and the value sent following this command it will set a measure at 4 beats. INT * 4 / CLOCK TO HOST - Sets the Number of INTERNAL CLOCKS per CLOCK TO...
  • Page 38 ACTIVE TRACKS ON / OFF command. If RECORD ON is be sent to the MPU-401 while it is playing (punch-in) it may be important to know the current value of play counters for calculating your position in the measure.
  • Page 39 POWER-UP condition. All switches values will be cleared default conditions. This command is useful for returning the MPU-401 to power-up condition. All buffers are reset by this command. The MPU- 401 returns an ACK ($FE) when sent this command.
  • Page 40 5.12 MIDI MESSAGE FLOW following tabie shows the effect that MPU commands have on the flow of MIDI through the system:...
  • Page 41 POWER UP DEFAULTS The following list shows the power-up condition of all MODES, FUNCTION SWITCHES and FUNCTION VALUES of the MPU-401. MODES MIDI REAL TIME MESSAGE STOP PLAY STOP RECORD STOP FUNCTION SWITCHES FUNCTION CONDITION EQUIVALENT COMMAND Sync mode internal...
  • Page 42 DEFAULT VALUES FUNCTION VALUE EQUIVALENT COMMAND Time base Tempo Relative tempo ratio Graduation MIDI / METRO METRO / MEAS INT / HOST CLOCK none Active track number Send play counter none Acceptable channels Reference Table A ch 1 Reference Table B ch 2 ch 3 Reference Table C...
  • Page 43 AFFECTION is ON, these counters are NOT initialized by METRONOME : ON and the metronome will still be synchronized to the beat and the bar. A METRONOME OUTPUT JACK is provided on the MPU-401 to send out an audio signal of the internal metronome beeps that can be sent to any amplifier or mixing board.
  • Page 44 THE CONDUCTOR While playing, if the CONDUCTOR is set ON ($8F) the MPU-401 will send the MPU MESSAGE $F9 to the HOST to request conductor data in the same manner as the REQUEST TRACK DATA messages ($F0 - $F7). When the MPU...
  • Page 45 (value between $00 and $EF) MIDI data (any MIDI data or status from $00 to $EF) NOTES: 1> The MPU-401 sends DATA and REQUESTS to the HOST in the same manner. They are shown as seperate functions in these examples to make their use clear.
  • Page 46 RECORD STOP MIDI STOP - FSK (!) and DIN OFF this will stop the recording, send an $FC MIDI and make the MPU-401 send final timing byte and DATA END MARK to the HOST. Sn Cmd turn the metronome off...
  • Page 47 SnDta and the DATA END mark. If this is the last track the MPU-401 will send an $FC to the HOST. RcDta MPU-401 sends an ALL END MESSAGE when the HOST has sent it's last DATA END mark...
  • Page 48 4> The HOST may send MIDI RUNNING STATUS to the MPU-401. When the MPU generates ALL NOTES OFF ($B0) and the next byte from HOST RUNNING STATUS, MPU-401 will automatically generate correct status byte. 5> The MPU-401 will send the...
  • Page 49 ; START RECORD START PLAY MIDI START - FSK (!) and ; DIN ON ; The MPU-401 will now send both TRACK DATA REQUESTS along with data. ; Upon receiving an interrupt, the HOST should look at the DATAPORT of ; the MPU-401.
  • Page 50 RECORD WITH LEAD-IN (INTERNAL SYNC) Most often there should be a one or two measure lead-in with metronome to prepare the musician for recording. During this time it is good idea to store any MIDI data that may come through. first notes played...
  • Page 51 ; command and send the next REQUEST NOTES: 1> CONDUCTOR can use WANT TO SEND DATA (commands $D0 to $D7) send MIDI data to the MIDI OUT port of the MPU-401. It should only send data on non ACTIVE tracks if the MPU-401 is in PLAY mode.
  • Page 52 MIDI SYNC MODE The MPU-401 can also be set up as a MIDI slave unit to other MIDI clocks. In MIDI SYNC mode, the MPU-401 can be made to record or play back at the request of external devices such as drum machines or other sequencers.
  • Page 53 MIDI TIMING CLOCK ($F8) could be missed putting the system slightly out of sync. 2> Placing the MPU-401 into MIDI SYNC MODE means the internal counters will all be synchronized to the incoming MIDI TIMING CLOCK tempo. 3>...
  • Page 54 MIDI START, or may choose to send a STOP PLAY command. In this case we do not wish to send a MIDI STOP to MIDI OUT of the MPU-401 since there is still another sequencer working. Sn Cmd...
  • Page 55 MIDI CONTINUE ($FB) before beginning the record/play process. FSK (!) and DIN will go ON. MPU-401 will now send both TRACK DATA REQUESTS along with data. Upon receiving an interrupt, the HOST should look at the DATAPORT of the MPU-401.
  • Page 56 START and STOP commands to the MPU-401. The HOST should not send a START to the MPU-401 until the pilot tone of the FSK is being read back into the TAPE IN jack. When the FSK RESOLUTION is set to internal ($92) there will not be any FSK signals put out through the TAPE OUT jack while the MPU-401 is in FSK mode.
  • Page 57 RECEIVING MIDI DATA FROM THE MPU-401 While in DATA IN STOP or RECORD modes, the MPU-401 will be sending timing bytes, MIDI data, MPU MESSAGES and MPU MARKS to the HOST. When the HOST is first interrupted, the registers of the computer are saved to the stack and the DATAPORT of the MPU-401 should be read.
  • Page 58 4> This routine assumes that data has been stored into memory in a 'raw' fashion as it was generated by the MPU-401. In fact, there are numerous methods for storing and recalling musical data.
  • Page 59 All MPU commands are sent to COMPORT. All MPU data bytes are sent to or read from DATAPORT. *** IMPORTANT *** After the reset, DATAPORT of the MPU-401 must be read to clear the DSR, before enabling interrupts. A. Sending a command to the MPU-401.
  • Page 60 #DRR test bit6 Sn.Cmd if bit 6=1 then keep trying mask interrupts combfr get command COMPORT send to the MPU-401 Sn.Cmd2: STATPORT get status Sn.Cmd2 if bit 7=1 then keep checking DATAPORT get data from MPU #ack is it an acknowledge? Sn.Cmd3...
  • Page 61 B. Sending data to the MPU-401. This program can be used to send one data byte which is: following to the commands ($E0 - $EF). the part of data following to the commands ($D0 - $DF) . part of a message which...
  • Page 62 D. Sending a command to the MPU-401 that returns a single byte response. This program can only be used for sending a command ($A0 - $AF) and reading a byte. To send the command and read the data: 1. test DRR (bit 6) of STATPORT.
  • Page 63 #$04 ; push processor status ; with interrupt disabled ; this is the same as ; interrupt temp ; adjust stack level inti ; jump to fixed entry ; interrupt service ; routine...
  • Page 64 ROM VERSIONS DELTA GUIDE The version 1.5A ROM reflects numerous improvements and refinements to the concept and architecture of the MPU-401. Some changes are based on function problems, and others on reconsideration of process. This guide can be used by those people needing to create software for MPU units done previous to the version 1.5A release (5/31/85).
  • Page 65 14. - When no clock is received from TAPE IN in FSK SYNC mode, requests TEMPO should not be used. FOR VERSION 1.4 15. - A correction to timing in MIDI SYNC MODE is made. Previous versions would ignore one incoming MIDI CLOCK ($F8) if MIDI START ($FA) was too close to the clock.
  • Page 66 In previous versions if STOP RECORDING was sent directly at the measure end, the MPU MARK $F9 (MEASURE END) would not be sent. FOR VERSION 1.5A 27. - RUNNING STATUS (from MPU-401 to HOST) is cleared when START RECORDING STOP RECORDING.
  • Page 67 DELTA GUIDE TABLE received SPP o r S S Request Ver and Request Rev R u n n in g status problem after S Y S T E M C O M M O N E X C L U S I V E to H O S T -O N do not use problematic A L L N O T E S O F F - O F F when C O M M O N to H O ST -O N , R T to...
  • Page 68 Reference Glossary Acceptable Channel : While in RECORD mode or DATA IN STOP mode, MIDI messages acceptable channels received from MIDI sent HOST. power channels acceptable. commands SEE $EF with following data byte for each can be used setting each channel acceptable or not. ACK : Acknowledge.
  • Page 69 Clear Play Counters. Clear RC : Clear Record Counter. CLK : Clock. Clock : This refers to the method which the MPU-401 uses to keep track of time between MIDI events. CLOCK TO HOST : MESSAGE ($FD) sent to HOST regular intervals when enabled.
  • Page 70 Data Send Ready (active low). The HOST can read this signal on bit 7 of STATPORT or DSR * line. The MPU-401 wants to send a byte to the HOST when DSR * is low. Line for DSR * signal. EOX : MIDI End Of Exclusive ($F7).
  • Page 71 This message includes an $F0, an ID number, data bytes and end with an EOX. Exclusive THRU : An MPU-401's mode in which the Exclusive messages from MIDI in are transmitted to MIDI OUT. Exclusive to HOST : An MPU-401's mode in which the Exclusive messages from MIDI IN are sent to the HOST.
  • Page 72 MIDI format or MPU format. Metronome : The sound reference on the MPU-401 which is audible when the METRONOME ON command $83 or $85 is sent. MIDI : Musical Instrument Digital Interface.
  • Page 73 - Refers to whether MIDI receivers are in OMNI ON or OFF, and 2. POLY or MONO mode. MPU-401 - Condition of the MPU-401 such as RECORD, PLAY, STOP or UART mode etc. MODE MESSAGE : Part of MIDI CHANNEL messages.
  • Page 74 MPU message : message created in the MPU-401 to send a function the HOST. (Without leading timing byte.) MSB : Most significant bit(s). NOTE OFF event : MIDI message indicating a note on the keyboard has been released. NOTE ON event :...
  • Page 75 MIDI information with timing values stored in the HOST's memory, which comprise a 'song'. Stand-by recording : A mode of the MPU-401 which is ready to record, waiting for a start command from either the HOST or MIDI IN. START : One of the MIDI REAL TIME messages ($FA) .
  • Page 76 A MIDI REAL TIME messages ($FC). Stop playing or recording A mode that the MPU-401 is not PLAY or RECORD mode. System : MIDI SYSTEM message - SYSTEM EXCLUSIVE messages, SYSTEM COMMON messages or SYSTEM REAL TIME messages. See MIDI message.
  • Page 77 CONTROL CHANGES, PROGRAM CHANGES and BENDER mes­ sages. They always belong to one of MIDI channels. WSD : Want to Send Data. An MPU command which tells the MPU-401 to transmit a MIDI message following the command. Sign of a number described in HEXADECIMAL.
  • Page 78 „ z <©«■w § 9 5 £ c £ c 5 r o o g < < . = o o o o o - «■* W • - 00 C N Z O UJ ■ £ ..X . < / > <...
  • Page 79 M P U - 4 0 1 C irc u it D ia g r a m...
  • Page 80 MIDI message flow M ID I...
  • Page 81 [^Roland® 2701040200 iHRoland...

Table of Contents