Just wondering if any of you have any ideas for sounds.
I'm programming wave files in my off time, and so far I've
concentrated on waves from simple sin constructions, sin
constructions where the frquency varies by another sin or cos
function, multiples of sin/cos functions with 2 different frquencies
and 2 different amplitudes. Any Suggestions?
for example, one of my wav subs looks like this:
VB Code:
Private Sub SIREN(ByRef IN_WAVE As Variant) Dim MyLen As Long Dim PIE As Double Dim MyVal As Long Dim MyInc_01 As Double Dim MyInc_02 As Double Dim MyInc_03 As Double Dim MyInc_04 As Double Dim MyHight01 As Long Dim MyHight02 As Long Dim Freq_01 As Long Dim Freq_02 As Long Freq_01 = Val(TogTxt(2).Text) Freq_02 = Val(TogTxt(3).Text) MyInc_04 = (Freq_01 - Freq_02) PIE = 3.14159265358979 MyLen = UBound(IN_WAVE) MyInc_01 = 2 * Freq_01 * PIE / MyLen MyInc_02 = 2 * Freq_02 * PIE / MyLen MyInc_03 = Val(TogTxt(4).Text) * PIE / MyLen MyHight01 = Val(TogTxt(0).Text) MyHight02 = Val(TogTxt(1).Text) For i = 0 To UBound(IN_WAVE) ' Step 2 MyInc_01 = 2 * ((Sin(MyInc_03 * i)) * MyInc_04 + Freq_02) * PIE / MyLen MyVal = MyHight01 + Int(MyHight02 * Sin(i * MyInc_01)) '+ Int(MyHight02 * Sin(i * (MyLen - (2 * i)) * MyInc_02 / MyLen))) If MyVal > 32000 Then MyVal = 32000 Else If MyVal < -32000 Then MyVal = -32000 End If End If IN_WAVE(i) = MyVal Next i End Sub
and a couple of sample outputs are attacheded.
Any Suggestions?




Reply With Quote