Mechanical Music Digest  Archives
You Are Not Logged In Login/Get New Account
Please Log In. Accounts are free!
Logged In users are granted additional features including a more current version of the Archives and a simplified process for submitting articles.
Home Archives Calendar Gallery Store Links Info

End-of-Year Fundraising Drive In Progress. Please visit our home page to see this and other announcements: https://www.mmdigest.com     Thank you. --Jody

MMD > Archives > March 1996 > 1996.03.26 > 08Prev  Next


Music Reader and Transposing System
By Ron Yost

Jody,

This is a looooong one. It's about how I do the reading, transposing
thing, but feel free, as usual, to snip it. It was too big for the
clipboard, so I had to send it as an attachment. Sorry.

It's called ronsredr.txt.

Thanks, as always!

 [ Editor's note:  I decoded the message back into text.  Here it is:

Ron Yost

Hi all,

I can't resist getting into the discussion of template-based MIDI file
transposition.  Without too much detail, my organ book music reader
reads 96 'positions' optically, using interchangeable fiber-optic
tracker bars sitting atop two rows of phototransistors, which allow me
to read any fair organ scale, keyed or keyless. The sensor circuit
boards were designed and built by me, so they're not a stock item
anywhere. The phototransistors sit on the board in staggered-fashion,
much like the tubing out the back of a piano tracker bar.

For a light source, I use an old-fashioned 60-watt filament lamp called
a "Lumiline".  It's about 18" long, round, and has a continuous
filament. It has clips on each end, which hook into special Lumiline
sockets. They were used in bathrooms in the 40's and 50's, mounted
alongside a vanity mirror to provide light for the ladies to make-up
by, just as fluorescents are used today. They're scarce, now (and very
expen$ive, if you find them at all). The few I have were made by
Philips (though I believe G.E. actually invented them) I happened to
get a few of them when a local electrical supply house went belly-up. I
couldn't take the simple expedient of using fluorescents, because
photo- transistors aren't very sensitive to UV light. They respond very
well to the warm infra-red of the Lumilines (I hope I've gotten the
terms correct, here. I'm really not sure). If anyone knows of a linear
lamp, 18" or so, that produces i.r., I'd like to know about it. Yes,
I've tried the quartz lamps in photocopiers, but they're too hot, even
dimmed-down!

The outputs of the phototransistors are squared-up, buffered, then sent
in parallel to two Devtronix 'input boards' (which are
parallel-to-serial converters) and then to a Dev. 'Input Processor'
board, which converts the raw on-off square-wave data into a serial
MIDI data stream. The Devtronix input boards each handle 64 'notes'
(actually nothing more than +12vdc switch closures) and each input
board is assigned (by jumpers) it's own unique MIDI channel (16
available). The boards are 'daisy chained' together, and by each board
having it's own channel assignment, the processor board can 'read' them
individually.

My reader is capable of 96 'notes', so though I use two boards, there
are 32 'notes' unused (nothing connected to them). The first 64 are
recorded on MIDI channel 1 (144 decimal); the remaining 32 on channel 2
(145).

A bit of advice: If you ever use these boards, make SURE you assign the
boards in order, starting with MIDI channel 1! The firmware in the
input processor EPROM gets all confused if you don't. (Devtronix may
have fixed this; my boards are circa 1992).

The MIDI stream is recorded on a Roland "SoundBrush" floppy-disc MIDI
recorder (a JEWEL, which sadly is no longer being produced). The
SoundBrush records the MIDI data as a Standard Format-0 (single track)
MIDI file. That's all a SoundBrush does; record and play Standard MIDI
files, but it's very handy and beats having to haul around a computer
(even a laptop). If you ever see one for sale BUY IT; or tell ME about
it :-)

In my concept, the music book is recorded 'straight', i.e., no
transposition is performed on it when it's recorded. That way the scale
is preserved and the MIDI file can be used to produce a template for a
new 'real' book in the future (using Jody's program, which I hope to
buy soon--listening, Jody?) I haven't tried it, but it should work very
well.

I take the raw file and, using a transposition program I wrote in
compiled GFA Basic on my trusty old Atari ST2, apply a 'template'
(ascii look-up table) to the file to change ONLY the MIDI channels and
note numbers. Nothing else is modified. (Before you laugh at basic, I
should say that GFA is VERY fast when compiled - my program does a 35k
song in about 1-1/2 minutes; which is fast, considering the Atari
'only' runs at 6mhz!) Of course, a lot of the efficiency is due to the
68000 processor, but we won't get into that.

I don't have room here to print the complete program, but it's just a
search-and-replace loop that reads each byte in the MIDI file
sequentially, looking for a MIDI channel-byte, which immediately
precedes the note number (I'm ignoring the delta-time). When it finds
one, it reads (and remembers) the_next_byte too, which is the note
number. Then an 'inner loop' starts, which searches the data of the
transposition file seeking a_match_ for_both_the channel number_and_the
note number.

When it finds a match, it looks in the template for what the
replacement numbers are to be and changes them. It's pretty simple, but
it took me a long while to figure it out!

Important to the concept: Every channel and note number my reader can
record is pre- defined and listed in the
template,_even_if_they_aren't_changed_by_the_template! In other words,
if they aren't changed, they're left alone. That way it's not likely
the program will 'choke' on something it doesn't recognize. All
possibilities are accounted for in the template. (Assuming I'm feeding
it the correct files; I can't expect it to properly transpose a 52-kls
Bruder song using an 80-k Mortier template!). This also eliminates the
possibility of random changes occurring.

Look at the bottom of the attached sample template and you'll see that
when the recorded notes run out, the template continues with 'null'
settings; where the search-for values = the change-to values. <In
practice, these 'extra' positions aren't recorded at all because I've
mounted dip switches on the sensor circuit boards to switch-off the not
needed sensors.>

Both the song file (binary data) and the template (which is converted
from ascii characters to real numbers by the program) are loaded in
memory at once so it doesn't have to seek something on a disk. I don't
claim to be much of a programmer, and maybe ignorance is bliss. I found
a simple solution that works for me.

Below is one of my 'template' files. This is just ascii text, and is
obviously different for each organ. It doesn't matter what's in the
following file, it's the concept I'd like to get across.

A 'blank' template starts out life like this:

** MIDIMAP SCALE DATA **

Channel 1
144,36,144,36  1 C2         [ 1st of 96. The C2 refers to the first 'note' recorded by
144,37,144,37  2 C#         [ the Devtronix board. It has nothing to do with the actual
144,38,144,38  3 D          [ note in the book. It's the first note in the Dev. system.
  |                         [ If it's a drum hole, it's still recorded as C2 (MIDI 36).
  | --snip--                [ All comments are ignored by the program.
  |
145,67,145,67  32 G4        [ last of 96

So, only things that need changing are changed. All else is left alone.
It's obvious that it requires quite a bit of time to fill out one of
these templates, especially with 'scrambled' Fair Organ scales. The
Mortier book below is simple, since it's chromatic.  Once it's done,
though, it can be re-used over and over (hopefully on TONS of music :-)

Template file comments:

1) '** MIDIMAP SCALE DATA **' is the header. The program looks to see if
   this is there.  (when I wrote this program I didn't know of Microsoft's
   MIDI Mapper, so this has nothing to do with the Windows MIDI Mapper-
   it's just a name).

2) '80-key MORTIER' etc., is the template name, which is displayed when
   it's loaded so I'm sure I have the correct template for the song I'm
   working on.

3) 'Channel 1' is the channel of the first board; means nothing and the
   program ignores it.

4) Then begins the four-column, 96 row template itself. The data is comma-
  delimited.  Each row represents a single note.

   In the first row, 144,36 is replaced by 154,73.
   As I've said, all comments after the 36 are ignored.

Example complete scale: (80-k Mortier scales vary, this is only one.) Yes,
it's set up for Mike Ames' AMI scale - now if I could only find some
music!!

** MIDIMAP SCALE DATA **
80-key MORTIER w/20 CMEL; to AMI regs Jan 22 1994
Channel 1
154,73,144,36  1 C2  CM violin celeste    [ First of 64 'notes' avail. on card 1
155,40,144,37  2 C#  ** CANCEL
154,41,144,38  3 D   xylophone _____________
150,43,144,39  4 D#   G2  BASS 5   CH 7   [ Remapped from MIDI ch.1 to ch.7 {150}
150,45,144,40  5 E    A2  BASS 6          [ The bass is changed from G-F to
150,46,144,41  6 F    A#2 BASS 7          [ C-B 'cause thats what my organ plays
150,47,144,42  7 F#   B2  BASS 8
150,36,144,43  8 G    C2  BASS 1
150,38,144,44  9 G#   D2  BASS 2
150,40,144,45  10 A   E2  BASS 3
150,41,144,46  11 A#  F2  BASS 4 _______
148,55,144,47  12 B   G3  ACC 1    CH 5   [ Accompaniment remapped to ch.5 {148}
148,57,144,48  13 C3  A3  ACC 2
148,58,144,49  14 C#  A#3 ACC 3
148,59,144,50  15 D   B3  ACC 4
148,60,144,51  16 D#  C4  ACC 5
148,61,144,52  17 E   C#4 ACC 6
148,62,144,53  18 F   D4  ACC 7
148,64,144,54  19 F#  E4  ACC 8
148,65,144,55  20 G   F4  ACC 9
148,66,144,56  21 G#  F#4 ACC 10 ______
147,67,144,57  22 A   G4  MEL 1    CH 4   [ Melody remapped to ch.4 {147}
147,68,144,58  23 A#  G#4 MEL 2
147,69,144,59  24 B   A4  MEL 3
147,70,144,60  25 C4  A#4 MEL 4
147,71,144,61  26 C#  B4  MEL 5
147,72,144,62  27 D   C5  MEL 6
147,73,144,63  28 D#  C#5 MEL 7
147,74,144,64  29 E   D5  MEL 8
147,75,144,65  30 F   D#5 MEL 9
147,76,144,66  31 F#  E5  MEL 10
147,77,144,67  32 G   F5  MEL 11
147,78,144,68  33 G#  F#5 MEL 12
147,79,144,69  34 A   G5  MEL 13
147,80,144,70  35 A#  G#5 MEL 14
147,81,144,71  36 B   A5  MEL 15
147,82,144,72  37 C5  A#5 MEL 16
147,83,144,73  38 C#  B5  MEL 17
147,84,144,74  39 D   C6  MEL 18
147,85,144,75  40 D#  C#6 MEL 19
147,86,144,76  41 E   D6  MEL 20
147,87,144,77  42 F   D#6 MEL 21
147,88,144,78  43 F#  E6  MEL 22 ________
154,38,144,79  44 G   violin on and perc switch
149,48,144,80  45 G#  C3  C MEL 1   CH 6  [ Counter-Melody remapped to ch.6 {149}
149,49,144,81  46 A   C#3 C MEL 2
149,50,144,82  47 A#  D3  C MEL 3
149,51,144,83  48 B   D#3 C MEL 4
149,52,144,84  49 C6  E3  C MEL 5
149,53,144,85  50 C#  F3  C MEL 6
149,54,144,86  51 D   F#3 C MEL 7
149,55,144,87  52 D#  G3  C MEL 8
149,56,144,88  53 E   G#3 C MEL 9
149,57,144,89  54 F   A3  C MEL 10
149,58,144,90  55 F#  A#3 C MEL 11
149,59,144,91  56 G   B3  C MEL 12
149,60,144,92  57 G#  C4  C MEL 13
149,61,144,93  58 A   C#4 C MEL 14
149,62,144,94  59 A#  D4  C MEL 15
149,63,144,95  60 B   D#4 C MEL 16
149,64,144,96  61 C7  E4  C MEL 17
149,65,144,97  62 C#  F4  C MEL 18
149,66,144,98  63 D   F#4 C MEL 19
149,67,144,99  64 D#7 G4  C MEL 20_______[ Last of 64 devtronix 'notes' card 1
145,36,145,36  1 C2   unknown register   [ Start Ch. 2 {145} data -first of 32 on card 2
154,74,145,37  2 C#   cm sax on
154,43,145,38  3 D    accordion on
154,36,145,39  4 D#   m jazz flute on
154,37,145,40  5 E    m vibratone on
154,40,145,41  6 F    m trumpet on
153,70,145,42  7 F#   BASS DRUM
153,76,145,43  8 G    SNARE DRUM 2  acoustic sd
145,44,145,44  9 G#   blank not recorded
153,75,145,45  10 A   SNARE DRUM 1  elec sd
155,36,145,46  11 A#  m tremolo
145,47,145,47  12 B   unknown reg
155,37,145,48  13 C3  jazz tremolo on
154,96,145,49  14 C#  cm flute on
145,50,145,50  15 D
145,51,145,51  16 D#
145,52,145,52  17 E
145,53,145,53  18 F
145,54,145,54  19 F#
145,55,145,55  20 G
145,56,145,56  21 G#
145,57,145,57  22 A
145,58,145,58  23 A#
145,59,145,59  24 B
145,60,145,60  25 C4*
145,61,145,61  26 C#
145,62,145,62  27 D
145,63,145,63  28 D#
145,64,145,64  29 E
145,65,145,65  30 F
145,66,145,66  31 F#
145,67,145,67  32 G4             [ 96th and final 'note' read by reader

Well, I've ragged on enough for now. I hope this helps a bit
and_please_don't think I'm trying to set this out as the 'only' way, or
as some kind of 'standard'. There are many ways of accomplishing the
same result; all interesting! If you'd like anything further on this
subject I'd be happy to talk about it, though my time is somewhat
limited.

Better yet, find an old Atari ST. They're great, simple computers that
can accomplish wonders with only 2 or 4 megs of memory! Maybe I'll talk
about a really_good_sequencer program for our purposes, i.e., Dr. T's
"KCS Omega" on the Atari. It leaves Cakewalk in the dust, IMO!

Ron Yost <ryost@fix.net>
646 Bolen Dr.
Paso Robles, CA 93446


(Message sent Wed 27 Mar 1996, 00:26:49 GMT, from time zone GMT.)

Key Words in Subject:  Music, Reader, System, Transposing

Home    Archives    Calendar    Gallery    Store    Links    Info   


Enter text below to search the MMD Website with Google



CONTACT FORM: Click HERE to write to the editor, or to post a message about Mechanical Musical Instruments to the MMD

Unless otherwise noted, all opinions are those of the individual authors and may not represent those of the editors. Compilation copyright 1995-2024 by Jody Kravitz.

Please read our Republication Policy before copying information from or creating links to this web site.

Click HERE to contact the webmaster regarding problems with the website.

Please support publication of the MMD by donating online

Please Support Publication of the MMD with your Generous Donation

Pay via PayPal

No PayPal account required

                                     
Translate This Page