Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MIDI  (Read 2496 times)

0 Members and 3 Guests are viewing this topic.

rja4096

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
MIDI
« on: April 11, 2008, 11:40:08 AM »

HI, I've got the miracle music keyboard and connected to amiga through MIDI port, does anyone know if its possible to read the midi signals - and know how to interpret them. It should be possible to know which key is pressed on the electronic keyboard and for how long.

Thanks, Rick.
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: MIDI
« Reply #1 on: April 11, 2008, 07:30:50 PM »

The library for handling MIDI on the Amiga is CAMD.library.  It has been maintained on AmigaOS 4 also so it will probably be maintained indefinitely.  You should be able to use the LibCall command to access its functionality.  If you run into trouble post back here.
Logged

rja4096

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
Re: MIDI
« Reply #2 on: May 16, 2008, 11:14:26 AM »

Hi, yes, I really could do with some examples of how to read the midi keyboard. I'm only interested in reading, could someone put an example together for me? I want to write a very simple ProTracker - but want to assign different instruments to different keys - Don't think there is any music program that can do this.

Thanks, rick.
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: MIDI
« Reply #3 on: May 16, 2008, 06:44:50 PM »

I don't have a MIDI synthesizer so I can't do it.  Doesn't CAMD.library come with the documentation to do it?
Logged

rja4096

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
Re: MIDI
« Reply #4 on: May 16, 2008, 08:35:13 PM »

Hi, I did read the documentation, but there only looked to be examples in for C. Could you just write a very simple example for me, even if you can't test it with a midi keyboard? Thanks, Rick.
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: MIDI
« Reply #5 on: May 17, 2008, 02:09:10 AM »

I'm afraid I don't have the time right now to do that although I can explain how to use the LibCall function.  The following instructions assume that the equates file has been updated.  Unfortunately they don't seem to be listed in the archive.  I'll have to find them and get back to you later.

First you have to open the library itself:

Lib Open 1, "camd.library",37

Next you have to set an equate bank for the LVO (link value offsets) table and the structure offsets.

Set Equate Bank 15

If you have a pointer accpted in a0 and a pointer to a structure in a0 an example of the LibCall instruction would look like this:

Procedure _open_midi_device[devicename$]
   areg(0)=varptr(devicename$)
   libcall(1,LVO("OpenMidiDevice"))
end proc[areg(0)]

To call that procedure you need to accept a parameter and retrieve a parameter.

_open_midi_device["miracle"]
handle=param

When the program is done you need to close the library

Lib Close 1
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022