Treat depression with your Commodore 128

Started by nikoniko, August 21, 2007, 03:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nikoniko

Since all 128 owners are depressed by how little software took advantage of their machine, this might be just the thing. :D

Method and system for modification of condition with neural biofeedback using left-right brain wave asymmetry

US Patent number: 5280793
Filing date: May 13, 1992
Issue date: Jan 25, 1994

Abstract
A method and system for treating a patient having a pathological condition characterized by asymmetry between brain waves measured from two locations of the scalp.

Quote...The computer 24 runs a program 29, such as ALAY11, by J. P. Rosenfeld. The program 29 is written in BASIC which is then compiled with the "BASIC 128" compiler by Abacus Co., (Grand Rapids, Mich.). The program listing AYAY11 (included in Appendix 1) shows the source (uncompiled) code in Commodore BASIC 7.0. When compiled, this program becomes M-ALAY11. This program 29 serves to collect various types of baseline samples (in baseline sessions, the subject does not get "rewards" contingent on ALAY values) of ALAY and provides ALAY statistics for the session at its end, so that biofeedback criteria for future ALAY training can be generated, as described below.

After baseline session(s), the same program 29 may also used for ALAY training. The variable GL (see Line 65 of the program listing in Appendix 1) is given the actual ALAY training "CRITERION TO BEAT" and when GL is exceeded, a reward is given, as in Line 162. The "reward" may be a pleasant-sounding tone, as in the present embodiment. If, and only if, SA (the ALAY Score for the current sample) exceeds GL (the goal or criterion), is the "SOUND" given. This "SOUND" instruction, in the Commodore 128 computer 24, causes a low voltage sine wave to be output from the sound generating circuit of the computer 24 which then goes to a standard audio power amplifier ("Audio") 30 which amplifies it so that it can drive the loudspeaker 32 which the subject can hear...

Blacklord

And here's the source - someone else can do the testing :)

5 REM@I = T,01,TR,SM,RR,L(SM),R(SM),AF,ZE,FF,MM,IS,OT,SR,SL,DR,YR(SM),YR(S L),CT, MS,TC,TP,
6 PRINTCHR$(147) :REX/ALAY111A.RESERVED INTEGERS, BUT COMPILED ON "OPTION 1"
7 PRINT"ALAY11,3-2-91; REV, 5- 2-92,BY J.P. ROSENFELD,PHD. PROGRAM WILL TRAIN OR SAMPLE EEG ALPHA OR OTHER 2-SITE ASYMMETRY WITH CORRECT HARDWARE BANDPASS FILT ER"
8 FOR I=1TO10000:NEXT
10 REM/ ALAY11 (VS 09) HAS RAMREINF OPTION,MORE DEBUGS THAN ALAY10
12 FAST:CLR:DIM R(300):DIM L(300):DIMYR(300):DIMYL(300)
15 PRINTCHR$(147)
21 REM
22 REM.............SET-UP.....................
23 REM
30 O2=2:V1=2500:V2=250:V3=5000:HF=.5:V4=3000 :V6=2048:V6=60:KM=1000
40 VOL 15
65 INPUT"CRITERION TO BEAT";GL:INPUT"DISPLAY(1 OR 0)",DR:INPUT "HARD COPY(0 OR 1) "HC:INPUT"REWARD DUR";RW:INPUT"AFT SIG DUR";AD:INPUT"S-NAME":NM$
66 INPUT"TRAIN OR SAMPLE(SAMPLE=1,TRAIN=2)";BT :IF BT=1THEN INPUT"RAND. HIT RATE (1-100)";CC
70 INPUT"DELAY/ITI":IT:INPUT"DELAY/ISMPLI";IS:I=0:WS=160:TE=28:CO=DEC("DF0 0"):C1 =DEC("DF01"):C2=DEC("DF03"):01=1:ZE=0:OT=128:FF=255:CT=100:K1=50/128 :TC=300
80 SCNCLR
85 INPUT"DRAWSTEP (USUALLY =1 SO DRAWPOK=EPOCH)";DP:COLOR 0,1:COLOR 1,2:COLOR 4, 1:GRAPHIC 1,1
90 INPUT"SWEEPS/TRIALS(2500)";TR
95 INPUT"EPOCH PTS(*RES=EPOK . . . 300MAX)";RR:TP=INT(300/RR)*DP:INPUT"HI" ;HI:INPUT" LO":LO
96 REM
97 REM...............TRIALS LOOP............
100 FOR T=01TOTR:GRAPHIC 1,1:SL=ZE:SR=ZE
101 REM
102 REM.........EEG SAMPLING LOOP....
103 REM
104 DD=PEEK(C0):DD=PEEK(C1) :REM/ DUMMY 2-STEP SETUP
105 B=TI:FOR SM=01TORR :REM/=.5 SEC AT 5 MSEC RES IFRR=100
110 L(SM)=PEEK(C2):REM RETURNS C0
111 R(SM)=PEEK(C0):REM RETURNS C1
112 AF=PEEK(C1):IF AFK<=LO OR AF>=HI THERSOUND 02,V1,AD,02,V2,V3,01,0:IA=I A+1:ELS EGOTO127:REM RETURNS C2 WHICH IS EYE CHANNEL
126 GOTO 105
127 FORMM=01TOIS:NEXTMM:NEXT SM:A=TI
128 REM
129 REM...........RECT & MATH..........
130 B1=TI: FORSM=01TORR:IF R(SM)<OT THEN R(SM)=FF -R(SM):ELSE R(SM)=2E+R(SM)
135 IF L(SM)<OT THEN L(SM)=FF -L(SM):ELSE L(SM)=ZE+L(SM)
140 SR=SR+R(SM):SL=SL+L(SM):NEXTSM:SA=SR-SL:A1=TI
141 REM
142 REM..........DISPLAY OPTION.......
145 IF DR=ZE THEN GOTO 158:REM/ SKIP DRAW OPTION
148 D=TI:FOR SM =01 TO RR:YR(SM)=R(SM)*K1:YL(SM)= L(SM)*K1,CT:NEXT SM
150 SM=1: SLOW:FORMS=01TOTCSTEPTP: DRAW 01,MS,YR(SM):DRAW 01,XS,YL(SM):SM=SM+01 NEXTMS:C=TI:FAST :FORLL=01TOIT:NEXTLL
151 REM
152 REM..........REINFORCEMENT........
158 RD=TI:ON BT GOTO 159,162
159 NR=INT(RND(1)* CT+01):IF NR< CC THEN IR=IR+1:SOUND 01,V4,RW,ZE,ZE,ZE,Z E,V5
162 IFSA >GL THENI=I+01:IFBT=2 THEN SOUND 01,V4,RW,ZE,ZE,ZE LE,V5
163 RC=TI
164 REM
165 REM..........STATS. END LOOP......
170 ZR=ZR+SR/CT :ZL=ZL+SL/CT :ZA=ZA+SA/CT
175 QR=QR+(SR/CT)â†'02,QL=QL+(SL/CT)â†'02:QA=QA+(SA/CT)â†'02
178 NEXT T
180 REM
181 REM...........RUN STATS/SCREEN OUTPUT.........
182 PRINT"ZR=" ZR/TR:"ZL=" ZL/TR;"ZA="ZA/TR:"HITS=" I: "EPOK="(A-B)/60:"MATH="(A1-B1)/V6;"DISP="(C-D)/V6:"REINF="(RC-RD)/V6
185 VL= ((TR*QL-ZLâ†'02)/(TR*(TR-01)))â†'HF
186 VR= ((TR*QR-ZRâ†'02)/(TR*(TR-01)))â†'HF
187 VA= ((TR*QA-ZAâ†'02)/(TR*(TR-01)))â†'HF
188 PRINT"SD/L="VL;"SD/R="VR:"SD/A="VA
189 REM
190 REM...........OUTPUT/HARD COPY OPTION........
191 REM
192 IFHC>OTHENOPEN4,4:CMD4:PRINT"ZR=" ZR/TR,"ZL=" ZL/TR,"ZA="ZA/TR, "HITS=" 1,"EPOK="(A-B)/V6,"MATH="(A1-B1)/V6,"DISP="(C-D)/V6; "RElNF="(RC-RD)/V6:ELSE GOTO200
193 PRINT"AFTS="IA,"RANHITS="IR,"Hl="HI,"LO="LO
195 PRINT"SD/L="VL,"SD/R="VR,"SD/A="VA,"CRIT="GL,"ISMFLI="IS,"ITI=IT
196 PRINT"REINFDUR="RW,"AFT SIG DUR="AD,"S-NAME="NM$
197 PRINT"DPOK="300/TP*(((A-B)/V6)/RR)*KM,"TP="TP,"QR="QR/TR, "QL="QL/TR,"QA=QA/TR
199 PRINT"TRIALS="TR,"RES="(((A-B)/V6)/RR)*KM:PRINT#4:CLOSE4
200 INPUT"RUN AGAIN(1/0)";AG:IFAG>OTHEN RUN 12:ELSE END