Maker Pro
Maker Pro

Please help if you can with MIDI: Building a box for my keyboard

R

RockNRollson

Hello, fellows. I would be curious to know if anyone here has ever built a
MIDI sequencer. I bought a music keyboard awhile back which did not have a
MIDI interface, but I built a sequencer for it anyway, and that sequencer
worked okay. This sequencer did not conform to the MIDI standard though, and
so, for this reason, I am actually brand new to MIDI.

I now have a keyboard which does have a MIDI capability, though, and, by
accessing this capability, it is evidently possible for my keyboard to perform
with up to sixteen seperate instrument sounds, all at the same time. It is
basically for this reason that I have now decided to build a sequencer which
will conform to the official MIDI standard.

I know that the MIDI interface operates at 31,250 pulses per second, and, after
doing a little work with a pencil and paper, I figured out that if I multiplied
this figure by 32, it equaled one million. Since four meg crystals cost less
than one meg crystals, though, I have decided to use a four meg crystal for my
clock. By sending the output of this oscillator directly to a binary counter,
and by taking the seventh output from the binary counter, I will have my 31,250
pulses per second.

Right now, the main thing which arouses my curiosity about this project is the
fact that most people who use MIDI just purchase a software sequencer, and
therefore know either nothing, or next to nothing, about the actual MIDI
language, and its implementation at the hardware level. Well, awhile back, I
spent a hundred dollars on just such a program, before I discovered that it did
not allow certain note combinations. Actually, I found the program to be
virtually inusable. In the process of building my non-standard sequencer,
though, I managed to accumulate more than a dozen breadboards. The basic
reason for this is that my keyboard interface was a parallel one. My music
keyboard had forty-nine keys, and I assigned one memory output pin per key,
using ribbon wire to span in between the sequencer and the music keyboard.

Again, if anyone here has ever built a MIDI sequencer, or any type of MIDI
device, I would enjoy hearing about it. I have a book of more than a thousand
pages which covers so much material that I don't even know where to begin, as
far as the actual programming is concerned. I have written BASIC programs with
as little as one statement. Once I have gotten my standard sequencer to
execute its first command, I know I will feel that I have made it over a major
hurtle. The author of my enormous book, though, seems to have been completely
oblivious to the fact that my first logical question is: Is there any such
thing as a one message MIDI program?

Michael "Chip Monk" Mandaville
 
S

Stefan Heinzmann

RockNRollson said:
Hello, fellows. I would be curious to know if anyone here has ever built a
MIDI sequencer. I bought a music keyboard awhile back which did not have a
MIDI interface, but I built a sequencer for it anyway, and that sequencer
worked okay. This sequencer did not conform to the MIDI standard though, and
so, for this reason, I am actually brand new to MIDI.

I now have a keyboard which does have a MIDI capability, though, and, by
accessing this capability, it is evidently possible for my keyboard to perform
with up to sixteen seperate instrument sounds, all at the same time. It is
basically for this reason that I have now decided to build a sequencer which
will conform to the official MIDI standard.

I know that the MIDI interface operates at 31,250 pulses per second, and, after
doing a little work with a pencil and paper, I figured out that if I multiplied
this figure by 32, it equaled one million. Since four meg crystals cost less
than one meg crystals, though, I have decided to use a four meg crystal for my
clock. By sending the output of this oscillator directly to a binary counter,
and by taking the seventh output from the binary counter, I will have my 31,250
pulses per second.

Right now, the main thing which arouses my curiosity about this project is the
fact that most people who use MIDI just purchase a software sequencer, and
therefore know either nothing, or next to nothing, about the actual MIDI
language, and its implementation at the hardware level. Well, awhile back, I
spent a hundred dollars on just such a program, before I discovered that it did
not allow certain note combinations. Actually, I found the program to be
virtually inusable. In the process of building my non-standard sequencer,
though, I managed to accumulate more than a dozen breadboards. The basic
reason for this is that my keyboard interface was a parallel one. My music
keyboard had forty-nine keys, and I assigned one memory output pin per key,
using ribbon wire to span in between the sequencer and the music keyboard.

Again, if anyone here has ever built a MIDI sequencer, or any type of MIDI
device, I would enjoy hearing about it. I have a book of more than a thousand
pages which covers so much material that I don't even know where to begin, as
far as the actual programming is concerned. I have written BASIC programs with
as little as one statement. Once I have gotten my standard sequencer to
execute its first command, I know I will feel that I have made it over a major
hurtle. The author of my enormous book, though, seems to have been completely
oblivious to the fact that my first logical question is: Is there any such
thing as a one message MIDI program?

The first thing you need to realize is that MIDI uses so-called
asynchronous serial communication. This is a very widely used method to
encode timing information with the data, so that the receiving end can
tell where bits and bytes start, without receiving a separate clock
signal. The very same method is used in the ubiquitous RS-232 interface.

Consequently, a lot of chips support this method natively. It therefore
is quite unnecessary that you build your own receiver with clock
dividers etc.

The way to go with MIDI would be to take a microcontroller with a
built-in asynchronous serial interface (typically called USART, UART,
SCI or similar). It needs to support 8 bit wordlength with 1 start bit,
1 stop bit, no parity. There is a great variety of suitable devices
available.

Of course, it would be necessary to program the device. That can be done
in assembler language or in a high level language, but the learning
curve will be somewhat steep in any case.

If you are just unhappy with the software on PCs, another option would
of course be to write your own software on the PC. Constructing your own
hardware would then be unnecessary.

In any case it will be somewhat software-heavy, particularly since that
seems to be the area where you have the least experience.
 
B

Bob Stephens

Hello, fellows. I would be curious to know if anyone here has ever built a
MIDI sequencer. I bought a music keyboard awhile back which did not have a
MIDI interface, but I built a sequencer for it anyway, and that sequencer
worked okay. This sequencer did not conform to the MIDI standard though, and
so, for this reason, I am actually brand new to MIDI.

I now have a keyboard which does have a MIDI capability, though, and, by
accessing this capability, it is evidently possible for my keyboard to perform
with up to sixteen seperate instrument sounds, all at the same time. It is
basically for this reason that I have now decided to build a sequencer which
will conform to the official MIDI standard.

I know that the MIDI interface operates at 31,250 pulses per second, and, after
doing a little work with a pencil and paper, I figured out that if I multiplied
this figure by 32, it equaled one million. Since four meg crystals cost less
than one meg crystals, though, I have decided to use a four meg crystal for my
clock. By sending the output of this oscillator directly to a binary counter,
and by taking the seventh output from the binary counter, I will have my 31,250
pulses per second.

Right now, the main thing which arouses my curiosity about this project is the
fact that most people who use MIDI just purchase a software sequencer, and
therefore know either nothing, or next to nothing, about the actual MIDI
language, and its implementation at the hardware level. Well, awhile back, I
spent a hundred dollars on just such a program, before I discovered that it did
not allow certain note combinations. Actually, I found the program to be
virtually inusable. In the process of building my non-standard sequencer,
though, I managed to accumulate more than a dozen breadboards. The basic
reason for this is that my keyboard interface was a parallel one. My music
keyboard had forty-nine keys, and I assigned one memory output pin per key,
using ribbon wire to span in between the sequencer and the music keyboard.

Again, if anyone here has ever built a MIDI sequencer, or any type of MIDI
device, I would enjoy hearing about it.
<SNIP>

I built one as a final project for a microprocessor interfacing course I
took at a local college about 25 years ago. I used a single board computer
based on the Intel 8085 micro(school requirement, not recommended) The
software was actually pretty simple, mostly just keeping track of memory
pointers. Back then there was a group called the International MIDI
Association which you could join for ten bucks or so. They sent around a
monthly newsletter with circuit ideas and software examples. Don't know if
they're still around.

Good luck with our project.

Bob
 
R

RockNRollson

Hello again, fellows, and thanks to Stefan and Bob for your responses. Again,
the main reason why I am interested in MIDI is because I want to be able to use
my music keyboard to play music which without MIDI would require more than one
music keyboard. The idea of using my keyboard to do the work of up to sixteen
keyboards is one which I find to be enormously appealing.

What spurred my recent interest, though, was a simple wish to be able to bend
notes in live performance. Even if my keyboard had a pitch bend wheel, which
it does not, it still would be necessary for me to play the note with one hand,
and bend the note with the other hand. Therefore, I wanted a pitch bend pedal.

Well, I found a pitch bend pedal which will plug into the midi port of my music
keyboard, and that pedal costs one hundred and fifty dollars. Since I only
paid seventy-two dollars for my keyboard, including the power adapter, I would
feel very foolish paying that much for a pitch bend pedal.

Actually, after spending some time with my enormously large MIDI book, I think
that I am finally beginning to get a grip on the MIDI language. The key for me
was to understand the System Real Time messages Start, Stop, and Timing Clock
 
B

Bob Stephens

Hello again, fellows, and thanks to Stefan and Bob for your responses. Again,
the main reason why I am interested in MIDI is because I want to be able to use
my music keyboard to play music which without MIDI would require more than one
music keyboard. The idea of using my keyboard to do the work of up to sixteen
keyboards is one which I find to be enormously appealing.

What spurred my recent interest, though, was a simple wish to be able to bend
notes in live performance. Even if my keyboard had a pitch bend wheel, which
it does not, it still would be necessary for me to play the note with one hand,
and bend the note with the other hand. Therefore, I wanted a pitch bend pedal.

Well, I found a pitch bend pedal which will plug into the midi port of my music
keyboard, and that pedal costs one hundred and fifty dollars. Since I only
paid seventy-two dollars for my keyboard, including the power adapter, I would
feel very foolish paying that much for a pitch bend pedal.

Actually, after spending some time with my enormously large MIDI book, I think
that I am finally beginning to get a grip on the MIDI language. The key for me
was to understand the System Real Time messages Start, Stop, and Timing Clock

A really powerful and easy to use MIDI software package is Band in a Box.
It allows you to generate huge multi track arrangements and transcribes
them for you too.
When I bought it years ago I think it was 26 bucks. It's in revision
umpteen now, so the price has probably gone up.

Let me know how your pitch bender project works out. When I used to play
professionaly, I had a great pedal steel guitar patdch on one of my synths,
but I had to really think out of the box to simultaneously pitch bend
certain notes while finger mangling others to simulate a real steel with
multiple pedals, knee levers etc. I planned to make a MIDI pedal board to
support this but never got around to it.

Bob
 
B

Byron A Jeff

Hello, fellows. I would be curious to know if anyone here has ever built a
MIDI sequencer.

I've taken a couple of stabs at it. It's on my long term TODO list.
I bought a music keyboard awhile back which did not have a
MIDI interface, but I built a sequencer for it anyway, and that sequencer
worked okay. This sequencer did not conform to the MIDI standard though, and
so, for this reason, I am actually brand new to MIDI.

As it is the standard, right now there's no other way to go.
I now have a keyboard which does have a MIDI capability, though, and, by
accessing this capability, it is evidently possible for my keyboard to perform
with up to sixteen seperate instrument sounds, all at the same time.

Polyphony. Standard feature. Do note that you may have a limited number of
overall tones across those 16 channels.
It is
basically for this reason that I have now decided to build a sequencer which
will conform to the official MIDI standard.

Good for you.
I know that the MIDI interface operates at 31,250 pulses per second, and, after
doing a little work with a pencil and paper, I figured out that if I multiplied
this figure by 32, it equaled one million.

Choosen on purpose to be easily divided. Most UARTS utilize a 8x or 16x
clock. So that means that you can feed it a 1Mhz clock at it'll divide right
down.
Since four meg crystals cost less
than one meg crystals, though, I have decided to use a four meg crystal for my
clock. By sending the output of this oscillator directly to a binary counter,
and by taking the seventh output from the binary counter, I will have my 31,250
pulses per second.

IMHO you've now steered yourself down the wrong path. There are so many levels
of complexity required to get this task going that you don't want to start
building at the discrete level.

You need a better building block. Today's microcontrollers are most definitely
the ticket. Personally I'm partial to PIC controllers, but AVRs, TI, and
the like will work equally as well. You just want to make sure that the chip
has a UART onboard. That will serve as your MIDI interface port.

My motto is: You'll have to program either in software or hardware. Software
is easier.
Right now, the main thing which arouses my curiosity about this project is the
fact that most people who use MIDI just purchase a software sequencer, and
therefore know either nothing, or next to nothing, about the actual MIDI
language, and its implementation at the hardware level.

That's because they aren't interested in it. Most car drivers could give a
care less about how a internal combustion engine works. They just want to
turn the key and be on their way. Same with sequencers. Only the hard core
techies have an interest in how it operates underneath.

My rationale in all of this was that if I build a hardware sequencer myelf,
I wouldn't need to lug around a computer, and I could put it together
exactly the way that I wanted it. When dealing with others hardware/software,
you have to deal with their way of doing things. I want control.

So I build my own.

However I don't want to build my own bricks. Microcontrollers are a huge help
here. I've been targeting either a 16F877 or a 18F452 PIC part for the core
controller of my project.
Well, awhile back, I
spent a hundred dollars on just such a program, before I discovered that it did
not allow certain note combinations. Actually, I found the program to be
virtually inusable. In the process of building my non-standard sequencer,
though, I managed to accumulate more than a dozen breadboards. The basic
reason for this is that my keyboard interface was a parallel one. My music
keyboard had forty-nine keys, and I assigned one memory output pin per key,
using ribbon wire to span in between the sequencer and the music keyboard.

Bingo! You want control.
Again, if anyone here has ever built a MIDI sequencer, or any type of MIDI
device, I would enjoy hearing about it. I have a book of more than a thousand
pages which covers so much material that I don't even know where to begin, as
far as the actual programming is concerned. I have written BASIC programs with
as little as one statement. Once I have gotten my standard sequencer to
execute its first command, I know I will feel that I have made it over a major
hurtle. The author of my enormous book, though, seems to have been completely
oblivious to the fact that my first logical question is: Is there any such
thing as a one message MIDI program?

Two messages: NOTE ON, NOTE OFF. My general testing strategy:

1) Build the MIDI OUT and MIDI IN ports. A good example is shown under the
Generic MIDI OUT/IN/Through Circuit about halfway down this page:

http://galaxy.uci.agh.edu.pl/~polak/midi/gus.html

2) Loop the MIDI IN and MIDI OUT to a standard MIDI cable and connect to your
keyboard.

3) Disable local control of the keyboard. So pressing keys will only send
MIDI events and notes will only play be sending it MIDI events. In this mode
nothing should sound when you press keys on the keyboard.

4) Hook up your circuit to the MIDI IN and OUT ports of the keyboard so that
the MIDI OUT of the keyboard goes to the MIDI IN of your circuit and vice
versa.

5) Power your circuit up. Now play the keyboard. It should sound.

This is an excellent start. Now you move on to integrating the Microcontroller
(uC) to your circuit.

1) Connect the Transmit of the uC to your MIDI OUT and the MIDI IN to the RX.

2) Program your uC to send alternating note on/note off at 1 second interval.

3) Now test. You should get a rhythmic note on the keyboard.

Almost done. Now test the MIDI IN by writing a program that simply copies all
in data of the UART to the UART output. Again make sure your keyboard is in
local mode. Now fire up the circuit. You should be able to play the keyboard
as normal.

That's the basic starting hardware. You still have the issue of storing
tracks. You'll need RAM and some type of permanent storage. I'm planning on
using Compact Flash for saving tracks. But that's a whole 'nother post.

Hope this gets you started. For PIC resources check out my site:

http://www.finitesite.com/d3jsys

and Wouter van Ooijen's site:

http://www.voti.nl

Microchip samples parts on their site:

http://www.microchip.com

And finally you can get a most excellent PIC UART tutorial embedded into a
working program from Fr. Thomas McGahee's site:

http://www.pic101.com/mcgahee/index.html

These resources along with this post can take you quite a ways.

Hope this helps,

BAJ
 
G

Glenn Gundlach

Hello, fellows. I would be curious to know if anyone here has ever built a
MIDI sequencer. I bought a music keyboard awhile back which did not have a
MIDI interface, but I built a sequencer for it anyway, and that sequencer
worked okay. This sequencer did not conform to the MIDI standard though, and
so, for this reason, I am actually brand new to MIDI.

I now have a keyboard which does have a MIDI capability, though, and, by
accessing this capability, it is evidently possible for my keyboard to perform
with up to sixteen seperate instrument sounds, all at the same time. It is
basically for this reason that I have now decided to build a sequencer which
will conform to the official MIDI standard.

I know that the MIDI interface operates at 31,250 pulses per second, and, after
doing a little work with a pencil and paper, I figured out that if I multiplied
this figure by 32, it equaled one million. Since four meg crystals cost less
than one meg crystals, though, I have decided to use a four meg crystal for my
clock. By sending the output of this oscillator directly to a binary counter,
and by taking the seventh output from the binary counter, I will have my 31,250
pulses per second.

Right now, the main thing which arouses my curiosity about this project is the
fact that most people who use MIDI just purchase a software sequencer, and
therefore know either nothing, or next to nothing, about the actual MIDI
language, and its implementation at the hardware level. Well, awhile back, I
spent a hundred dollars on just such a program, before I discovered that it did
not allow certain note combinations. Actually, I found the program to be
virtually inusable. In the process of building my non-standard sequencer,
though, I managed to accumulate more than a dozen breadboards. The basic
reason for this is that my keyboard interface was a parallel one. My music
keyboard had forty-nine keys, and I assigned one memory output pin per key,
using ribbon wire to span in between the sequencer and the music keyboard.

Again, if anyone here has ever built a MIDI sequencer, or any type of MIDI
device, I would enjoy hearing about it. I have a book of more than a thousand
pages which covers so much material that I don't even know where to begin, as
far as the actual programming is concerned. I have written BASIC programs with
as little as one statement. Once I have gotten my standard sequencer to
execute its first command, I know I will feel that I have made it over a major
hurtle. The author of my enormous book, though, seems to have been completely
oblivious to the fact that my first logical question is: Is there any such
thing as a one message MIDI program?

Michael "Chip Monk" Mandaville

I've built and programmed MIDI keyboard encoders for 5 octave
keyboards, MIDI decoders to drive pipe organ valves, stop knob
scanners with MIDI output MIDI mergers and transposers but never a
sequencer. The commercial offerings work well for a modest cost. A
sequencer can end up needing a fair chunk of memory and when you start
adjusting tempos and such, it seems to be more trouble than its worth
to re-invent the wheel. If you want some MIDI routines for MCS-51, I
can let some go. They're not at all difficult to convert to Motorola
6805/08 code.
GG
 
R

RockNRollson

Hello again, fellows. I think that I have learned more about MIDI during the
past couple of days than I probably will learn about MIDI during any equivalent
period of time in the future, since I'm really just getting started with the
subject at this point. By switching from my non-standard parallel-interfaced
sequencer to a standard serially-interfaced one, I will be able to free up most
of my breadboard space, and so this new design will be worth building for me if
only for this reason alone.

At this point, though, I think that I overestimated the multitimbral capability
of my keyboard. By the way, this new keyboard of mine is actually the first
touch-sensitive keyboard that I have owned, so I am really just getting started
with music keyboards also, in that sense. When played manually, my keyboard
has what Casio refers to as a split function. In other words, I can get one
instrument sound at the top keys, and another instrument sound on the bottom
keys. This might be the actual limit of my keyboard's multitimbral capability
during automatic playback also. I guess I will just have to wait and see.

While doing some reading regarding the matter of disabling my keyboard's local
control, I solved the other half of my immediate problem, though. Again, what
triggered my recent interest was my wish to build a pitch-bending foot pedal
for use when doing blues guitar parts on my keyboard. Well, I have that part
figured out now, but Chuck Berry has a riff which he learned from Charlie
Christian where he bends a note, and then plays the same note on another string
at the same time. Well, I have come to realize now that I can achieve this
doubling effect by using my keyboard's internal connection at the same time
that I loop around and signal the note again through the MIDI in connection.
Evidently, these notes will be satisfactorily out of phase with one another.

Also, now that I have a touch-sensitive midi control keyboard, namely, the
keyboard on my new synthesizer, which can send signals through the MIDI out
port, I will not need another keyboard to expand my system, although a second
keyboard for live performance would still be useful for playing in the same
range with both ands on different instrument sounds.

I will be going back to work next month, when the grass starts growing again,
and I am looking forward to moving ahead with this project at that time.

Mike "Chip Monk" Mandaville
 
J

John Woodgate

I read in sci.electronics.design that RockNRollson
m19.aol.com>) about 'Please help if you can with MIDI: Building a box
for my keyboard', on Thu, 12 Feb 2004:
he bends a note, and then plays
the same note on another string at the same time.

Every beginner can do that, but not predictably. (;-)
 
B

Bob Stephens

Again, what
triggered my recent interest was my wish to build a pitch-bending foot pedal
for use when doing blues guitar parts on my keyboard. Well, I have that part
figured out now, but Chuck Berry has a riff which he learned from Charlie
Christian where he bends a note, and then plays the same note on another string
at the same time.

I've heard this technique referred to as "double stops". I used to fake it
by setting the pitch bender to a whole step, striking the note one step
below the target note, bending it up to the pitch of the target note,
quickly releasing the pitch bender back to neutral and striking the target
note. With the right guitar patch it sounded pretty convincing.

Bob
 
C

Creative Music Synth [220]

I am the best MIDI output

Hello, fellows. I would be curious to know if anyone here has ever built a
MIDI sequencer. I bought a music keyboard awhile back which did not have a
MIDI interface, but I built a sequencer for it anyway, and that sequencer
worked okay. This sequencer did not conform to the MIDI standard though, and
so, for this reason, I am actually brand new to MIDI.

I now have a keyboard which does have a MIDI capability, though, and, by
accessing this capability, it is evidently possible for my keyboard to perform
with up to sixteen seperate instrument sounds, all at the same time. It is
basically for this reason that I have now decided to build a sequencer which
will conform to the official MIDI standard.

I know that the MIDI interface operates at 31,250 pulses per second, and, after
doing a little work with a pencil and paper, I figured out that if I multiplied
this figure by 32, it equaled one million. Since four meg crystals cost less
than one meg crystals, though, I have decided to use a four meg crystal for my
clock. By sending the output of this oscillator directly to a binary counter,
and by taking the seventh output from the binary counter, I will have my 31,250
pulses per second.

Right now, the main thing which arouses my curiosity about this project is the
fact that most people who use MIDI just purchase a software sequencer, and
therefore know either nothing, or next to nothing, about the actual MIDI
language, and its implementation at the hardware level. Well, awhile back, I
spent a hundred dollars on just such a program, before I discovered that it did
not allow certain note combinations. Actually, I found the program to be
virtually inusable. In the process of building my non-standard sequencer,
though, I managed to accumulate more than a dozen breadboards. The basic
reason for this is that my keyboard interface was a parallel one. My music
keyboard had forty-nine keys, and I assigned one memory output pin per key,
using ribbon wire to span in between the sequencer and the music keyboard.

Again, if anyone here has ever built a MIDI sequencer, or any type of MIDI
device, I would enjoy hearing about it. I have a book of more than a thousand
pages which covers so much material that I don't even know where to begin, as
far as the actual programming is concerned. I have written BASIC programs with
as little as one statement. Once I have gotten my standard sequencer to
execute its first command, I know I will feel that I have made it over a major
hurtle. The author of my enormous book, though, seems to have been completely
oblivious to the fact that my first logical question is: Is there any such
thing as a one message MIDI program?

Michael "Chip Monk" Mandaville
 
Top