/* original algorithm in AMIGA-Basic from United States Patent 5,135,468 by Meissner August 4, 1992 http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=/netahtml/search-adv.htm&r=1&f=G&l=50&d=PALL&p=1&S1=5,135,468.WKU.&OS=PN/5,135,468&RS=PN/5,135,468 START1: STARTFREQ = 31 ENDFREQ = 0 DURATION = 2 STEPFREQ = .0045 CENTERFREQ = 200.001 B=STARTFREQ + CENTERFREQ C=ENDFREQ + CENTERFREQ D=DURATION S=STEPFREQ F=CENTERFREQ FOR X=1 TO STARTFREQ S=STEPFREQ * ( STARTFREQ -X) B=STARTFREQ+CENTERFREQ B=B-X GOSUB DOWNFREQRIGHT DELAY1: FOR T=1 TO 1000 : NEXT T S=STEPFREQ * ( STARTFREQ -X) B=STARTFREQ+CENTERFREQ B=B-X GOSUB DOWNFREQLEFT DELAY1: FOR T=1 TO 1000 : NEXT T NEXT X STOP DOWNFREQLEFT: B=B-S: SOUND B,D,200,1: SOUND F,D,255,0: SOUND RESUME: IF B>C THEN GOTO DOWNFREQLEFT RETURN STOP DOWNFREQRIGHT: B=B-S: SOUND B,D,200,0: SOUND F,D,255,1: SOUND RESUME: IF B>C THEN GOTO DOWNFREQRIGHT RETURN STOP */ double startfreq,endfreq,duration, stepfreq,centerfreq, b,c,d,s,f,x; void downfreqleft(void){ downfreqleft: b=b-s; sound(b,d,200,1); // sound(freq_Hz,duration_ms,loudness,audio_channel) sound(f,d,255,0); sound resume; // unknown if (b>c) then goto downfreqleft; } void downfreqright(void){ downfreqright: b=b-s; sound b,d,200,0; sound f,d,255,1: sound resume; if (b>c) then goto downfreqright; } void delay1(void){ //for t=1 to 1000 : next t // what time could this be in AMIGA Basic : 1ms ? delay(1); } void meissner_main(void){ startfreq = 31; endfreq = 0; duration = 2; stepfreq = .0045; centerfreq = 200.001; b=startfreq + centerfreq; c=endfreq + centerfreq; d=duration; s=stepfreq; f=centerfreq; for (x=1;x <= startfreq; x++){ s=stepfreq * ( startfreq - x); b=startfreq+centerfreq; b=b-x; downfreqright(); delay1(): s=stepfreq * ( startfreq - x); b=startfreq+centerfreq; b=b-x; downfreqleft(); delay1(); };// next x }