Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,534 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 1
Simulating music #27002
05/07/04 23:22
05/07/04 23:22
Joined: Aug 2003
Posts: 828
agreenknight Offline OP
Developer
agreenknight  Offline OP
Developer

Joined: Aug 2003
Posts: 828
I was wondering, now is there some way to simulation music in 3dgs? Playing music your blowing air through a instrument really is a physics thing. I learned about it in a physics class I took. Thing is too, the tone of the instrument too, and the pitch.


Keep It Simple, Make It Fun
Re: Simulating music [Re: agreenknight] #27003
05/07/04 23:24
05/07/04 23:24
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
no, you can't do that with a6's physics engine.

but i think there are physical sound modeling algorithms which can do such stuff! they simulate swinging guitar strings or air in an organ pipe and produce sound out of that...

Re: Simulating music [Re: ventilator] #27004
05/08/04 01:54
05/08/04 01:54
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Well now that not entirely true Vent. YOu obviously can't do it on a simulation level, but you can emulate it:

a) Create a musical your musical instruments. Lets take a hollow cylinder with one end closed; This will be our "pan flute"; thus you blow air across the lip of the open side and a tone will hopefully ensues.

b) Pick a fixed spot where you want to hear the sound produced. Lets keep the spot fixed for now and not make it dynamic for ease of discussion and computation.

c) In a bid to finite element analysis, pepper the inside of the flute with as many single quant entities you can and place them a fixed distance apart, say for example 3 or 4 quants. Register these entities with the PE with zero friction, zero drag, and zero gravity. Since we are considering a homogenous gas, mass and molecule volume are irrelavant and thus set mass to unity. This internal grid will be the "air".

d) Take the entities that are at the lip of the flute and vibrate them by giving them pushes and pulls. This will drive the open lip of the cylinder and depending on which and how many lip air molecules you drive , you will emulate diffrent air flow patterns across the lip. These lip air molucles must be constantly vibrating to work.

e) Assuming your grid size is adequate and allows for air molecule collision (ie. the air is dense enough to transmit sound), the driven air particles collide with their neightbor and on down the line, all the other air particles inside the flute as well as the walls of the flute itself. This in and of itself will not produce a tone since all the particles are moving and colliding randomly. You will need to drive teh lip of the flute properly to get resonance....

f) So far this has been an accurate simulation of what happens inside an instrument. Now we need to emulate the sound aspect. Remember we are at a fixed position relative to the flute. The key is that everytime one air entity collides with another, we would mathematically calculate teh waveform that I would receive at my fixed postiont and add that to the waveform from every other collision. It is this resultant waveform that is then player to the listener at the fixed spot. This last bit of coding is the fuzziest to me, but we are in essesnse relying on the air particle simulation to give us an idea of what is "sounding" and what isn't and then we use the Principle of Superposition to put these tones together at our fixed point and hopefully "hear" a sound.


Just an idea of the top of my head!

Re: Simulating music [Re: fastlane69] #27005
05/08/04 02:32
05/08/04 02:32
Joined: Aug 2003
Posts: 828
agreenknight Offline OP
Developer
agreenknight  Offline OP
Developer

Joined: Aug 2003
Posts: 828
I've read a webpage that suggested several ways to do it, including what you just mentioned.


Keep It Simple, Make It Fun
Re: Simulating music [Re: agreenknight] #27006
05/08/04 02:45
05/08/04 02:45
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Right, and this is entirely within the realm of 3DGS capabilities.

Re: Simulating music [Re: fastlane69] #27007
05/09/04 18:38
05/09/04 18:38
Joined: Aug 2003
Posts: 828
agreenknight Offline OP
Developer
agreenknight  Offline OP
Developer

Joined: Aug 2003
Posts: 828
How do i go from the particle simulation to having it generate music though?


Keep It Simple, Make It Fun
Re: Simulating music [Re: agreenknight] #27008
05/10/04 02:02
05/10/04 02:02
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Quote:

How do i go from the particle simulation to having it generate music though?





From above:
Quote:

f) So far this has been an accurate simulation of what happens inside an instrument. Now we need to emulate the sound aspect. Remember we are at a fixed position relative to the flute. The key is that everytime one air entity collides with another, we would mathematically calculate teh waveform that I would receive at my fixed postiont and add that to the waveform from every other collision. It is this resultant waveform that is then player to the listener at the fixed spot. This last bit of coding is the fuzziest to me, but we are in essesnse relying on the air particle simulation to give us an idea of what is "sounding" and what isn't and then we use the Principle of Superposition to put these tones together at our fixed point and hopefully "hear" a sound.





The idea is that you have a waveform with a basic air molecule on air molecule sound. Then as the particle simulation progresses, upon each collision a new waveform is added and the result of this waveform is what is played.

Its very possible with 3DGS, but as you can see, it requires that you will have to have some pretty deep mathematical and physical foundation to actually pull it off and code it. Ideas such as the principle of supperposition and waveform addition, fourier transforms, inverse r squared dependence of sound, the decibel equation...if you want to attempt to perform a simulation, you need to be well versed in ALL aspects of the physics.

This approach is the most hardcore however. You can create all manner of approximations to make your project work, such as instead of a particle simulation, have an AREA simulation whereupon once a AREA is stimulated, it plays a tone. Stimulate diffrent areas and add the tones, boom you have a note. Simulate diffrent NOTES, and voila! Music!

If you have a specific app in mind it would help make this more concrete. As it stands that are many many wasy to acheive your result and thus which one you may want to take is project dependent.

Re: Simulating music [Re: fastlane69] #27009
05/10/04 03:07
05/10/04 03:07
Joined: Aug 2003
Posts: 828
agreenknight Offline OP
Developer
agreenknight  Offline OP
Developer

Joined: Aug 2003
Posts: 828
Quote:

This last bit of coding is the fuzziest to me, but we are in essesnse relying on the air particle simulation to give us an idea of what is "sounding" and what isn't and then we use the Principle of Superposition to put these tones together at our fixed point and hopefully "hear" a sound.




Well, the first thing I need to do is get that to work, then. I was looking at the particle effects generator, on the download page, would that help me with it.


Keep It Simple, Make It Fun
Re: Simulating music [Re: agreenknight] #27010
05/10/04 03:23
05/10/04 03:23
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
This has nothing to do with the 3DGS particle.
When I use particle, I mean it in the scienfici sense, a mass point source.
The particles are actually 1 to 2 quant entities...otherwsie attaching behaiviour such as sounding would be impossible

Re: Simulating music [Re: fastlane69] #27011
05/10/04 07:48
05/10/04 07:48
Joined: Aug 2003
Posts: 828
agreenknight Offline OP
Developer
agreenknight  Offline OP
Developer

Joined: Aug 2003
Posts: 828
Okay, glad we sorted that out, so would I have to make a plugin for this?


Keep It Simple, Make It Fun

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1