Showing posts with label AIX007. Show all posts
Showing posts with label AIX007. Show all posts

AMPLINEX 007

image
AMPLINEX issue 007 was published in September 1988. Each AMPLINEX magazine is stored as a 200K single-sided 80-track disk image file (.ssd file type). The image can be used to create disks for a BBC Micro or can be loaded into a BBC emulator. For the disks to run, the BBC (real or emulated) must have an AMPLE Nucleus ROM installed and be running the Hybrid Music System.

Tune for Pipes and Flutes

by Andy Knight

 

Source: AMPLINEX 007 disk, file $.FLUTES


Published in AMPLINEX 007, September 1988

There Are Many Stops Along the Way

by Ian L Hubbard

Composed by: Joe Sample

 

Source: AMPLINEX 007 disk, file $.THEREAR


Published in AMPLINEX 007, September 1988

Russians

by Jamie Lewis

Composed by: Sting

 

Source: AMPLINEX 007 disk, file $.RUSSIAN


Published in AMPLINEX 007, September 1988

Overture

by Diccon Maude

A musical fantasy by Diccon Maude, aged 14. Started and finished in 17/04/1988

I composed and arranged this piece in one day (you may say - "Huh! Sounds like it an' all!"). I made the accompaniment up first, put a simple bass to it, and added the top part, which I won't call a melody.

The top part uses Panflute as I like the sound. The accompaniment uses Upright. (I think Upright is an excellent reproduction of a piano).

I have made the bass part stronger by using 3 2 Echo. The Drum rhythm uses 49 =L, so that accents can be heard.

The middle part of the piece, where the voices change, was decided by my dad, who I like to consult with, and obtain any 'sound' advice (Groan!).

'harps4' is from the Studio 5000 User Guide, and Vibglock was chosen simply because it sounds nice.

Does it 'click' when the voices change back to normal on your type of computer? It does on mine. Does anyone know why and/or how to stop it?

Anyway, hope you like it.

Diccon Maude (14)
 

Source: AMPLINEX 007 disk, file $.OVER


Published in AMPLINEX 007, September 1988

Misty

by John Bartlett

Composed by: Erroll Garner

I tried to achieve a sound reminiscent of Erroll Garner and have a 'human' feel.

(If anyone is interested in examining the music on the STAFF, load the part in question into NOTEPAD and remove the arpeggio notation from the chord and reMAKE first.)

John Bartlett
 

Source: AMPLINEX 007 disk, file $.MISTY


Published in AMPLINEX 007, September 1988

Kitten on the Keys

by Rick Costin

Composed by: Zez Confrey

 

Source: AMPLINEX 007 disk, file $.KITTEN


Published in AMPLINEX 007, September 1988

Jesus Walking on the Water

by Rosemary Brown

Composed by: F Liszt

a 7 voci bew. Cees le Grand.

 

Source: AMPLINEX 007 disk, file $.JEWALIA


Published in AMPLINEX 007, September 1988

For a Dying Man…

by Michael Harbour

Dedicated to nobody in particular. I'm only 14 years old

 

Source: AMPLINEX 007 disk, file $.DYING


Published in AMPLINEX 007, September 1988

The Drunken Blues

by Corin Greaves

Using the 'human' approach

A short piece displaying two techniques that I regularly use in my music.

The first is the use of irregular quantize values on the recorder module to produce a more 'human' out-of-time feeling.

The second is the use of changing instruments on one voice for percussion to save channels for tuned sounds. This can lead to 'fatter' music, though it is quite processor-intensive. Part2a is a good example of this.

Also used are some new percussion sounds, including a beefier bass drum.
 

Source: AMPLINEX 007 disk, file $.DBLUES


Published in AMPLINEX 007, September 1988

Desafinado

by Roger Sapolsky

Composed by: Antonio Carlos Jobim

Taken from "The BRAZILIAN masters". TRO Hollis Music, INC. N.Y. controls publications rights for the USA.

My arrangement uses the original guitar solo to which I have added a 'Brazilian' rhythm section.

With due acknowledgment to Andy Thomas and Roger Cawkwell for their work on the ACT command in AMPLINEX 002 & 003.

Roger Sapolsky
 

Source: AMPLINEX 007 disk, file $.DESAFIN


Published in AMPLINEX 007, September 1988

Caribbean Romance

by Graham F Firth

Composed by: Harold Smart

Music (c) 1973 Jackson Music Ltd
Code (c) Graham F Firth, November 1987
 

Source: AMPLINEX 007 disk, file $.ROMANCE


Published in AMPLINEX 007, September 1988

Cannon

by R Williams

 

Source: AMPLINEX 007 disk, file $.CANNON


Published in AMPLINEX 007, September 1988

Arp

by Earl Bonnar

A very short piece I did for the Music 5000 when I first started - so short it doesn't even have a name.

It's also the file I had trouble switching mixes because of the Echo voices (see Questions and Answers in this issue of AMPLINEX).
 

Source: AMPLINEX 007 disk, file $.ARP


Published in AMPLINEX 007, September 1988

An Ode

by P Gray

This piece of music was a first attempt at composing using the recorder section of the 5000/4000 system.

Screen designed using ASD.
 

Source: AMPLINEX 007 disk, file $.ANODE


Published in AMPLINEX 007, September 1988

Keyboard split utility ('U.KSplit')

Richard Bettis

1) Introduction

The AMPLE program 'U.KSplit' contains the bare essentials of a utility to produce a sound 'split' when playing a Music 4000 keyboard.
The program will work with a Music 5000 (it doesn't use any of the words in the M4 module), but the same effect is easier to obtain by writing multiple parts.
The main purpose of the utility is to allow the 'live' playing of more than one sound; in the example provided these are 'Upright' on the higher notes and 'Slapbass' on the lower ones.
The actual position of the split can be defined by the player when the program is RUN.

2) RUNning the program

When the program is RUN, a prompt is given to define the 'split-point'. When a note is played, this becomes the lowest note for the 'top' instrument.
Any number of notes may be tried, but only the last one played will count.
When RETURN is pressed to select the 'ok' message, the split keyboard is brought into operation, and can be played.
In use the current program allows up to four note polyphony in each of the two sections.

3) How it works

As you may have guessed, the split function is based on the ACT structure. The rest of the program may also merit some description.
'setup' is merely a definition of a single 'player' with 8 voices, the first 4 voices are used by the higher section of the keyboard, while voices 5 to 8 are for the lower section.
'select' restores the default ACT, then uses 'getsplit' to prepare for finding the splitpoint. After that it displays a MENU with just one option, to tell the program that a splitpoint has been selected. (In effect this just provides a simple and familiar format for a 'pause' while the user decides).
'getsplit' redefines ACT for the first time. All that it actually does is to make a copy of the PITCH number, and store this in a variable, 'splitpoint'.
'ok' just confirms the note that has been chosen (the numbers work in semitones above or below middle C), and cancels the 'getsplit' ACT command.
'splitact' redefines ACT to give the split keyboard effect. One problem to be overcome is the allocation of different voices. Each key pressed while another is being held adds to the VOICE number generated; however, we want to split 8 possible notes into two groups of 4. This is done by 'change' (see below) on each voice number, which renumbers 5 to 8 as 1 to 4 again!
The PITCH value of the note is then compared with the selected value in 'splitpoint'. If it is above the splitpoint the ACT continues as normal (with any revisions to voice number already made by 'change').
If, on the other hand, the PITCH is below the splitpoint then 4 is added to each (none zero) voice number.
The net effect of all this is to ensure that higher notes are played on voices 1 to 4 and lower notes on voiceS 5 to 8, thus effecting the 'split'.
'change' reduces the VOICE numbers to the range 1 to 4. For speed of operation, and to avoid problems with the value 0 generated for both the LEVEL voice at all times and the GATE voice for an 'OFF GATE', the change is made using a 'look-up table'.
This is an ARRAY, 'vtabl', which has 9 elements (including element 0). 'change' takes each voice number and replaces it with the value held as that numbered element in 'vtabl'. For element 0 to 4 this makes no change, but elements 5 to 8 contain the values 1 to 4 again, so these voice numbers are re-allocated.
Finally 'RUN' coordinates the procedure. It does a 'setup', uses a word 'vset' to set up the 'look-up table' for VOICE numbering, allows the user to 'select' a splitpoint, and then sets the split keyboard going.

4) In conclusion...

Obviously, the actual voice allocations in 'setup' can be simply changed to any other instruments.
By changing the pitch played in each section, either by using SHIFT in the instrument definition or by altering the pitch voice in ACT, it is possible to play two melodies in the same register at the same time using different instruments on the same keyboard (at least I presume that it is possible - neither my brain nor my fingers could cope with it!).
I did originally write a more general version that allowed for a definition of the total number of voices, and how they were allocated between the two sections. However, the additional processing required led to a noticeable slowing down of the response to the keyboard. Notes sounded just late enough after pressing the keys for me to be aware of the delays, and block chords sounded like fast arpeggios!
This version, with values fixed both by constants in the ACT definition and by the contents of the look-up table, does not produce that much of a delay in note processing - it is only just audible on block chords.
(My next essay may well be called 'Swings, Roundabouts and Compromised Ideals').

Related file on this disc:
U.KSplit - AMPLE keyboard split utility program (LOAD and RUN)

Published in AMPLINEX 007, September 1988 

Instruments

To make the best use of disc space we have combined several instrument definitions into one file. These can be saved individually if required, either by loading/saving via a word processor or from within AMPLE (after *EXECing in this file) using:
*SPOOL insfile
"insname" TYPE
*SPOOL
where 'insfile' is the file on which the individual instrument definition is to be held and 'insname' is the word containing the instrument definition.
"pufflute" [2 CHANS
1 CHAN
 Hollow       Flat         Puff
 128 AMP       ON RM        193 SHIFT
2 CHAN
 Pure         Slowvib      Tailed
 128 AMP
EVERY CHAN
% A bit more full than Panflute with a
% more 'breathy' sound.
% by Corin Grieves
]
"gchurch4" [4 CHANS
1 CHAN
 Pipes        Flat         Onoff
    0 SHIFT   128 AMP       2 POS
2 CHAN
 Pipes        Flat         Onoff
 -191 SHIFT   128 AMP      -1 POS
3 CHAN
 -384 SHIFT   128 AMP      -2 POS
 Pipes        Flat         Onoff
4 CHAN
  193 SHIFT   128 AMP       1 POS
 Pipes        Flat         Onoff
EVERY CHAN
% Grand church organ sound
% by Paul Williams
]
"nasty4" [4 CHANS
ODD CHAN
 Hollow      Flat         Onoff
  ON RM
EVEN CHAN
 Watery      Delvib       Verylong
    1 SHIFT    10 OFFSET  128 AMP
3 CHAN
   80 SHIFT     5 OFFSET  128 AMP
4 CHAN
   81 SHIFT    15 OFFSET  128 AMP
EVERY CHAN
 OFF PHSET
% See 'nasty4info' for details.
]
"nasty4info" [DISPLAY
% Sounds not unlike an electric guitar
% at octaves -1: and -2:. No good for
% playing chords though because it is,
% in effect, two two-channel sounds
% playing a 1st and a 6th, e.g. C(F),
% which gives a more guitar-like
% effect.
% by Mike Dobson
]
"chinabell" [2 CHANS
1 CHAN
 Pure         Flat         Percuss
  40 FM        598 SHIFT
2 CHAN
 Clear        Flat         Verylong
 128 AMP
EVERY CHAN
  ON PHSET      6 PITCH
% More interesting than Vibglock with
% a satisfying 'thunk'.
% by Corin Grieves
]
"choir4" [4 CHANS
1 CHAN
 Metal        Slowvib      Tailed
 128 AMP       ON SYNC     -420 SHIFT
2 CHAN
 Syncer       Slowvib      Spike
3 CHAN
 Metal        Deepvib      Tailed
 128 AMP       ON SYNC     -440 SHIFT
4 CHAN
 Syncer       Vibrato      Spike
    1 SHIFT    200 OFFSET
EVERY CHAN
% Choir emulation. Range -1: to 2:.
% Like a chorus effect?
% by Mark A J Mulders
]
"nice4" [4 CHANS
1 CHAN
 Round        Deepvib      Tailed
 -3 POS        300 OFFSET
2 CHAN
 Round        Delvib       Puff
 -2 POS
3 CHAN
 Round        Slowvib      Tailed
  3 POS        100 OFFSET
4 CHAN
 Round        Delvib       Soft
  2 POS          0 OFFSET
EVERY CHAN
 128 AMP      OFF PHSET
% See 'nice4info' for details
]
"nice4info" [DISPLAY
% A very nice sound indeed. For
% maximum niceness play big chords.
% Works well over a wide octave range
% and sounds almost vocal around
% octave -1:.
% by Mike Dobson
]
"superins" [4 CHANS
ODD CHAN
 Broad        Wide         Onoff
  ON SYNC      384 SHIFT   128 AMP
EVEN CHAN
 Syncer       Flat         Onoff
1 PAIR CHAN
  2 POS
3 PAIR CHAN
 -2 POS          2 SHIFT
EVERY CHAN
  ON PHSET
% by Simon Elzinga
]
"guitar" [2  CHANS
2 CHAN
 Bright       Flat         Verylong
1 CHAN
 Broad        Flat         Verylong
 1200 OFFSET   ON SYNC
EVERY CHAN
  ON PHSET
% by S Burnett
]

Published in AMPLINEX 007, September 1988

Hints and tips

ROM compatibility

We begin this issue's Hints and Tips section with a collection of the responses to our request for details of ROMs which do and do not work with AMPLE.

Ted Kirk
The POINTER ROM for the Marconi RB2 Trackerball on the BBC Master has to be UNPLUGged before booting up the Music 5000 or 4000. This is with AMPLE in a lower priority socket than POINTER. I haven't tried it the other way round.

Richard Bettis
I have various ROMs installed in my machine, and have no trouble running AMPLE with:
Acorn BCPL
Acorn Logo
Acorn Pascal ADDCOM 1.30
Altra PROBE 4.02
AMX Super ROM 3.31
BASIC Extensions
Beebmon 1.00
Caretaker 1.03
Clares BROM 1.06
CMS Multi-BASIC
Computer Concepts Graphics ROM 2.09
DFS 1.20
Disc Doctor 1.0B
Exmon
Exmon II
Gremlin 1.00
ROM Manager
Skywave FORTH
Sleuth 1.05
System SPY 2.01
System ADE 2.01
Toolkit 1.23
Toolstar 1.77
View 3.0
ViewStore
Wordwise 1.10
Toolstar and the Beebug HelpROM did cause problems if *HELP was used, otherwise they were OK.
D.A.Computers EXTRAS crashed AMPLE.

G H Richardson
In Questions and Answers of AMPLINEX 005 I wrote that I had problems with *DRIVE and *ACCESS and you advised me to check my ROMs. This I did and found that the Printmaster ROM was the culprit. Since removing it I have had no problem. You can, therefore, add this to your list of incompatible ROMS. I should perhaps add that the Printmaster ROM was present when I had a BBC B and Music 500 and I don't recollect any problems then. I now have a Master 128 and Music 5000 and it could be that this combination is what has caused the problem.

Patrick Black
I've found that the Advanced ROM Manager (ARM) from ACP can sometimes cause problems. It contains a *KILL command to disable resident ROMs, and on my system, crashing out of AMPLE with CTRL-BREAK results in ARM KILLing off AMPLE. To be re-activated it needs a power-up reset, or *FX200,2 to be typed in.
Fortunately the *KILL command will work on ARM itself, so it can be switched out before starting an AMPLE session. The syntax is *KILL n, where n is the number of the ROM socket containing ARM. This command could be put near the start of the AMPLE !BOOT file. The problem can be overcome by leaving AMPLE 'legally' with a *BASIC command of course, but that's no good if the program's crashed!

Editor's note:
I can add the following ROMs to the list of those which work with AMPLE on a BBC Model B:
AMX Pagemaker 1.0
ATS 2.58 (as long as the Teletext adaptor is switched off)
Watford DFS 1.43
If you have experience of any ROMs which have not been mentioned above, or if you have more information on any that have been mentioned, please let us know. We will then publish a revised list in a future issue of AMPLINEX.

Spooling from AMPLE

Quentin Stafford-Fraser
I use the following short utility word to write out AMPLE word definitions to disc (from where they can be *EXECed back into another program).
"spl" [% Syntax: <word> <file> spl
$12 "SPOOL " $+ OSCLI
" TYPE *SPOOL " $+
]
Thus
"perc" "fred" spl
will spool the definition of the AMPLE word 'perc' to a file called 'fred'.
I have a BBC Master and I often change this utility to use the *SPOOLON rather than the *SPOOL command so as to send several definitions to one file.

Shadow RAM boards

Pete Christy
In AMPLINEX 003, B J Dawson asked for some information on Shadow RAM boards. I have used both the Watford and Aries boards and offer the following observations.
Initially, I had an early Watford board which would not work with AMPLE BCE, but mostly worked OK with AMPLE Nucleus. I upgraded to the latest ROM about a year ago, and it then worked fine with BCE and Studio 5000 Release 3.
When I got the Music 4000 keyboard pack, with Studio 5000-4 release 1, I found that the system disk would hang during booting unless I moved the Shadow RAM workspace to location &0A00 (the cassette/serial port buffer).
When I got Release 2 with the Staff printing facility, the Staff display got corrupted if I used location &0A00 as Shadow RAM workspace and I was unable to find any location that would allow the Staff printing to work. Without the Shadow RAM there was insufficient memory for the Staff editor to be of any use.
I consulted Chris Jordan of Hybrid Technology who recommended the Aries Shadow RAM board. At first I was suspected this was a sales pitch, as he had designed it! However, in desperation I bought one and it works a treat. No problems at all with any release of Studio 5000 or 5000-4.
The Aries board is much better organised than the Watford, compatibility is excellent with all soft and firmware, and I cannot recommend it highly enough. A slight irritation is that the only compatible ROM board is the Aries one - you can't use Aries Shadow RAM and an ATPL board for instance.
On the other hand, with the Aries Shadow RAM board, and the ROM board with Sideways RAM in it, you have an extremely powerful system with lots of very useful utilities included and it is extremely useful for word processing.
As to how useful it is with AMPLE - well, unless you use the Staff editor, not very! In fact you can easily end up with less memory than with an unexpanded machine.
This is because when booting from the system disk, AMPLE reclaims some memory from the DFS. It moves PAGE back from &1900 to &1500, but ONLY if PAGE was &1900 to start with. All Shadow RAM systems require a page of work space, and most default to take this from &1900 to &1A00. This means that AMPLE won't reclaim memory, and you end up with LESS memory available!
However, if you don't intend to use the Staff printing facility you can move the workspace to &0A00, and gain about an extra 1K in all modes except the Staff editor, where you gain an extra 8K.
The following table gives an indication of the memory available in different modes as revealed by the "MEM" command.
Shadow     5000           5000-4
mode       release 3      release 1/2
OFF        15793          14505
ON
workspace  15025          13737
at &1900
ON
workspace  16817          15529
at &0A00

Using external effects

Mike Dobson
Like AMPLINEX my Music 5000 is now one year old. Since buying it I have added the Music 4000 keyboard and most recently a proper amplifier (rather than my Curry's bargain stereo). The fact that the amplifier has an overdrive distortion effect built-in has led me to discover the marvellous things external effects will do for your Music 5000/4000.
I also have a stereo delay and a flanger - both guitar effects pedals. The delay pedal has obvious benefits, the flanger can produce some far-out results and both allow my Music 5000 to do some very passable guitar impressions.
There are a vast range of effects that could enhance your Music 5000. Some are expensive (£100+ for a delay pedal) but can usually be found second-hand for less than half-price from music shops or magazines.

%STAFF

Quentin Stafford-Fraser
Many words, if loaded into the Staff editor with GET, leave just a blank staff - even those with lots of music in them! If this has puzzled you, then read on...
For some reason, words created (by MAKE) in the Staff editor always have the comment %STAFF at the beginning of them. If this is added to a word created elsewhere, for example in Notepad, it can then be loaded into the Staff editor without any problem.
Why the ATOS module checks for this, I have no idea - does anybody else? Note too that music on the staff cannot be played using the f1 key if it has certain words above the staff like REP( or FOR(. The editor will, however, MAKE it quite happily and the music can then be played by typing its name at the command prompt.

Published in AMPLINEX 007, September 1988

MIDI Xpander code


REM To be *EXECed into BASIC
AUTO
REM **********************************
REM *  MIDI to AMPLE Interface Code  *
REM *  Copyright Scott Mackie 1988   *
REM **********************************
REM
REM Another Underwhelming Project From
REM The Awfully Nice Software Company!
REM
REM Copies of this code may be made on
REM condition that no profit is made
REM
REM Published by AMPLINEX
REM September 1988
REM
buffer=&A00:table=&96:in=&90:out=&91
splitarray=&C80:ssplit=&BFF
esplit=&C07
REM Change the following addresses to
REM suit your own interface. These are
REM the locations of the ETI port A.
status=&FCF0:data=&FCF1
FOR opt%=0 TO 7 STEP 7
O%=&4000
P%=&0900
REM Rather misleadingly titled gnote!
REM Foreground data output routine
[OPT opt%
.gnote lda out     \ Get Outputpointer
CMP in             \ Any data?
BEQ gnote          \ Nope? Check again
LDY out
LDA buffer,Y       \ Get buffer data
INC out            \ Update pointer
RTS
\ This is the main loop of the code
\ Calls the various routines needed
\ having analysed the data. Any extra
\ checking should go in after the
\ patchchange check.
.code JSR gnote    \ Get data
CMP #&90           \ Is it a Noteon?
BEQ noteon         \ Yip
CMP #&80           \ Noteoff?
BEQ noteoff        \ Yup
CMP #&E0           \ Pitchbend?
BEQ pitchb         \ Yip
CMP #&C0           \ Patchchange?
BEQ patchc         \ Yup
JMP code           \ Start again....
\ This routine handles Noteons. It
\ Also handles Noteoffs if sent as a
\ Noteon with zero velocity. See later
\ text about this point.
.noteon LDA #0     \ Set ID byte to 0
STA &92            \  in header
JSR gnote          \ Get note data
TAX                \ Save for later
SEC
SBC #&3C           \ Convert for AMPLE
STA &93            \ Store in header
JSR gnote          \ Get velocity byte
STA &94            \ Store in header
CMP #0             \ Noteoff?
BEQ dalloc         \ Looks like it!
LDY splitarray,X   \ Get zone number
LDX ssplit,Y       \ Get initial voice
.loop1 INX
LDA table,X        \ Get voice table
CMP #128           \ Voice unused?
BNE loop1          \ No!
TXA
CMP esplit,Y       \ Over voice limit?
BCC foundslot      \ No...phew...
LDX ssplit,Y       \ Boo....overflow
INX
.foundslot STX &95 \ Store in header
LDA &93            \ Get note pressed
STA table,X        \ Store it in table
RTS
\ Noteoff provides handling for those
\ keyboards that actually use a
\ Noteoff instead of a zero velocity
\ Noteon. I haven't checked this as I
\ don't have a "Noteoff" keyboard, but
\ it should work... comments please...
.noteoff LDA #0    \ Set ID byte to 0
STA &92            \  in header
JSR gnote          \ Get note data
SEC
SBC #&3C           \ Convert for AMPLE
STA &93            \ Store in header
JSR gnote          \ Waste velocity
LDA #0
STA &94            \ Store in header
.dalloc LDY #0     \ Reset pointer
.loop2 INY
CPY table          \ We overflowed?
BEQ notfound       \ Uh Huh...
LDA table,Y        \ Get note here
CMP &93            \ Same as Noteoff?
BNE loop2          \ No....
LDA #128           \ Get reset byte
STA table,Y        \ Free the voice
.notfound STY &95  \ Store voice freed
RTS
\ This routine handles the pitchbend
\ data arriving. Has an ID of 1.
.pitchb LDA #1     \ Set ID byte
STA &92            \ Store in header
JSR gnote          \ Get LSB and waste
JSR gnote          \ Get MSB of data
STA &93            \ Store in header
RTS
\ This routine handles the patch
\ changes...basically just reads the
\ data...very boring actually...
.patchc LDA #2     \ Set ID byte
STA &92            \ Store in header
JSR gnote          \ Get patch number
STA &93            \ Store it...
RTS                \ Bye bye
]
P%=&D00
REM This is the NMI code, positioned
REM at &D00. It provides circular
REM buffer handling for the buffer at
REM &A00
[
OPT opt%          
PHA:TYA:PHA
.wait LDA status   \ Get 6850 status
AND #1             \ Mask data bit
CMP #1             \ Check it
BNE wait           \ Nothing yet
LDA data           \ Get the data
LDY in             \ Get the pointer
STA buffer,Y       \ Store data
STA data           \ MIDI Out "Echo"
INC in             \ Update pointer
PLA:TAY:PLA:RTI    \ Exit NMI
]
NEXT
REM Press Escape and then RUN

Published in AMPLINEX 007, September 1988

MIDI Xpander instructions

This is the second of two features by Scott Mackie on the MIDI interface - his introduction and guide to building your own MIDI interface were contained in AMPLINEX 006.

MIDI Performance Code for AMPLE

Scott Mackie
Having, I hope, constructed your MIDI interface and got it running, you can now start on the code needed to make AMPLE run as a MIDI expander.
The 'Xpander' code comes as two parts: an assembler i/o section and an AMPLE handling routine. This has the benefits of machine code speed and AMPLE flexibility. I originally wrote the code entirely in AMPLE but it was really too slow to use properly, and resulted in arpeggios on chordal work - nice effect, but pretty unusable!
Although the assembler routine has its limitations (it slows down a bit after more than 5 notes are pressed simultaneously) it is much more efficient than AMPLE. Chordal work is still slightly slurred but the overall performance is much better.
The code is positioned in memory at &900 and &D00, with buffers at &A00 and &C00 (which unfortunately will corrupt the Staff editor - sorry!). At &D00 is the interrupt code which loads the data from the 6850 (the chip at the 'core' of the MIDI interface) into a circular buffer and updates a pointer. It also 'echoes' the data to the MIDI Out to simulate a MIDI Thru. There is a very small propagation delay, but this almost unnoticeable.
The code at &900 is the data handler. It 'chases' the interrupt routine around the loop, reading the data back out and updating the output pointer accordingly.
This method has the benefit of not missing any data, but the performance can be slowed slightly under heavy data input. The buffer size is a complete page, i.e. 256 bytes, which should be more than enough - if it isn't, you're either Rick Wakeman or playing with the system exclusive dump on the synthesiser!
After reading the buffer, the assembler code interprets the data and stores it accordingly. I use the Econet workspace (&90 to &9F) as variable space, so I'm afraid if the system is to be used on Econet some rewrites may be needed.
The workspace is configured as:
&90: Input pointer. Where the latest input data is in the buffer. Updated by the interrupt routine.
&91: Output pointer. Where the program has got to in the buffer. Updated by the foreground program.
&92: ID byte for the following data 0: Noteon/off 1: Pitchbend 2: Patch change
&93: <ID dependant data> &94: <ID dependant data> &95: Voice to be used for current event &96: Blank &97: . : Voice assignment data held here. . : 128 indicates unused voice &9F:
The assembler routine also provides voice allocation routines for AMPLE, including a keysplit system. When a note is pressed, the code goes to a lookup table at &C80, which contains the details of the currently setup keysplit. The code finds the current zone the key pressed is in and then allocates the voice accordingly. This system allows multi-timbral (i.e. using more than one instrument) music to be played across the entire range of the keyboard.
When a free voice is found for the note to be played on, the note number is placed in the table between &97 and &9F for future reference. A value of 128 indicates that the voice is clear. When a Noteoff is issued, the code checks the table for the note number and places a 128 in the voice location it finds, freeing that voice for future use.
A simple wrap-around system operates so that if the number of notes played in any one zone exceeds the maximum allowed, the overspill notes are played on the first voice of the split. This compromise seems to be the best solution to a rather grey area of synthesiser programming.
Having completed all the data preparation, the assembler routine returns to AMPLE, where the header block is checked and the relevant routines called. The notes are played using the ACT command, and a rest is played for a Noteoff. This allows envelopes such as Swell and Soft to complete.
If required, the code will release a channel to be used again, without issuing a rest. This is achieved by use of the MNOTEOFF command. OFF MNOTEOFF stops Noteoffs issuing rests and is very useful with envelopes that actually tail away to zero, as the sound is more continuous with no rests being issued.
Upright, in particular, is very effective like this and can be played much like a normal piano. A foot pedal can be used to trigger this, connected to the fire button for Joystick 1 on the Analogue port. A simple push-to-make footswitch will do, and the code will detect its depression and act accordingly (see the 'help!' information in the actual program about this).
Right, having waded your way through all that information, how do you use the code?
Having loaded the file F.Xpander, try the following:
RUN
The disc drive should run and load in the file 'F.Xcode'. Set the transmit channel on your synthesiser to channel 1 and enable its MIDI output if required. Pressing a few keys on the synthesiser should now result in AMPLE playing Upright at the right pitch.
If this doesn't work, check that the interface is paged into the right position in memory. The details about this are in the assembler listing file 'F.Xsource' which is included on this disc.
Also included in the 'Xpander' program is an AMPLE word called 'test' that will print out all the data arriving at the MIDI port. This should help with debugging if there's a problem. With luck, the code will work and the fun can start!
Holding the SHIFT key down while pressing a note on the master keyboard should take you back to the AMPLE prompt. The command 'RUN' is intelligent and checks to see if the NMI code is still present. If not, the code will boot in the NMI routines again from disc. If any problem should occur, just press BREAK and type 'RUN' again. This should cure any minor problems (especially if a disc is accessed, as this will overwrite the MIDI interrupt code).
Any sound can be used with the keyboard, just by defining the maximum number of MIDI voices, i.e.
4 MSINGLE viola4
will provide 4-note polyphony with a 4-channel viola sound.
Changing the MIDI receive channel is easy. All that you have to do is type, for example,
6 MCHAN
to set the interface to channel 6. The channel is defaulted to 1 initially.
The MIDI interface also accepts velocity information so the sounds produced will be responsive to velocity data. I haven't tried this feature yet as I can't afford a velocity-sensitive keyboard, but I hope it will work!
Moving the pitch bend wheel on your synthesiser should result in AMPLE changing the pitch of the sound. Incidentally, there's no reason why the pitch bend wheel should cause the pitch to change. It could alter the stereo position, volume, or voice parameters if required. Be experimental with the AMPLE code!
Issuing a patch change from your synthesiser should cause AMPLE to select a new sound for the voices. Edit the word 'Mpatchc' to suit your own tastes and sounds. The word is set up at the moment to provide a general selection of patches.
The last topic to be covered is key splits. All key splits do is to allow different instruments to be used depending on where the note pressed is on the keyboard. Up to 8 instrument zones can be defined, but within the confines of 8 notes of polyphony. For example, you can have a split of 2+6, but not 1+2+6 because this means having to use 9 voices, exceeding the internal limit for AMPLE. The two commands to drive the key split definition process are MSPLIT and KEYSPLIT.
If you type
MSPLIT
the screen will clear and you will be prompted for the number of zones to be used across the keyboard. Having typed this in, you will then be prompted for the number of notes to be used in zone 1 (which is the lowest zone in the keyboard). The code will then wait for you to press the key on the MIDI keyboard that indicates the top of the zone. This definition process will continue until all the zones have been defined.
When MSPLIT finishes, it calls KEYSPLIT and prints out a list of numbers. This sequence of numbers is the input to the routine KEYSPLIT. This is the raw (very!) routine for processing splits. If that exact key split setup is needed again then the string of numbers output can be used to call KEYSPLIT, without having to go through the process again. The words mix1, mix2 and mix3 all illustrate this technique and should be studied in order to fully understand this topic.
A complete listing of all the words used is included in the AMPLE file 'F.Xpander'. Just type 'help!' to get the information.
And now for what the code doesn't do! The code will not allow you to play along with existing music in AMPLE, although I am working on that. I'm afraid this is due to the need for a quick response time in the input routine (the program loops in the assembler domain to save time jumping between AMPLE and the code). It also forbids use of Echo for, I presume, the same reason. Maybe some AMPLINEX members can advise me on this aspect of the code.
Apart from these things, the code does run reasonably reliably and doesn't seem to be prone to leaving 'hanging' notes.
I hope these articles have provided some AMPLINEX members with enough material to experiment with MIDI. The basic code works well, but changes can be made to it to allow further MIDI data to be processed, such as modulation or aftertouch. Any comments on the code or queries could be sent to AMPLINEX or, if preferred, to myself at the address below.
Scott Mackie 48 Milford East Kilbride GLASGOW G75 9BU
Note: An error was spotted in the previous article with reference to the AMPLE hardware paging addresses. It does actually map into the whole of the &FD page, between page numbers &30 and &3F and not &FD30 and &FD3F as stated.

Related files on this disc:
F.Xpander - 'Xpander' AMPLE program
F.Xcode - 'Xpander' machine code
F.Xsource - assembler source for the 'Xpander' machine code (in *EXEC format)

Published in AMPLINEX 007, September 1988