?
Solved

How can I start playing several wave-sounds at the same time? (e.g. playing a chord by playing 3 notes at the same time)

Posted on 2003-04-01
4
Medium Priority
?
259 Views
Last Modified: 2010-04-06
I want to write a program that plays different chords that are built up by 3 or 4 notes. For each note I have one wave-file. After clicking on a button the wave will be played at the same time so I can hear a full chord.

My first attempt was to use 3 different mediaplayer-components. It works, i will hear 3 different sounds at the same time, but they are not synchronized (it sounds like an arpeggio). The sounds don't start to play at exactly the same time. I suppose the problem is because of the "queue" im my procedure:

procedure play_chords;
begin
  ...
  mediaplayer1.play;
  mediaplayer2.play;
  mediaplayer3.play;
  ...
end;

Do you know any other (easy way) possibility?

It would be also okay, if someone could tell me how I can play several MIDI-Notes, but I don't really know how to use MIDI in delphi...
0
Comment
Question by:Rauli
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Zip58
ID: 8246399
Hi Rauli

maby you can take a look to the beeper component ist freeware with source

You can make your own songs if you whant with this

This is the link

http://homepages.borland.com/torry/vcl/sound/pcspeaker/btbeeper.zip

Regards

Zip58
0
 
LVL 3

Expert Comment

by:ckaneta
ID: 8246430
If I were you, I'd look into DirectSound(part of the DirectX library)

I'll see if I can get an example to you in the near future
0
 
LVL 3

Expert Comment

by:tongalite
ID: 8246944
Hi Rauli;
This may help you out.
============================
http://www.programmersheaven.com/zone10/cat235/6794.htm

Wavemix DLL - play multiple wav files simultaneously (sound)
The wavemix DLL is a utility that allows multiple wav files to be played simultaneously. It is designed to be as simple to use as possilbe but still have the power to do what is required by games. The DLL supports 8 channels of simultaneous wave play, the ability to queue up waves along the same...
============================
Good luck
T.
0
 
LVL 3

Accepted Solution

by:
tongalite earned 150 total points
ID: 8247007
Hi again,
forgot to say....
Go here for all you want to know about midi sound.
http://www.programmersheaven.com/zone10/cat136/index.htm
T.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question