03-31-2024, 10:39 AM
I played with it a bit more, so here are two similar outputs.
Rapid anti-phase change - weak "quack" form - best heard on stringed instruments
And here is the predecessor:
The difference between them is only in the width of the changed antiphase frequency and also in the speed with which the change is made.
Rapid anti-phase change - weak "quack" form - best heard on stringed instruments
Code: (Select All)
$NoPrefix
Screen _NewImage(600, 600, 32)
S = SndOpen("08.mp3")
Dim m As MEM
Dim As Single L, R, L2, R2
Dim As Long X, f
m = MemSound(S, 0)
If m.ELEMENTSIZE <> 8 Then
Print "Try another music file, program required SINGLE array. Try MP3."
Sleep
SndClose S
MemFree m
System
End If
Stp = 1 'frequency step
Y = 1
Do Until n& >= m.SIZE - SndRate
OldX = X
If n& Mod SndRate \ 30 = 0 Then X = X + Y
If X > 18 Then Y = -1
If X < 6 Then Y = 1
'get freqency in samples
f = _SndRate \ 2 \ X
So& = n& + 16 * X
MemGet m, m.OFFSET + n&, L
MemGet m, m.OFFSET + n& + 4, R
MemGet m, m.OFFSET + So&, L2
MemGet m, m.OFFSET + So& + 4, R2
SndRaw (L2 - L), (R2 - R)
Do Until SndRawLen <= .1
Locate 2
Print "Antiphase Freqency:"; f; "Hz "
Loop
n& = n& + 8
Loop
SndClose S
MemFree m
System
And here is the predecessor:
Code: (Select All)
$NoPrefix
Screen _NewImage(600, 600, 32)
S = SndOpen("103.mp3")
Dim m As MEM
Dim As Single L, R, L2, R2
Dim As Long X, f
m = MemSound(S, 0)
If m.ELEMENTSIZE <> 8 Then
Print "Try another music file, program required SINGLE array. Try MP3."
Sleep
SndClose S
MemFree m
System
End If
Stp = 1 'frequency step
Y = 1
Do Until n& >= m.SIZE - SndRate
OldX = X
If n& Mod SndRate \ 20 = 0 Then X = X + Y
If X > 99 Then Y = -1
If X < 3 Then Y = 1
'get freqency in samples
f = _SndRate \ 2 \ X
So& = n& + 16 * X
MemGet m, m.OFFSET + n&, L
MemGet m, m.OFFSET + n& + 4, R
MemGet m, m.OFFSET + So&, L2
MemGet m, m.OFFSET + So& + 4, R2
SndRaw (L2 - L), (R2 - R)
Do Until SndRawLen <= .1
Locate 2
Print "Antiphase Freqency:"; f; "Hz "
Loop
n& = n& + 8
Loop
SndClose S
MemFree m
System
The difference between them is only in the width of the changed antiphase frequency and also in the speed with which the change is made.