Project

General

Profile

Actions

Bug #822

open

Set Wave gets a type mismatch error

Added by Brian Flanagan about 3 years ago. Updated about 3 years ago.

Status:
Feedback
Priority:
Normal
Target version:
Start date:
09/17/2021
Due date:
% Done:

0%

Estimated time:
1:00 h
Affected version:

Description

The problem exists in both manifests.

For example: (from top of page 08.06.06 of AMOS Pro manual)

S$=""
For W=-128 To 127
    X=W : If X < 0 Then Add X,256
    S$=S$+Chr$(X)
Next W
Set Wave 2,S$
Wave 2 To 15 : For S=10 TO 60 : Play S,10 : Next S

Also, same error in example at bottom of page 08.01.06 of AMOS Pro manual: (renamed Shape$ to Shpe$ just to be safe.

Shpe$="" : Degree
For S=0 To 255
    V=Int((Sin(S)/2+Sin(S*2+45)/4)*128)+127
    Shpe$ = Shpe$ + Chr$(V)
Next S
Set Wave 2,Shpe$
Wave 2 To 15
For N=10 TO 60 : Play N,10 : Next N

The same error is generated for both examples.

Actions #1

Updated by Francois Lionet about 3 years ago

  • Status changed from New to Feedback

Not new: Set Wave never worked. It will with the new sound engine, nmearly complete.

Actions #2

Updated by Brian Flanagan about 3 years ago

Re-tested in newest version as of 21 Oct 2021.

Set Wave still fails entirely in Amiga mode.
In AOZ mode, the command runs without errors, but the waveform used does not change.

Hope you get it finished soon. ;-)

Updated example:

#manifest: "aoz"
'
' Example 1
'
S$=""
For W=-128 To 127
    X=W : If X < 0 Then Add X,256
    S$=S$+Chr$(X)
Next W

Set Wave 2,S$
Wave 2 To 15

delay#=5
stp#=1

If Manifest$<>"amiga"
    delay#=delay#/60
    stp#=stp#/10
End If
Locate 0,0 : Print delay#,stp#

For P#=10 TO 60
    Locate 0,1
    Print Using "Delay: ###.##";delay#
    Print Using "Step:  ###.##";stp#
    Print Using "Pitch:    ###";P#
    Play P#,delay#
Next P#

Cls
Print "New waveform set."
'
' Example 2
'
Shpe$="" : Degree
' Completely different waveform.
For S=0 To 255
    V=Int((Sin(S)/2+Sin(S*2+45)/4)*128)+127
    Shpe$ = Shpe$ + Chr$(V)
Next S
Set Wave 2,Shpe$
Wave 2 To 15
For N#=10 TO 60
    Locate 0,4
    Print Using "###";N#
    Play N#,delay#
Next N#
Actions

Also available in: Atom PDF