Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 04-23-2018, 07:07 AM   #76
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Well, depends on how realistic you want to be. Simple would be using the surface relative velocity of Orbiter (GetHorizonVelocity or so)

More accurate would be using dynamic and static pressure to calculate velocity and altitude change.
Urwumpe is offline   Reply With Quote
Thanked by:
Old 04-23-2018, 07:16 AM   #77
kuddel
Donator
Default

Quote:
Originally Posted by zachary77 View Post
 By the way, how would I get vertical speed (for variomater)?
delta height divided by delta time...would be the most obvious
kuddel is offline   Reply With Quote
Thanked by:
Old 04-23-2018, 07:30 AM   #78
zachary77
Orbinaut
Default

Quote:
Originally Posted by kuddel View Post
 delta height divided by delta time...would be the most obvious
But how would I know delta time? Each time step is different.
zachary77 is offline   Reply With Quote
Old 04-23-2018, 08:03 AM   #79
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 But how would I know delta time? Each time step is different.
In post- and prestep, you have a parameter called "simdt" in the interface. Thats the predicted length of the current timestep.
Urwumpe is offline   Reply With Quote
Old 04-23-2018, 09:13 AM   #80
4throck
Enthusiast !
 
4throck's Avatar
Default

Quote:
Originally Posted by zachary77 View Post
 But how would I know delta time? Each time step is different.
You can calculate delta time along with delta altitude.


Get the simulated time and altitude, store it on some variables, then get time and altitude again and do the calculations with regard to the previous stored values.
4throck is offline   Reply With Quote
Old 04-23-2018, 10:50 AM   #81
zachary77
Orbinaut
Default

Never mind, I’ve got it thru trig. functions. Added sound too (volume varies with VS). And so, I’m really happy to announce that... we have a FULLY FUNCTIONING AURAL VARIOMETER!!
Thanks for the idea, Ripley
zachary77 is offline   Reply With Quote
Thanked by:
Old 04-23-2018, 03:04 PM   #82
Ripley
Tutorial translator
 
Ripley's Avatar
Default

You're welcome, but it's not my idea!


Ripley is offline   Reply With Quote
Thanked by:
Old 04-23-2018, 03:43 PM   #83
Marijn
Orbinaut
 
Marijn's Avatar
Default

Quote:
Originally Posted by zachary77 View Post
 volume varies with VS
Actually the tone of the sound should go up and down. Like in the video above. Have a look at this one as well:


Most acoustic variometers have a switch do they don't make noise when sinking. Only when gaining energy.
Marijn is online now   Reply With Quote
Old 04-23-2018, 11:09 PM   #84
zachary77
Orbinaut
Default

Quote:
Originally Posted by Ripley View Post
 You're welcome, but it's not my idea!


Happy Sound of Vario in a Thermal - YouTube
You got me thinking about whether it was possible, and turns out it was

---------- Post added at 11:09 PM ---------- Previous post was at 11:07 PM ----------

Quote:
Originally Posted by Marijn View Post
 Actually the tone of the sound should go up and down. Like in the video above. Have a look at this one as well: Thermal-Crossing Vario Sounds - YouTube

Most acoustic variometers have a switch do they don't make noise when sinking. Only when gaining energy.
Yes, but XRSound canít vary pitch, only volume. So itís a technical limitation.
zachary77 is offline   Reply With Quote
Old 04-24-2018, 05:50 AM   #85
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

You can always use different sound files for different tones....

Not sure if dbeachy1 could give you a toy in a newer XRSound version to modify the tone.
Urwumpe is offline   Reply With Quote
Thanked by:
Old 04-24-2018, 11:00 AM   #86
zachary77
Orbinaut
Default

Quote:
Originally Posted by Urwumpe View Post
 You can always use different sound files for different tones....

Not sure if dbeachy1 could give you a toy in a newer XRSound version to modify the tone.
I'd really like that...
zachary77 is offline   Reply With Quote
Old 04-24-2018, 12:01 PM   #87
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by Urwumpe View Post
 Not sure if dbeachy1 could give you a toy in a newer XRSound version to modify the tone.
Given that OrbiterSound allows for it with a frequency parameter in the play functions, and the need arising in one of the first addons implemented with it, it would be a logical addition to XRSound IMHO. But of course I don't know how hard it would be to implement this feature.
Face is offline   Reply With Quote
Thanked by:
Old 04-24-2018, 02:31 PM   #88
dbeachy1
O-F Administrator
 
dbeachy1's Avatar


Default

As I understand it, OrbiterSound's "frequency" parameter just sets the frequency that Windows uses to play back the wav file -- i.e., 22 KHz vs. 44 KHz, etc. It does not alter the actual wav file pitch (or sound), it only sets the accuracy with which the file is played back. That parameter is also (IMO) rather obsolete in this era of 48KHz+ sound support on every system. The SDK docs describe it as:

Quote:
// Frequency : From 3000 to 44100 (OrbiterSound's plays anyway at 22050 so your sound will be resampled at run time)
Or do you mean that it plays back the wav file at a "slower" or "faster" rate compared to 22050??

EDIT:
If that is indeed what the 'frequency' parameter in OrbiterSound does, I could add support for that to XRSound 2.0 by using the underlying irrKlang sound engine's 'setPlaybackSpeed' feature.
dbeachy1 is offline   Reply With Quote
Thanked by:
Old 04-24-2018, 02:34 PM   #89
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by dbeachy1 View Post
 OrbiterSound's "frequency" parameter just sets the frequency that Windows uses to play back the wav file -- i.e., 22 KHz vs. 44 KHz, etc. It does not alter the actual wav file pitch (or sound), it only sets the accuracy with which the file is played back. That parameter is also (IMO) rather obsolete in this era of 48KHz+ sound support on every system.

tl;dr: OrbiterSound does not support that, either.
But would there be either support somewhere in your underlying API for "changing pitch of a sample" or "synthesizing sounds".

In this case, having a sine sound generator would be enough, but I am not sure if there is any around in a modern PC...
Urwumpe is offline   Reply With Quote
Old 04-24-2018, 03:19 PM   #90
dbeachy1
O-F Administrator
 
dbeachy1's Avatar


Default

@Urwumpe Thanks for info -- please see my edits to my post above. If OrbiterSound is simply varying the speed (and therefore, the pitch) of the sound as it plays it back, I believe I could add support for that in XRSound 2.0 via a feature in the underlying irrKlang sound engine. The OrbiterSound docs aren't clear on exactly what that parameter does, and I have never tested that in OrbiterSound.
dbeachy1 is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development

Tags
glider, o2016


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 08:49 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2007 - 2017, Orbiter-Forum.com. All rights reserved.