Loading [MathJax]/extensions/Safe.js

Special Aircraft Service

Please login or register.

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

Author Topic: aircraft.common.prs ?  (Read 1508 times)

0 Members and 1 Guest are viewing this topic.

marcost

  • Modder
  • member
  • Offline Offline
  • Posts: 1088
  • Keep calm and run away
aircraft.common.prs ?
« on: February 02, 2021, 02:31:06 PM »

Does anyone know how the samples in aircraft.common.prs are referenced by the game? It is obvious that motor and machine gun prs files are unique and can be referenced directly, however the aircraft.common.prs contains wav files that can be played independently e.g. stuka dive siren and ground landing noise.

There is no 'coded' reference against these samples, just the sample name. A search of class files does not offer any direct links to these individual samples.

Thanks

M
Logged

FL2070

  • Modder
  • member
  • Offline Offline
  • Posts: 1303
  • FAC #87
Re: aircraft.common.prs ?
« Reply #1 on: February 02, 2021, 02:46:48 PM »

The aircraft.common.prs works very similarly (and is coded very similarly) to a motor preset, except for two key differences: (1) there is only one instance of this preset per aircraft, while with motor presets, there are as many instances of sound generators using that preset as there are motors on a plane, and (2) the exact preset which is used is based on whether the plane has landing gears (aircraft.common.prs) or floats (aircraft.common_w.prs) instead of being based on the preset(s) defined by the plane's engine model(s).

The reason you cannot find any references to these samples in classfiles is because no classfile directly controls which wav files are used. Classfiles only define the different sound controllers—a sound controller being one of the keywords that can be used to define volume ranges and modulate pitch, i.e. "rpm" "angle" "dist". The samples of aircraft.common.prs simply use unique controllers that aren't used anywhere else to control how and when they are played. For instance, you will see controllers like "relspeed" "dive" "brake" "gear" "flatter".
Logged
On average, the average average averages, averagely, the average average of all averages.

marcost

  • Modder
  • member
  • Offline Offline
  • Posts: 1088
  • Keep calm and run away
Re: aircraft.common.prs ?
« Reply #2 on: February 02, 2021, 03:19:51 PM »

Hi thanks for the reply. Just to check my understanding, here is an extract:

[sample.metal_noise_02m.wav]
infinite 1
controls flatter
env 2 8

[sample.metal_noise_02m.wav.flatter]
minlo 0
minhi 0.6
maxlo 2.0
maxhi 3.0
value 1.5
pmin  0.9
pmax  1.1

Let's say I want to add an additional sample to play when metal_noise_02m.wav is playing. To do this, I need to replicate the above with the important part being to use the suffix flatter? Think I got it, thank you!

Logged

FL2070

  • Modder
  • member
  • Offline Offline
  • Posts: 1303
  • FAC #87
Re: aircraft.common.prs ?
« Reply #3 on: February 02, 2021, 03:23:27 PM »

Let's say I want to add an additional sample to play when metal_noise_02m.wav is playing. To do this, I need to replicate the above with the important part being to use the suffix flatter?

Aside from adding your new sample's name to the [samples] pool near the top of the file and changing the sample name in the copied code to match the name of the new sample which you're adding, yes.
Logged
On average, the average average averages, averagely, the average average of all averages.

marcost

  • Modder
  • member
  • Offline Offline
  • Posts: 1088
  • Keep calm and run away
Re: aircraft.common.prs ?
« Reply #4 on: February 03, 2021, 11:16:23 AM »

Great, thank you.  If more than one sample is applied to a controller, do they all get played at the same time or chosen randomly?

So, if we have something like this, are all these samples going to get played together or chosen randomly?

[common]
mode     normal
pmax     1

[spl]
120

[samples]
land_cb_19_1.wav
land_m_2i.wav
land_cb_19_2.wav
land_m_4i.wav
land_cb_19_6.wav
land_m_8i.wav

[sample.land_cb_19_1.wav]
env  0 2 8
usr  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
controls env

[sample.land_m_2i.wav]
env  0 2 8
usr  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
controls env

[sample.land_cb_19_2.wav]
env  0 2 8
usr  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
controls env

etc.

Thanks
M



Logged

FL2070

  • Modder
  • member
  • Offline Offline
  • Posts: 1303
  • FAC #87
Re: aircraft.common.prs ?
« Reply #5 on: February 03, 2021, 05:29:19 PM »

Great, thank you.  If more than one sample is applied to a controller, do they all get played at the same time or chosen randomly?

In the case of looped samples, yes (as far as I know). In the case of single-instance samples, they will only play together when you have "type mixer" in the [common] section. As far as random selection, that is up for debate. There is some forum thread hiding in the ass-ends of the site somewhere in which there is a discussion about how random sample selection works with excerpts from classfiles, and it's definitely not how anyone would think it works. If I remember correctly, only the first two of the listed samples will be chosen, but there are other strange conditions as well that apply that can cause exceptions... but don't take my word for it. I don't remember that thread very well. It's best to experiment for yourself in this case, I think.
Logged
On average, the average average averages, averagely, the average average of all averages.

marcost

  • Modder
  • member
  • Offline Offline
  • Posts: 1088
  • Keep calm and run away
Re: aircraft.common.prs ?
« Reply #6 on: February 04, 2021, 01:30:32 AM »

That's great, thanks again. I can experiment from here I think
Logged
Pages: [1]   Go Up
 

Page created in 0.034 seconds with 20 queries.