Jump to content

wim1976

Members
  • Posts

    154
  • Joined

  • Last visited

Everything posted by wim1976

  1. Another good document for OpenAl programming: http://grva.lamce.coppe.ufrj.br/labcogsdk/download/extras/openal/OpenAL_Programmers_Guide.pdf Especially usefull in conjunction with the OpenAL 1.1 Specification and Refercence (see post #3).
  2. Until now I have no luck using the sound or openal functions within GIZMO. This day I have written many tests to determine the workings of openAL within Gizmo. But the same problem as reported the week before exist. Please help, because I am running out of ideas to get my problem solved. In the attached file you see my test functions. The lines 191 to 204 gives unexpected results. It looks like that all functions with one number value works good, but functions with three number values gives wrong results. OpenAL_Test.zip
  3. I have made a little script to demonstrate my problem. Every two seconds the soundposition is changed, the change is logged to the console. In the zip-file I also added the used soundfile. Ben (or other GIZMO guys) could you test if it is my problem or a Gizmo problem? Sounds.zip
  4. It looks like luaal is gone: https://www.openhub.net/p/luaal/enlistments
  5. - Listener was not moved. I only repositioned the source - The file was mono (I double checked this) I don't understand why only the y variable 'responds'. I have done a quick test on the velocity function. It seems it gave the same problem (but I am not sure). OpenAL is 'blackart' and seen the fragmented documentation I agree; especially the documentation of Openal-soft (which is used in X-Plane is only readable for people with a very good understanding of C), but wat is an better option to program sound-effects? EDIT I just tried a similar code with SASL. But here the setPosition() function works like a charm.
  6. I have been experimenting with the function sound.position(sound_source_id, x, y, z). After many tests it looks lik only the y value changes the volume of the sound. I have als tried it with calling the openal function: al.Source(sound_source_id,al.POSITION,x,y,z)But using this function gives the same (wrong) result as the Gizmo function. What is going wrong here? I have test the audio-file in the OpenAL SDK and in that case changing x and y gives a desired effect. A second question: The x, y and z are related to world coördinates. But how long is a coördinate? (in meters?)
  7. Thanks this helped me. I had to change the code a little bit to get it working. First "SOURCE_STATE" is changed in al.SOURCE_STATE and the second problem is dat I get integer values returned and not string values of the openAL constants. So I now test the integervalues. For more information of the openal values see: http://download.java.net/media/joal/builds/archive/1.1b01/joal-javadoc-1.1b01/net/java/games/joal/ALConstants.html function isSoundPlaying( source ) --The possible vales for source_state are: --4113: AL_INITIAL --4114: AL_PLAYING --4115: AL_PAUSED --4116: AL_STOPPED local source_state = al.GetSource(source, al.SOURCE_STATE); if(source_state == 4114)then return true end return falseend
  8. Is it also possible to check it with an OpenAL function?
  9. Contains this document the right info about the Open AL implementation in Gizmo? http://www.openal.org/documentation/openal-1.1-specification.pdf
  10. Is there a function in Gizmo to test if a sound is already playing?
  11. I am learning more and more about Gizmo. I have been experimenting with a sound file. In the past I bought a sound package of Synchrosoft for FSX and I am trying to convert this to X-Plane. But there is a difference in the sounds via Gizmo/X-Plane and FSX. The FSX-sounds have a higher volume than X-Plane, but the volume differences differs at the different gain values. This causes an other sound character in X-Plane (the lower sounds are more pronounced than in X-Plane). Is there somebody wo experienced the same difference? Is there an easy method to compensate this differences? For FSX there is FS sound studio which I used to understand the settings of the FSX soundfiles. Is there a similar program/plugin for X-Plane?
  12. I have made it myself easy to prefix al the debug variables with DBG_ in capital so I can see the difference with others and I see and search them easily. Thanks!
  13. It describes exactly what it is. Thanks.
  14. I want to check the value of some variables on screen. For putting strings on screen I use the OnDraw.Windows() function. The variables I want to check are (for example) declared in the function OnUpdate(). For global variables it works perfect, but local variables are out of scope within other functions. I can get around this to make the local variables global (I dislike this because some names are used in more functions, for example the infamous 'i'). The other solution is to assign the local value to a newly created global value. For me this is the less worst solution, but after debugging I have to go through my code and delete (or out-comment) all the debug variables. I hope there is a better solution?
  15. In the Gizmo API is explained that you must use sound.bind() before using sound.play. But why is the function sound.bind not documented in the list "API"? see: http://www.gizmo64.com/Gizmo64_API.htm#sound.load
  16. I understand that datarefs have to be used as interface (data-exchange) between X-Plane and the plugin. So I go for an other solution. Meanwhile I have learned a lot more about datarefs. Thanks!
  17. I am still confused. When I open the datarefeditor the variable (object?) assigned to the dataref is updating each frame, exactly what I want to achieve with in the OnUpdate() function. But after closing the datarefeditor the function _OnRead() isn't called anymore. How can I read the custom dataref in the OnUpdate() function?
  18. I want to create a dataref in Gizmo. In the Gizmo API two methods are explained. Because I want to use the dataref for an algorytm I used the second method: dr_TAS = dref.getDataref("sim/flightmodel/position/true_airspeed")dr_Sigma = dref.getDataref("sim/weather/sigma")dr_EAS_C = dref.newFloat("my/custom/dataref", "my_custom_dataref_eas")function OnUpdate() EAS = dref.getFloat(dr_EAS_C) -- This one works: EAS = my_custom_dataref_eas_OnRead() -- but this give no benefit in creating a dataref.endfunction my_custom_dataref_eas_OnRead() -- calculating the Equivalent airspeed -- needed because IAS in X-Plane is writable (and windsounds do not depend on vibrating gauges) -- see formula on http://en.wikipedia.org/wiki/Equivalent_airspeed local EAS = dref.getFloat(dr_TAS) * math.sqrt(dref.getFloat(dr_Sigma)) return EASendSee function OnUpdate(). What am I doing wrong here.
  19. I have made a test-project (in the c-4 the Jet) to get a further understanding of the drawing events. I discovered that the events are not only important for the moment of drawing, but also for the objects for where it is linked to. The gauge-events are linked to the gauge-panel and not to the screen, the position is relative to the gauges. It looks like the text is relative to another resolution than the screen resolution (is that the 1024x768 resolution which is mentionend in de X-Plane SDK) because the textsize differs also. The other 2D events seems linked to the screen. (See screenshot 1) The 3D gauge event is a 2D drawingmode, but it looks like that the text is drawn on a 3D object (See screenshot 2) Are my findings correct?
  20. I am reading the X-Plane SDK to understand the workings of GIZMO. I have made a table with the drawing phases of the X-Plane SDK and the drawing events of Gizmo. After combining that info I got some questions: Why is the event OnDrawBeforeLastScene categorized as a 2D event in the Gizmo API, while the corresponding xplm_Phase is a 3D drawing phase according to the X-Plane SDK At which phases do the 'Before' events occur? According to the name I classified them as the first event in the xplm_Phase with the corresponding name. The description in the Gizmo API at OnDraw_BeforeGauges seems to say that the event is the last event of the former phase. I am not sure about classifying the OnDraw_Gauges_3D and OnDraw_BeforeGauges_3D events? Are they part of the xplm_Phase_Panel? Are there no corresponding events for xplm_Phase_LocalMap3D?Gizmo API: http://www.gizmo64.com/Gizmo64_API.htm#OnDraw_BeforeFirstCockpit X-Plane SDK: http://www.xsquawkbox.net/xpsdk/mediawiki/XPLMDisplay Drawing events in Gizmo.pdf
  21. Impressive. It looks like the Anti-Aliasing have reached a perfect situation here.
  22. Thanks answering the second question. But I am still confused regarding the why question. The api is a useful list, but the explanation is very sparse.
  23. Thanks Jim, this works. But why does it work with this function and not with other functions. A next question is where can I find explanation of the various default event-functions.
×
×
  • Create New...