Jump to content
IGNORED

MIDI Input - HowTo?


freetz

Recommended Posts

Dear all,

 

I just got a MidiMate MIDI-interface which I would like to use in apparently a different way than MIDI software for the ATARI usually does: I want to receive data from a MIDI instrument and use the ATARI as a synthesizer to play POKEY "chiptune" music.

In my head this all seems pretty simple: I read whatever values come from MidiMate's SIO port, maybe do some conversion and then modify POKEY's sound registers accordingly. It would be great fun to sit on my keyboard and connect my ATARI to my stereo and then listen to the typical ATARI sound...

 

I assume it's not as easy as I outline it above, it probably requires setting Baud rates and identifying which incoming SIO data is actually from the MidiMate and not some other SIO device. But once I figured this out - with your help hopefully - it would be pretty easy to write a CIO handler ("M:") that everybody could use to write simple little BASIC programs that could read from MIDI devices and control not only sound but also for example graphics (the pitch bend wheel for example would be nice), just by reading from that device handler.

 

As I said, I'm not too familiar with neither the hardware structure of the MIDI interface as well as the SIO interface, so if anyone would share his/her thoughts with me or give me pointers where to look at (such as MidiMate compatible source code), I'd be really happy!

 

Thanks in advance and all the best,

 

 

Frederik

Link to comment
Share on other sites

here's the thing: POKEY handles both sound and SIO. You can't do both at the same time. One interferes with the other. If you have stereo pokeys, you can use one to do the SIO/MIDI and the other to do the sound, but I think that's the only way it's going to work.

Link to comment
Share on other sites

For normal disk SIO, 2 voices are needed to determine the bitrate. The other 2 can be used for sound but the OS normally clears them.

 

Programs that have simultaneous SIO and music/effects e.g. 7 Cities of Gold, The Eidelon, Alternate Reality all use their own SIO routines to overcome that problem.

 

The beeps you hear during disk I/O are just a mix of the high frequency base that determines the bitrate combined with noise generated by the I/O bitstreams.

Link to comment
Share on other sites

@Gozar: The 2600 code is very simple, it does nothing more than poking the joystick input values into the sound registers of the 2600. Since the joystick interface is the same on most 8-bit computers, all I need to adjust is the adresses of the joystick and sound registers. The whole code on the "client" side is just around 100 bytes, most of it is done on the Teensy which emulates a USB-MIDI instrument.

@Mathy: I do have a XL MIDI interface, but as I just learned, it's not (easily) possible to receive MIDI notes and play sound on the ATARI at the same time. Which is what I want to do. The 2600 interface I mentioned is not a MIDI interface for the 2600, but it is a generic MIDI interface that uses the 2600 as an instrument. With the latter one, you can't control MIDI devices which the former one is capable of.

Link to comment
Share on other sites

Really interesting idea using Littlescale's interface. Interested to see how it pans out.

In addition to the A8 code you will also have to change the Teensy code. As is, the code translates the Midi date to TIA specific data. The port IO functions should work as well as the Midi Rx. But you will have to re-do the bulk for Pokey.

yogi

Link to comment
Share on other sites

IIRC the Midimate just converts the midi-in to pokey serin (serial in). The midi bitrate is 31250. It shouldn't be too hard to write a routine to read the serial input at that rate with a 16-bit clock. That consumes two pokey channels and leaves you two channels to play sounds or one 16-bit channel if you want to be more in tune with other instruments :) If the Midimate provides its own clock (perhaps Mathy knows?) you'll have all sound channels available as pokey then will be driven by an external clock source.

Link to comment
Share on other sites

@ivop: Oh, that would sound a bit more promising, but I guess without indepth knowledge of the interface, I'd be left with some serious disassembling work...

@yogi: I haven't had a closer look at the code that runs on the Teensy, but I assume it shouldn't be too hard. For a start, I could think of just passing on the MIDI values (1-127) and use it as pitch level. In order to do what Littlescale did in terms of samples etc., this would be quite a step indeed, I guess...

Link to comment
Share on other sites

Hello guys

 

Here's the MIDI interface HARdwareDoc designed. And here is Ireneusz' site. I'm not sure if the interface has it's own clock. The photos show an oscillator, but I don't know what it's used for.

 

Sincerely

 

Mathy

 

BTW Lee Actor wrote AMS and MMS. Not sure if that helps you in any way, but I had to mention them.

 

 

Link to comment
Share on other sites

I might be interested in this as well. I use my Atari 1200XL in my music studio, tho so far it's been limited to music loop sequences, and as a wave formant for my vocoder. If I could get it to be programmed by external MIDI that would be super. Would having a dual POKEY installed in the Atari make this project more feasible?

  • Like 1
Link to comment
Share on other sites

Thanks, this will definitively come in handy. I guess I'll go with Littlescale's approach as I know too little about the details of the Midimate interface and I only have one POKEY installed (although two voices would be enough for what I'd plan to do, if I follow ivop's approach). Let's see how it'll work out once the Teensy and the other parts are there...

Link to comment
Share on other sites

Hello,

 

I remember the end of the 80's, there was an Atari french club dédicated to ATARI 8 bits, called CENACLE. They did an hardware real midi interface connected on the extension bus to receive/emit midi data. I've done 2 softwares, I used PRO24 on an atari ST to send a midi sequence, the 800XL got it and played it. The other software was a midi spy...But all is surely lost now, both software and hardware. You can forget basic to do music real--time software. If a popular midi interface exists (not just 2 or 3 pieces for experimentation only), I'm interested on buying one.

Edited by pfeuh
Link to comment
Share on other sites

  • 1 month later...

Ok, it is done - at least the way I imagined it in the beginning, not as comprehensive as littlescale's final product, but still:

With the following two files and the hardware setup as described by littlescale, you can use a midi sequencer to play Midi files on the Atari 8-Bit or directly "play" the Atari with a Midi keyboard connected to the sequencer.

 

http://frederik.hol.st/atari/8-bit/mystuff/A8Midi_Teensy_100.ino

http://frederik.hol.st/atari/8-bit/mystuff/MidiJoy.xex

 

I adjusted littlescale's software in some ways so that the bandwith is now 49 halftones instead of 32, and you can play up to four voices simultaneously. The software takes care of freeing unused voices and discards more than four (or rather replaces the fourth with the last one played).

I've put up a video on the Atari 8-Bit Facebook page, so you can have a look (or rather a hear ;) ) first before starting to build it:
https://www.facebook.com/photo.php?v=835261036485577

 

Enjoy!

  • Like 3
Link to comment
Share on other sites

OK, a few questions:

 

1. How can I get one of these? :) I so want this for my studio

 

2. Is it possible to modify the program to work with distortions other than $Ax (pure tone) ... like $2X (triangle) and $CX (sawtooth, and sawtooth 2 where (freq+1) mod 3 = 0) ... or to work in 16-bit mode where you combine two channels and get extended note resolution?

 

I have note tables for all those 4 distortions, in both 8-bit and 16-bit mode, if that helps.

Link to comment
Share on other sites

@Synthpopalooza: Sure, one can use any distortion that the Atari provides, I'll add this in the next release. 16-bit would also be possible, but in addition to a second note conversion table, it would also require change in the Teensy code as well because now it is designed for four voices. Would extended note resolution change that much (at the cost of losing two voices) that it would be worth the effort?

By the way, due to the limited number of wires, the maximum note range that could be transmitted would be 64 halftones (now with 8-bit resolution it's already 49).

Edited by freetz
Link to comment
Share on other sites

I've now added the possibility to alter AUDCTL, will look into different distortions, but that would probably require a different table(s) than the one I now use for $Ex/$Ax distortion. 16 bit does not seem to make much sense to me given that MIDI only offers 127 different note values?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...