Phoenix Edition v3.1 released!
#30
(09-06-2022, 04:43 AM)SMcNeill Wrote: IF snd AND D! > 0 THEN
        SOUND Hz, D! + .4 * -(D! = 0)

 You may want to rework your duration for your SOUND statement.  D is greater than 0, so D can never BE zero in your formula, making the D = 0 FALSE

SOUND Hz, D + .4 * -(D = 0)
SOUND Hz, D + .4 * -0
SOUND Hz, D

I don't know what D is in your program, but you may want to tweak it for the new backend where our timing is much closer to what's expected.  Maybe try SOUND Hz, D / 10

Okay, D! is used to denote the duration of the sound.

Although the help files for QB64 _and_ QB4.5 say that "DURATION" should be an INTEGER value, I've found that it also seems to work properly with a duration as small as .1 for QB64 and .4 for QB4.5 and the sounds do seem to be shorter than with a duration of 1.

Now, D! will be equal to zero when sound events are turned off, so in order to make a sound when the sound events are turned back on I added the " + .4 * -(D! = 0) ", and I also enter the subroutine at 5556 instead of 5555 when turning sound events on or off in order to avoid the test for D! > 0.

As far as the "DURATION" value goes, I plan to recheck everything in QB64 and QB4.5 and make any adjustments needed for the best results.

QB4.5 always uses the "SOUND" command; QB64 uses the "SOUND" command _only_ if the .wav files aren't present when the program is compiled.



Thanks again @SMcNeill for all your help and advice.
Reply


Messages In This Thread
Phoenix Edition v3.1 released! - by SMcNeill - 09-04-2022, 02:46 AM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-04-2022, 03:26 AM
RE: Phoenix Edition v3.1 released! - by bplus - 09-04-2022, 04:59 PM
RE: Phoenix Edition v3.1 released! - by OldMoses - 09-04-2022, 05:53 PM
RE: Phoenix Edition v3.1 released! - by bplus - 09-04-2022, 06:59 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-04-2022, 08:31 PM
RE: Phoenix Edition v3.1 released! - by OldMoses - 09-05-2022, 01:32 AM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-04-2022, 06:18 PM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-04-2022, 06:28 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-05-2022, 12:19 AM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-05-2022, 10:45 AM
RE: Phoenix Edition v3.1 released! - by Gets - 09-05-2022, 01:31 AM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 02:05 AM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-05-2022, 02:02 PM
RE: Phoenix Edition v3.1 released! - by OldMoses - 09-05-2022, 03:19 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 04:13 PM
RE: Phoenix Edition v3.1 released! - by a740g - 09-05-2022, 04:44 PM
RE: Phoenix Edition v3.1 released! - by Ikerkaz - 09-05-2022, 02:08 PM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-05-2022, 06:09 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 06:29 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 11:25 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-06-2022, 08:37 PM
RE: Phoenix Edition v3.1 released! - by mnrvovrfc - 09-08-2022, 03:54 AM
RE: Phoenix Edition v3.1 released! - by bert22306 - 09-05-2022, 10:00 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-06-2022, 01:38 AM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-06-2022, 02:44 AM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-06-2022, 05:24 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-06-2022, 04:43 AM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-06-2022, 05:49 PM
RE: Phoenix Edition v3.1 released! - by Gets - 09-07-2022, 04:01 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-08-2022, 10:01 AM
RE: Phoenix Edition v3.1 released! - by a740g - 09-10-2022, 07:10 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-10-2022, 11:26 PM



Users browsing this thread: 3 Guest(s)