?
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
?
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

770 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