News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Help needed with waveform audio stuff

Started by NoCforMe, February 15, 2015, 10:27:14 AM

Previous topic - Next topic

Siekmanski

 :biggrin: :biggrin: :biggrin:

You want to play a sine wave by hitting a key right ?
You could also do that using DirectSound filling a sound buffer with a sine wave and play that buffer with the frequency you need and as long as you want just like a morse key.
Creative coders use backward thinking techniques as a strategy.

dedndave

i get that
and i can do it with MIDI, too
but a solid beep turning off and on is very brash - a clickish sound to it
for nice morse, the wave shape attack and decay need to be shaped a little bit
something i can do easier with WAV

this one is probably a little too soft on attack and a little too stiff on decay, but you get the idea...


Siekmanski

If you create a sine wave starting and ending at zero there's no click.
There are 2 ways to play a sample, looping and one shot.
With one shot you can shape the sample the way you want without a clicking sound.
I'm now curious if you stop a perfect sine wave at once you will hear a click.
I'll test this....
Creative coders use backward thinking techniques as a strategy.

dedndave

another image
again, a little too soft on attack, but the decay looks better than the other one


Siekmanski

#19
I made a small test.

Removed attachment, see Reply #21.
Creative coders use backward thinking techniques as a strategy.

dedndave

nice - but seems a bit harsh
i don't understand the code - lol
i generally use a sidetone of about 750 Hz, though

need a storage scope to examine the modulation envelope   :(
is it just me, or is the envelope different on different keypresses ?

Siekmanski

#21
Yes Dave, you were right it was a bad example.  :redface:
I shouldn't code anymore late at night.  :biggrin:

Now with a correct 750 Hz sine wave with adjustable attack and decay.

edit: minor correction
Creative coders use backward thinking techniques as a strategy.

dedndave

very cool - give me some time to play...

thanks, Marinus   :t

not as easy as it sounds - lol
the same is true if you are trying to make a nice code practice oscillator   :biggrin:
takes a lot of circuitry to make it sound right

Siekmanski

Especially when you want to have a nice and clean sinus without spurs.  :t
Creative coders use backward thinking techniques as a strategy.