Yahoo Groups archive

SynthModules

Index last updated: 2026-04-28 23:14 UTC

Thread

MIDI input and output code working!

MIDI input and output code working!

2004-04-13 by djbrow54

It's working!!!

I was bound and determined to figure out the occasional glitches with
the interrupt-driven MIDI input.  I'm used to assembly language
stack-based machines.  I was using the same variables in the
interrupt service routine so I had problems with stepping on the
variables in the main code during an interrupt.  I had to change to
local variables where possible in the interrupt service routine and
disable interrupts in the main code when checking or manipulating
these variables.  This also corrects the issue I was having with byte
variables. For some reason setting the variables to words greatly
reduced the frequency of collision.

I merged the polled and interrupt modes with a compile option.  You
can compile for either polled MIDI input or interrupt MIDI input. 
The MIDI output is always polled.

I'll upload the code later tonight.

Dave

Re: MIDI input and output code working!

2004-04-13 by grantrichter2001

Remeber that in basic, ALL variables are global. There are no 
"local" variables, so every variable HAS to have a unique 
identifier and can not be reused between subroutines. One of 
the simple disciplines to handle this is to start all "local" 
variables for each sub-routine with a letter. Like Alist, Aindex, 
Alocal, next subroutine is Blist, Bindex, Blocal etc.

Brute force, yes, but Basic was developed for small bitwidth 
machines and small memory spaces. The Tiny Basic interpreter 
is only 2K of 8 bit wide space. Elegant in it's own minimalist way.

Now that hardware has become stupidly cheap, there is no point 
in conserving resources. But at one time computers only had 4K 
of "core" ha,ha,ha, "core" memory yuck, yuck, "drum" memory 
ha,ha, ha, punch cards ha, ha, ha, choke, cough, gasp...

OK I'll shut up now...

--- In SynthModules@yahoogroups.com, "john mahoney" 
<jmahoney@g...> wrote:
> Dave,
> First of all, you rock! Nice work. (Never mind that I was soon 
going to post
> something like, "MIDI in *would* be nice but I'll settle for MIDI 
out -- if
> it includes MIDI Clock out." ;-)
> 
> Second, a really dumb question: Where'd your MIDI interface 
come from?
> --
> john
> 
> P.S. Brice, the PSIM's limits keep expanding!
> 
> 
> ----- Original Message ----- 
> From: "djbrow54" <davebr@e...>
> To: <SynthModules@yahoogroups.com>
> Sent: Monday, April 12, 2004 11:45 PM
> Subject: [SynthModules] MIDI input and output code working!
> 
> 
> > It's working!!!
> >
> > I was bound and determined to figure out the occasional 
glitches with
> > the interrupt-driven MIDI input.  I'm used to assembly 
language
> > stack-based machines.  I was using the same variables in 
the
> > interrupt service routine so I had problems with stepping on 
the
> > variables in the main code during an interrupt.  I had to 
change to
> > local variables where possible in the interrupt service routine 
and
> > disable interrupts in the main code when checking or 
manipulating
> > these variables.  This also corrects the issue I was having 
with byte
> > variables. For some reason setting the variables to words 
greatly
> > reduced the frequency of collision.
> >
> > I merged the polled and interrupt modes with a compile 
option.  You
> > can compile for either polled MIDI input or interrupt MIDI 
input.
Show quoted textHide quoted text
> > The MIDI output is always polled.
> >
> > I'll upload the code later tonight.
> >
> > Dave
> >

Re: MIDI input and output code working!

2004-04-13 by djbrow54

You bring back fond memories.  My first programming was on a PDP-8
and then later an 8008. I was so happy when I upgraded to an 8080. 
It was a wire-wrapped set of cards (a bunch of cards!).  I ran many a
'Tiny Basic' in 2K of ram.  I remember upgrading the luxury of
Microsoft's 16k basic but most of my code was assembly.  I had a ODT
(showing my age for any of you old DEC programmers) which would load
programs via paper tape and offer a debugging environment.  I finally
upgraded to dual cassettes and then to the luxury of dual 8"
floppies.  I spent big bucks to upgrade to 48K of ram.  It drove a
Tektronix 4010 DVST which was quite cool, though.  A couple of us
eventually ported CP/M and had quite the machine for programming in
the mid '70's.  A home-built 300 baud modem allowed remote file
exchange WITHOUT paper tape!

But I digress ...
Dave

--- In SynthModules@yahoogroups.com, "grantrichter2001"
<grichter@a...> wrote:
Show quoted textHide quoted text
> Remeber that in basic, ALL variables are global. There are no 
> "local" variables, so every variable HAS to have a unique 
> identifier and can not be reused between subroutines. One of 
> the simple disciplines to handle this is to start all "local" 
> variables for each sub-routine with a letter. Like Alist, Aindex, 
> Alocal, next subroutine is Blist, Bindex, Blocal etc.
> 
> Brute force, yes, but Basic was developed for small bitwidth 
> machines and small memory spaces. The Tiny Basic interpreter 
> is only 2K of 8 bit wide space. Elegant in it's own minimalist way.
> 
> Now that hardware has become stupidly cheap, there is no point 
> in conserving resources. But at one time computers only had 4K 
> of "core" ha,ha,ha, "core" memory yuck, yuck, "drum" memory 
> ha,ha, ha, punch cards ha, ha, ha, choke, cough, gasp...
> 
> OK I'll shut up now...

Re: [SynthModules] MIDI input and output code working!

2004-04-13 by john mahoney

Dave,
First of all, you rock! Nice work. (Never mind that I was soon going to post
something like, "MIDI in *would* be nice but I'll settle for MIDI out -- if
it includes MIDI Clock out." ;-)

Second, a really dumb question: Where'd your MIDI interface come from?
--
john

P.S. Brice, the PSIM's limits keep expanding!


----- Original Message ----- 
Show quoted textHide quoted text
From: "djbrow54" <davebr@earthlink.net>
To: <SynthModules@yahoogroups.com>
Sent: Monday, April 12, 2004 11:45 PM
Subject: [SynthModules] MIDI input and output code working!


> It's working!!!
>
> I was bound and determined to figure out the occasional glitches with
> the interrupt-driven MIDI input.  I'm used to assembly language
> stack-based machines.  I was using the same variables in the
> interrupt service routine so I had problems with stepping on the
> variables in the main code during an interrupt.  I had to change to
> local variables where possible in the interrupt service routine and
> disable interrupts in the main code when checking or manipulating
> these variables.  This also corrects the issue I was having with byte
> variables. For some reason setting the variables to words greatly
> reduced the frequency of collision.
>
> I merged the polled and interrupt modes with a compile option.  You
> can compile for either polled MIDI input or interrupt MIDI input.
> The MIDI output is always polled.
>
> I'll upload the code later tonight.
>
> Dave
>

Re: MIDI input and output code working!

2004-04-13 by grantrichter2001

I have similar tales of playing "Lunar Lander" on an ASR33.

Which is why this little baby is so cool. A microprocessor with 
enough muscle to actually DO something, yay!

It's typical that all the problems of the last 40 years of computer 
development are being played out with the Basic Atom in 
miniature. Compiler upgrades that won't compile old code, typos 
in the compiler. Fixing something and breaking something else 
etc etc. etc.

Thanks for taking on the heavy lifting for the MIDI ISR. I'm getting 
the Joystick Axis Generators made and don't have time right now.

I hope to be back to it soon, with some cool software, now that 
there is math in the dev package.

Thanks again!

--- In SynthModules@yahoogroups.com, "djbrow54" 
<davebr@e...> wrote:
> You bring back fond memories.  My first programming was on 
a PDP-8
> and then later an 8008. I was so happy when I upgraded to an 
8080. 
> It was a wire-wrapped set of cards (a bunch of cards!).  I ran 
many a
> 'Tiny Basic' in 2K of ram.  I remember upgrading the luxury of
> Microsoft's 16k basic but most of my code was assembly.  I 
had a ODT
> (showing my age for any of you old DEC programmers) which 
would load
> programs via paper tape and offer a debugging environment.  I 
finally
> upgraded to dual cassettes and then to the luxury of dual 8"
> floppies.  I spent big bucks to upgrade to 48K of ram.  It drove a
> Tektronix 4010 DVST which was quite cool, though.  A couple 
of us
> eventually ported CP/M and had quite the machine for 
programming in
> the mid '70's.  A home-built 300 baud modem allowed remote 
file
> exchange WITHOUT paper tape!
> 
> But I digress ...
> Dave
> 
> --- In SynthModules@yahoogroups.com, "grantrichter2001"
> <grichter@a...> wrote:
> > Remeber that in basic, ALL variables are global. There are 
no 
> > "local" variables, so every variable HAS to have a unique 
> > identifier and can not be reused between subroutines. One 
of 
> > the simple disciplines to handle this is to start all "local" 
> > variables for each sub-routine with a letter. Like Alist, Aindex, 
> > Alocal, next subroutine is Blist, Bindex, Blocal etc.
> > 
> > Brute force, yes, but Basic was developed for small bitwidth 
> > machines and small memory spaces. The Tiny Basic 
interpreter 
> > is only 2K of 8 bit wide space. Elegant in it's own minimalist 
way.
> > 
> > Now that hardware has become stupidly cheap, there is no 
point 
> > in conserving resources. But at one time computers only had 
4K 
Show quoted textHide quoted text
> > of "core" ha,ha,ha, "core" memory yuck, yuck, "drum" memory 
> > ha,ha, ha, punch cards ha, ha, ha, choke, cough, gasp...
> > 
> > OK I'll shut up now...

Re: MIDI input and output code working!

2004-04-13 by djbrow54

--- In SynthModules@yahoogroups.com, "john mahoney" <jmahoney@g...>
wrote:
> Dave,
> Second, a really dumb question: Where'd your MIDI interface come
from?
> --
> john

I just built it.  I did a Schaeffer panel with MIDI input and output.
I knew the PSIM could support MIDI and wanted everything possible on
a single panel.  In a previous post I posted a link to my Schaeffer
file and a .jpg of the panel layout.  My panel is due tomorrow!

I wanted to verify the MIDI interface before I wired up the panel so
I just made one.  MIDI is just 8 bit serial with a start/stop bit
which the PSIM hardware supports.  MIDI utilizes a 'current'
interface with optical isolation so it just takes a few components to
do the conversion.

The MIDI output schematics are already posted on the web.  I believe
Brice will be posting a schematic sometime and possibly offering a
complete interface if there is sufficient interest.

Dave

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.