Oxygen Basic

Programming => Example Code => Audio => Topic started by: Charles Pegge on March 25, 2012, 03:13:37 PM

Title: Wave Audio: Real-Time sound effects and synthesis
Post by: Charles Pegge on March 25, 2012, 03:13:37 PM
In the latest Oxygen-in-progress, there are 18 new demo progs dealing with Wave Audio. They use the lowest level audio API and all the sounds are generated from scratch, feeding pulse-codes directly into looped audio buffers, in chunks of about 1/40 of a second. - I have animation and games in mind!

With real-time audio synthesis, all the sounds can be unique and even slightly out of tune if so desired :)

Charles

They are located in examples/sound
Title: Re: Wave Audio: Real-Time sound effects and synthesis
Post by: Petr Schreiber on March 25, 2012, 10:59:27 PM
Hi Charles,

where can I found the release containing these examples? On the website and sourceforge I can still see "just" the Alpha 038.


Thanks,
Petr
Title: Re: Wave Audio: Real-Time sound effects and synthesis
Post by: Charles Pegge on March 26, 2012, 01:13:27 AM
Hi Petr,

The primary updates are here

http://www.oxygenbasic.org/downloads.htm

The in-progress version is near the end of the list. Alpha 39 coming soon!

Charles
Title: Re: Wave Audio: Real-Time sound effects and synthesis
Post by: Peter on March 26, 2012, 04:49:47 AM
Hi Carles,

is only a hellish noise.  :D
If I close an example, then  I get  memory leaks.         
Title: Re: Wave Audio: Real-Time sound effects and synthesis
Post by: Charles Pegge on March 26, 2012, 06:55:11 AM
It requires the new Oxygen.dll.

Does this standalone version work Peter? It should be melodious.

(Press Esc to terminate instantly.)

Charles
Title: Re: Wave Audio: Real-Time sound effects and synthesis
Post by: Peter on March 26, 2012, 08:13:43 AM
Hi Charles,

I cannot say melodious, but it works.
There is not enough volume for better hearing.

Do you have a mixer for playing  32 stereo sounds ? I mean, will the sounds mixed?
Title: Re: Wave Audio: Real-Time sound effects and synthesis
Post by: Charles Pegge on March 26, 2012, 09:57:04 AM
You can mix sounds by adding them together or create several waves and run them at the same time, or  run alongside MIDI, or run several sound programs at the same time. The OS should be able to cope with all of these situations.

I've got quite a good sound system here - Having a large Woofer helps.

I Could produces bigger waves - currently using about 30% of peak amplitude

Charles
Title: Re: Wave Audio: Real-Time sound effects and synthesis
Post by: Petr Schreiber on March 26, 2012, 11:27:49 PM
Hi Charles,

thanks for the help, the examples are great...

Only problem is that the few last ones produce a bit of additional noise ("cracks"), but I guess that is the fault of notebook sound card.


Petr
Title: program version error, but exe version works
Post by: kryton9 on March 27, 2012, 05:49:41 PM
Charles, I got an error trying to run either example program:
ERROR:
Unidentified array or procedure
WORD:    waveoutopen

The precompiled executable that you also posted, that did run and sounded fine.
Title: Re: Wave Audio: Real-Time sound effects and synthesis
Post by: Charles Pegge on March 27, 2012, 10:59:31 PM

Hi Petr,

I will do some more testing. It may be a latency problem producing the cracks. I have a friend with a Samsung laptop running Windows 7. - I'll see how it performs. Perhaps I cand post some more test pieces to you with different processing periods.

I found there was a slight hissing noise produced at the start on the compiled demo. This was cured by adding 'sleep 10' at the end of the WavoStart method in waves.inc.


Hi Kent,

I think you are running off an older Oxygen.dll, rather than the new one. There was a problem interpreting the wave audio C header: waves.h -( it would looker a lot cleaner in Basic.)

I have also made further changes to Oxygen in the last 24 hours, flushing out a few gremlins which came out of the woodwork when compiling the demos to 64 bit EXE. Yesterday was a hard day, but I caught them in the end.


Charles