Author Topic: Help needed with waveform audio stuff  (Read 6567 times)

Siekmanski

  • Member
  • *****
  • Posts: 1859
Re: Help needed with waveform audio stuff
« Reply #15 on: February 17, 2015, 09:49:30 AM »
 :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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: Help needed with waveform audio stuff
« Reply #16 on: February 17, 2015, 10:29:49 AM »
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

  • Member
  • *****
  • Posts: 1859
Re: Help needed with waveform audio stuff
« Reply #17 on: February 17, 2015, 10:53:59 AM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: Help needed with waveform audio stuff
« Reply #18 on: February 17, 2015, 11:26:22 AM »
another image
again, a little too soft on attack, but the decay looks better than the other one


Siekmanski

  • Member
  • *****
  • Posts: 1859
Re: Help needed with waveform audio stuff
« Reply #19 on: February 17, 2015, 01:13:22 PM »
I made a small test.

Removed attachment, see Reply #21.
« Last Edit: February 18, 2015, 01:17:05 AM by Siekmanski »
Creative coders use backward thinking techniques as a strategy.

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: Help needed with waveform audio stuff
« Reply #20 on: February 17, 2015, 03:52:59 PM »
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

  • Member
  • *****
  • Posts: 1859
Re: Help needed with waveform audio stuff
« Reply #21 on: February 18, 2015, 01:15:29 AM »
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
« Last Edit: February 18, 2015, 03:19:16 AM by Siekmanski »
Creative coders use backward thinking techniques as a strategy.

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: Help needed with waveform audio stuff
« Reply #22 on: February 18, 2015, 05:28:08 AM »
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

  • Member
  • *****
  • Posts: 1859
Re: Help needed with waveform audio stuff
« Reply #23 on: February 18, 2015, 07:23:44 AM »
Especially when you want to have a nice and clean sinus without spurs.  :t
Creative coders use backward thinking techniques as a strategy.