Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delphi and MIDI sequencer programming

606 views
Skip to first unread message

poly...@usa.net

unread,
Nov 30, 1998, 3:00:00 AM11/30/98
to

Hi All,

I am an amatuer Delphi programmer. I am now trying to
program a MIDI sequencer software but all the information
I found on the net were only about MIDI file format. What
I need to know is how to send MIDI stream to, say, a synth
without using Tmmplayer component?
What are the MIDI messages I need to send? How to do that?
When to do that? (e.g. every 50 milliseconds, etc.)

Any hint will be much appreciated,

Norsez


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Udo Giacomozzi

unread,
Nov 30, 1998, 3:00:00 AM11/30/98
to
Hi!

>I am an amatuer Delphi programmer. I am now trying to
>program a MIDI sequencer software but all the information
>I found on the net were only about MIDI file format. What
>I need to know is how to send MIDI stream to, say, a synth
>without using Tmmplayer component?
>What are the MIDI messages I need to send? How to do that?
>When to do that? (e.g. every 50 milliseconds, etc.)
>

I am too working on a MIDI player. I *can* play MIDI files but I have big
problems.
First your question: You have to send all MIDI and SYSEX commands (you
know - the MIDI file differs from META, MIDI and SYSEX commands). The
delta-time tells you WHEN you have to play the command.
I currently use a periodic timer (timeSetEvent) to get called a function
every 1 ms or so and then check if there are MIDI commands that have to be
send. Problem: This works but when you start a program, go in a
MS-DOS-Window or Windows is busy the song slows dramatically down.
There MUST be a better solution because the Windows Media Played works fine
and has no problems - so there must be a different method from mine.

If YOU get more informations PLEASE E-MAIL ME so I can get work my program
too - THANK YOU! :-)

Regards
Udo Giacomozzi

PS: Please reply by E-MAIL at udo_gia...@rolmail.net


* Email: udo_gia...@rolmail.net
* http://www.giacos.com/udo/music.shtml - my music page with 1000's of midi
files
* http://welcome.to/udo - my personal homepage (Pascal/Delphi prog.)
* UIN: 17745247 (@pager.mirabilis.com)

Garry Knight

unread,
Dec 1, 1998, 3:00:00 AM12/1/98
to
Udo Giacomozzi wrote in message <73v1v0$6pd$1...@news4.muc.eurocyber.net>...

>Hi!
>
>>I am an amatuer Delphi programmer. I am now trying to
>>program a MIDI sequencer software...
[snip]

>
>I am too working on a MIDI player. I *can* play MIDI files but I have big
>problems.
>First your question: You have to send all MIDI and SYSEX commands (you

[snip]


>Problem: This works but when you start a program, go in a
>MS-DOS-Window or Windows is busy the song slows dramatically down.
>There MUST be a better solution because the Windows Media Played works fine
>and has no problems - so there must be a different method from mine.


Can't help you with the MIDI problems, but shouldn't you be using a separate
thread to send the codes out?

--
Garry Knight
Computer programmer, psychotherapist, writer
ga...@garryknight.freeserve.co.uk


Udo Giacomozzi

unread,
Dec 1, 1998, 3:00:00 AM12/1/98
to
Garry Knight schrieb in Nachricht
<73vel8$vu$3...@newsreader3.core.theplanet.net>...

>Can't help you with the MIDI problems, but shouldn't you be using a
separate
>thread to send the codes out?
>

When I tried to write my low-latency DirectSound routines I noticed separate
threads are even worse (even with REALTIME priority) that callback-timers.
As far as I know, timers are called within an interrupt.
I didn't try to use a separate thread for my MIDI player. Do you think that
would be better?


--
Regards
Udo Giacomozzi

poly...@usa.net

unread,
Dec 1, 1998, 3:00:00 AM12/1/98
to
Hi all,

Thanks everyone who replied to this thread. You guys are very helpful.

For Udo,

From a lot of replies both to this newsgroup and to my mailbox.
Good Suggestions are:-

1. Go back to Delphi 1.0 and read about MMSYSTEM and try to write a DLL from
there.

2. Read Maximum MIDI. Every good MIDI sites seem to recommend it too (although
it's C language-oriented).

3. Write to the writer of these two MIDI sequencers, they are very very
helpful and willing to let you see their Delphi source codes. - Massiva at
http://home.c2i.net/jaase/massiva.htm - TIFTracker at
http://www.ltam.lu/ourpages/students/Rkramer/developers.htm

4. For me, after I found this wonderful component, my problem is solved. It's
Tsupertimer by Jan Goyvaerts. Although you need to be as precise as
microseconds in play midi file, my task doesn't need that much precision.
Tsupertimer is very accurate since it has its own thread while working. I
just use it to send all the midi message every certain interval (depending on
BPM).

Thanks again everyone for your replies,
and Udo, Good luck with programming!

PALFREYMAN

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
Hi

Firstly if you are not an experienced programmer I would give up now and save
yourself a lot of heartache. If you are still crazy enough to try this I will
point you in the right direction. I can not give you advice in detail as this
would make a book!

Anyway, First of all beware of Midi Streaming as not many sound cards support
this function.

You need to use a lot of API to acheive this. Functions include :
GlobalAlloc
GlobalLock
MidiOutOpen
MidiOutPrepareheader
MidiOutSendLongMessage
MidiOutClose
GlobalUnlock

When you have banged your head on the wall for the 100th time you might start
to understand the complexities of dealing with midi through Windows. My advice
is to search for a Delphi component written by Dave Churcher.

Midi works with SysEx files and each midi module works with a different format.
ie you cannot send a Roland midi file to an Akai sampler.

Midi is a minefield!!!

Regards
Neil Palfreyman
Palfr...@AOL.COM


0 new messages