Wednesday, December 9, 2020

QBasic in action! Why I chose QBasic at work to develop drafting solutions.

It's been a very long time since I used QBasic for exploring graphics. But this week I need to learn how to do just that for a drafting assignment I had at work. I need to modify a semiconductor circuit layout for a new connector, and that required re-routing over 320 bus lines in the drawing. I wasn't going to do that manually, so I needed to learn the scripting language for this software. So that's when I turned to QBasic, both modern and old, to develop my very own "fanout" algorithm.
That drafting software is called DW-2000 and it's completely new to me. I was just learning how it's scripting language, GPE, can be used to draw when I was given this assignment. I didn't think I was comfortable enough with the language to work out the fanout algorithm in it. I usually work out ideas in Perl or LabView, or even Excel if I'm just looking at data. But for graphical stuff? The first language that came to my mind was also the very first one I learned about as a little kid, QBasic. So I fired up QB64, the working man's modern QBasic, and got to work drawing polygons and lines to test out how I was going to write this code in GPE. That's an early example of what I was doing in the picture. Eventually the fanout needed to be more complicated than a simple A to B connection, and I did those final tweaks in GPE after learning how to draw path-lines in it from some example code that DW-2000 provides. GPE is a very interesting language as well. It's an array language that operates in a way that totally reminds me of the J programming language. I'm really glad I've played around with J for years before coming across GPE. It really made it much easier for me to wrap my head around the syntax of it. So without much ado I give you some QBasic code, which works on modern QB64 and old school QBasic 4.5.
DECLARE FUNCTION interp# (a#, B#, c#, d#, x#)
DECLARE FUNCTION ys% (yc#)
DECLARE FUNCTION xs% (xc#)
' Develop some code to create the fanout algorithm that I want for FDC13SS in DW-2000
' Jovan Trujillo
' Flexible Electronics and DisplaY#s Center
' Arizona State University
' 12/1/2020

CLS
SCREEN 12
REM $DYNAMIC
DEBUG = 0

' Our coordinate boundaries are:
' x = -320 to +320
' y = -240 to +240
'
' Our screen boundaries are:
' x = 0 to 640
' y = 480 to 0
'
' Screen color key:
' 1 - blue
' 2 - green
' 3 - cyan
' 4 - red
' 5 - magenta
' 6 - brown
' 7 - light gray
' 8 - dark gray

'Declare boundary coordinates with two hash-like arraY#s
arrayMax% = 500
index% = 0
datapoint% = 1
REDIM boundX(500, 2) AS DOUBLE
REDIM boundY(500, 2) AS DOUBLE

FOR I = 0 TO (arrayMax% - 1)
    boundX(I, index%) = I
    boundX(I, datapoint%) = 0

    boundY(I, index%) = I
    boundY(I, datapoint%) = 0
NEXT I

' Enter boundary points manually
boundX(0, datapoint%) = -43104.998#
boundY(0, datapoint%) = 23900.031#

boundX(1, datapoint%) = -43104.737#
boundY(1, datapoint%) = 25096.649#

boundX(2, datapoint%) = -1980.657#
boundY(2, datapoint%) = 36489.974#

boundX(3, datapoint%) = 34770.5#
boundY(3, datapoint%) = 36489.974#

' Let's rescale these points to our screen resolution
boundPointCount% = 4

minYLayout# = boundY(0, datapoint%)
maxYLayout# = boundY(0, datapoint%)
minXLayout# = boundX(0, datapoint%)
maxXLayout# = boundX(0, datapoint%)

minXScreen# = 0!
maxXScreen# = 639!
minYScreen# = 479!
maxYScreen# = 0!

minXCart# = -320!
maxXCart# = 320!
minYCart# = -240!
maxYCart# = 240!

FOR I = 0 TO (boundPointCount% - 1)
    IF boundX(I, datapoint%) < minXLayout# THEN
        minXLayout# = boundX(I, datapoint%)
    END IF

    IF boundX(I, datapoint%) > maxXLayout# THEN
        maxXLayout# = boundX(I, datapoint%)
    END IF

    IF boundY(I, datapoint%) < minYLayout# THEN
        minYLayout# = boundY(I, datapoint%)
    END IF

    IF boundY(I, datapoint%) > maxYLayout# THEN
        maxYLayout# = boundY(I, datapoint%)
    END IF
NEXT I

minXLayout# = minXLayout# - 5000
minYLayout# = minYLayout# - 5000
maxXLayout# = maxXLayout# + 5000
maxYLayout# = maxYLayout# + 5000

IF DEBUG = 1 THEN
    PRINT "minXLayout: ", minXLayout#
    PRINT "minYLayout: ", minYLayout#
    PRINT "maxXLayout: ", maxXLayout#
    PRINT "maxYLayout: ", maxYLayout#
END IF


' Use interp to do the scaling, let's draw the boundary!
aX# = minXLayout#
bX# = minXCart#
cX# = maxXLayout#
dX# = maxXCart#

aY# = minYLayout#
bY# = minYCart#
cY# = maxYLayout#
dY# = maxYCart#

sX1 = 0#
sY1 = 0#
sX2 = 0#
sY2 = 0#

FOR I = 0 TO (boundPointCount% - 2)
    sX1# = interp#(aX#, bX#, cX#, dX#, boundX(I, datapoint%))
    sY1# = interp#(aY#, bY#, cY#, dY#, boundY(I, datapoint%))

    sX2# = interp#(aX#, bX#, cX#, dX#, boundX(I + 1, datapoint%))
    sY2# = interp#(aY#, bY#, cY#, dY#, boundY(I + 1, datapoint%))

    IF DEBUG = 1 THEN
        PRINT "I:"; I; " (LX1, LY1) = "; boundX(I, datapoint%); ","; boundY(I, datapoint%)
        PRINT "I: "; I; " (sX1, sY1) = "; xs%(sX1#); ","; ys%(sY1#)
        PRINT "I: "; I + 1; " (LX2, LY2) = "; boundX(I + 1, datapoint%); ","; boundY(I + 1, datapoint%)
        PRINT "I: "; I + 1; " (sX2, sY2) = "; xs%(sX2#); ","; ys%(sY2#)
        PRINT ""
    END IF

    LINE (xs%(sX1#), ys%(sY1#))-(xs%(sX2#), ys%(sY2#)), 1
NEXT I

IF DEBUG = 1 THEN
    ' Test what's going on with interp
    I = 0
    sX1# = interp#(aX#, bX#, cX#, dX#, boundX(I, datapoint%))
    sY1# = interp#(aY#, bY#, cY#, dY#, boundY(I, datapoint%))
    PRINT "(I, LX1, LY1) = "; I; boundX(I, datapoint%); boundY(I, datapoint%)
    PRINT "(I, sX1, sY1) = "; I; sX1#; sY1#
END IF

' Time to draw the tab locations
sX1# = interp#(aX#, bX#, cX#, dX#, 3160.499#)
sY1# = interp#(aY#, bY#, cY#, dY#, 36407.03#)
sX2# = interp#(aX#, bX#, cX#, dX#, 34793.5#)
sY2# = interp#(aY#, bY#, cY#, dY#, 38981.031#)

IF DEBUG = 1 THEN
    PRINT "(LX1#, LY1#, LX2#, LY2#): "; 3160.499#; 36407.03#; 34793.5#; 38981.031#
    PRINT "(sX1#, sY1#, sX2#, sY2#): "; sX1#; sY1#; sX2#; sY2#
    PRINT "(sX1%, sY1%, sX2%, sY2%): "; xs%(sX1#); ys%(sY1#); xs%(sX2#); ys%(sY2#)
END IF

' Draw source tab outline here.
LINE (xs%(sX1#), ys%(sY1#))-(xs%(sX2#), ys%(sY2#)), 2, B

' Draw array tab line here.
sX1# = interp#(aX#, bX#, cX#, dX#, -42993.999#)
sY1# = interp#(aY#, bY#, cY#, dY#, 24190#)
sX2# = interp#(aX#, bX#, cX#, dX#, 39946#)
sY2# = sY1#

LINE (xs%(sX1#), ys%(sY1#))-(xs%(sX2#), ys%(sY2#)), 2


' Now the real work begins! Time to try to draw a fanout!
' Array pitch is 260 um
' Source Tab pitch is 80 um
' Let's say there are 240 lines.
lineCount% = 240
arrayPitch% = 260
sourcePitch% = 80

arrayX1# = -42993.999#
arrayY1# = 24190#
tabX1# = 3970.5#
tabY1# = 36407.031#

FOR I = 1 TO lineCount%
    ' Draw lines from array to source tab
    X1% = xs%(interp#(aX#, bX#, cX#, dX#, arrayX1#))
    Y1% = ys%(interp#(aY#, bY#, cY#, dY#, arrayY1#))
    X2% = xs%(interp#(aX#, bX#, cX#, dX#, tabX1#))
    Y2% = ys%(interp#(aY#, bY#, cY#, dY#, tabY1#))
    LINE (X1%, Y1%)-(X2%, Y2%), 3
    arrayX1# = arrayX1# + arrayPitch%
    tabX1# = tabX1# + sourcePitch%
NEXT I


END

FUNCTION interp# (a#, B#, c#, d#, x#)
    ' Interpolate and return y given x and endpoints of a line
    IF (a# - c#) <> 0 THEN
        slope# = (B# - d#) / (a# - c#)
        intercept# = d# - ((B# - d#) / (a# - c#)) * c#
        interp# = slope# * x# + intercept#
    ELSE
        PRINT "interp cannot divide by zero!"
        interp# = 0#
    END IF

END FUNCTION

FUNCTION xs% (xc#)
    ' Remember that for SCREEN 12 X limites are -320 to 320
    ' Convert Cartesian coordinate system to screen coordinates
    'xs = xc + 320

    IF (xc# > 320) THEN
        xs% = 320
    ELSEIF (xc# < -320) THEN
        xs% = -320
    ELSE
        xs% = INT(xc# + 320)
    END IF
END FUNCTION

FUNCTION ys% (yc#)
    ' Remember that for SCREEN 12 Y limits are -240 to 240
    ' Convert Cartesion coordinate system to screen coordinates
    'ys = 240 - yc

    IF (yc# > 240) THEN
        ys% = 240
    ELSEIF (yc# < -240) THEN
        ys% = -240
    ELSE
        ys% = INT(240 - yc#)
    END IF

END FUNCTION
     
      
And here is the final production code for drafting out the bus lines in GPE.
      \\ fanout.gpe
\\ Hardcoded fanout macro to help us finish FDC13SS design layout
\\ Jovan Trujillo
\\ FEDC - Arizona State University 
\\ 12/3/2020

menu
	"fanout2_parta"
	"fanout2_partb"
endmenu

dyadic function y := endpoints INTERP x
	local slope; intercept; a; b; c; d
	a := endpoints[1]
	b := endpoints[2]
	c := endpoints[3]
	d := endpoints[4]
	slope := (b -d)/(a-c)
	intercept := d - slope * c
	y := slope * x + intercept
endsub

niladic procedure fanout2_parta
	local lineCount; arrayPitch1; tabPitch1; arrayX1; arrayY1; tabX1; tabY1; startPoint1; endPoint1; i; endpoints
	local arrayPitch2; tabPitch2; arrayX2; tabX2; arrayY2; tabY2; startPoint2; endPoint2
	
\\ We do the last 62 lines in fanout_partb, and then connect these lines to the actual tab using fanout_partc and fanout_partd
	lineCount := 258 
	arrayPitch1 := 260.0
	tabPitch1 := 80.0

	endpoints := (2618.325;35407.058;23308.41;28964.53)
	
	arrayX1 := -42994.00
	\\arrayY1 := 24190.00-8.0
	arrayY1 := 24182.00
	tabX1 := 3258.325
	tabY1 := endpoints INTERP tabX1

	arrayPitch2 := 80
	tabPitch2 := 80

	arrayX2 := 3258.325
	arrayY2 := endpoints INTERP arrayX2
	tabX2 := 3258.325
	tabY2 := 36407.058

	
	path       ! datatype 6
	layer 14   ! width 20
	pathtype 0 ! straight
	vlayer 14   ! solid

	startPoint1 := arrayX1, arrayY1
	endPoint1 := tabX1, tabY1
	startPoint2 := arrayX2, arrayY2
	endPoint2 := tabX2, tabY2


	for i range (iota(1,lineCount)) do
		ce startPoint1
		ce endPoint1
		ce startPoint2
		ce endPoint2
		put
		arrayX1 := arrayX1 + arrayPitch1
		tabX1 := tabX1 + tabPitch1
		startPoint1 := arrayX1, arrayY1
		tabY1 := endpoints INTERP tabX1
		endPoint1 := tabX1, tabY1
		tabX2 := tabX2 + tabPitch2
		arrayX2 := arrayX2 + arrayPitch2
		arrayY2 := endpoints INTERP arrayX2
		startPoint2 := arrayX2, arrayY2
		endPoint2 := tabX2, tabY2

	enddo
	
	view

endsub	

niladic procedure fanout2_partb
local lineCount; arrayPitch1; tabPitch1; arrayX1; arrayY1; tabX1; tabY1; startPoint1; endPoint1; i; endpoints
local arrayPitch2; tabPitch2; arrayX2; tabX2; arrayY2; tabY2; startPoint2; endPoint2
	
	lineCount := 62
	arrayPitch1 := 260
	tabPitch1 := 80.0
	
	endpoints := (23258.296; 29005.016; 23308.41; 29033.135)

	arrayX1 := 24086.00
	\\arrayY1 := 24190.00 - 8.0
	arrayY1 := 24182.00
	tabX1 := 23898.296
	tabY1 := endpoints INTERP tabX1

	arrayPitch2 := 80
	tabPitch2 := 80

	arrayX2 := 23898.296
	arrayY2 := endpoints INTERP arrayX2
	tabX2 := 23898.325
	tabY2 := 36407.058

	startPoint2 := arrayX2, arrayY2
	endPoint2 := tabX2, tabY2


	
	path       ! datatype 6
	layer 14   ! width 20
	pathtype 0 ! straight
	vlayer 14   ! solid

	startPoint1 := arrayX1, arrayY1
	endPoint1 := tabX1, tabY1

	for i range (iota(1,lineCount)) do
		ce startPoint1
		ce endPoint1
		ce startPoint2
		ce endPoint2
		put
		arrayX1 := arrayX1 + arrayPitch1
		tabX1 := tabX1 + tabPitch1
		startPoint1 := arrayX1, arrayY1
		tabY1 := endpoints INTERP tabX1
		endPoint1 := tabX1, tabY1
		tabX2 := tabX2 + tabPitch2
		arrayX2 := arrayX2 + arrayPitch2
		arrayY2 := endpoints INTERP arrayX2
		startPoint2 := arrayX2, arrayY2
		endPoint2 := tabX2, tabY2
	enddo
	view
endsub	

		
      
Fun stuff. In the future I want to add boundary checking code and some adaptive approach to drawing all those paths so I don't have to think about the geometry. Just give it A and B and the pitch and number of lines and let the code draw the pathways. I'll be using QBasic to help me work all that out as well!

Friday, October 16, 2020

My only use of PureBasic

It was 2015 and I was taking a course on Discrete Event Simulation for my master's degree in computer modeling and simulation. We had a group project and needed to simulate the process flow of an imaginary factory. I though I would implement some of the calculations in PureBASIC  to help me get a taste of the language. It was not too bad. I quickly figured out how to make the procedures, array manipulation, and loops I needed. The final script ended up very useful for the project and I shared it with the rest of the class. I think it's fairly readable even for people who don't know PureBASIC. Here is the little script I wrote long ago.

 Procedure.f sum(Array dataInput(1))
  total.f = 0.0
  For i=0 To ArraySize(dataInput())
    total = total + dataInput(i)
  Next
  ProcedureReturn total
EndProcedure

Procedure.f min(Array dataInput(1))
  min.f = dataInput(0)
  For i=0 To ArraySize(dataInput())
    If dataInput(i) < min
      min = dataInput(i)
    EndIf
  Next
  ProcedureReturn min
EndProcedure

Procedure Main()
  ; myDEBUG = 1 to see more console output
  myDEBUG.l = 0
  ; User interface setup
  OpenConsole()
  EnableGraphicalConsole(1)
  ConsoleLocate(0,0)
  PrintN("makespan calculator started...")
 
  ; Load tool timing data from csv file
  FileName$ = OpenFileRequester("Choose a CSV File", "", "*.csv|*.csv", 0)
 
  If OpenFile(0, FileName$)
    While Not Eof(0)
      line$ = ReadString(0)
      
    Wend
    CloseFile(0)
  EndIf
 
  ;; Calculate makespan for flow shop
  Dim dataTable.f(3,3)
 
  dataTable(0,0) = 2.0
  dataTable(0,1) = 3.5
  dataTable(0,2) = 1.5
  dataTable(0,3) = 2.0
  dataTable(1,0) = 4.5
  dataTable(1,1) = 3.0
  dataTable(1,2) = 2.5
  dataTable(1,3) = 1.0
  dataTable(2,0) = 1.5
  dataTable(2,1) = 1.5
  dataTable(2,2) = 5.0
  dataTable(2,3) = 0.5
  dataTable(3,0) = 4.0
  dataTable(3,1) = 1.0
  dataTable(3,2) = 2.5
  dataTable(3,3) = 0.5
 
  ;; Construct a Gantt chart to show how the makespan is calculated.
  ;; For Example 4.3 from the textbook the desired job sequence is {2,4,1,3}
  NewList jobSeq.l()
  AddElement(jobSeq())
  jobSeq() = 2
  AddElement(jobSeq())
  jobSeq() = 4
  AddElement(jobSeq())
  jobSeq() = 1
  AddElement(jobSeq())
  jobSeq() = 3
 
  PrintN("jobSeq Contents:")
  ForEach jobSeq()
    Print(Str(jobSeq()) + " ")
  Next
  PrintN("")
 
  ResetList(jobSeq())
 
  ;; Now we calculate the makespan using the jobSeq and data from dataTable
  t.f = 0.0
  dt.f = 0.1
  jobsDone.l = 0
  Dim toolTimes.f(3)
  Dim jobAtTool.l(3)
  lastTool.l = 3
 
  ; Initialize arrays
  For i = 0 To ArraySize(toolTimes())
    toolTimes(i) = 0.0
    jobAtTool(i) = 0
  Next
 
  ; Start running the simulation
  While jobsDone < ListSize(jobSeq())
    For i = 0 To ArraySize(toolTimes())
      If i = 0
        ; The first tool will load the next job if idle, and if jobs are available
        ; Make sure the first tool is idle and empty of jobs
        If toolTimes(i) <= 0 And jobAtTool(i) = 0 And NextElement(jobSeq()) <> 0
          jobAtTool(i) = jobSeq()
          toolTimes(i) = dataTable(jobAtTool(i)-1, i)
        EndIf
        
        ; Move time step if there is a job on tool
        If toolTimes(i) > 0
          toolTimes(i) = toolTimes(i) - dt
        Else
          ; do nothing
        EndIf
        
      ElseIf i = ArraySize(toolTimes())
        ; We are in the last tool. Check to see if it has a job and if it is done processing, then we move the job
        ; out and add to jobsDone tally
        If toolTimes(i) <= 0 And jobAtTool(i) <> 0
          jobsDone = jobsDone + 1
          jobAtTool(i) = 0
        EndIf
        
        ; Move previous tools job into current tool if available
        If toolTimes(i-1) <= 0 And jobAtTool(i-1) <> 0 And jobAtTool(i) = 0
          jobAtTool(i) = jobAtTool(i-1)
          jobAtTool(i-1) = 0
          toolTimes(i) = dataTable(jobAtTool(i)-1, i)
        EndIf
      
        ; If there is a job in current tool and there is processing time then move time step forward.
        If toolTimes(i) > 0
          toolTimes(i) = toolTimes(i) - dt
        Else
          ; do nothing
        EndIf
        
      Else
        ; We are after the first tool but before the last
        ; Check if tool is empty but with a job. Then it is done with job.
        ; Check if next tool is empty, if so then move job to next tool.
        ; Check if previous tool is empty. If so then increment time and move on.
        ; Check if previous tool is empty but with a job, then if current tool is empty move job.
        
        ; Move job to next tool if next tool is empty and current tool is done processing
        If jobAtTool(i) <> 0 And jobAtTool(i+1) = 0 And toolTimes(i) <= 0
          jobAtTool(i+1) = jobAtTool(i)
          toolTimes(i+1) = dataTable(jobAtTool(i+1)-1, i)
          jobAtTool(i) = 0
        EndIf
        
        ; Move previous tool's job into current tool if available
        If toolTimes(i-1) <= 0 And jobAtTool(i-1) <> 0 And jobAtTool(i) = 0
          jobAtTool(i) = jobAtTool(i-1)
          toolTimes(i) = dataTable(jobAtTool(i)-1, i)
          jobAtTool(i-1) = 0
        EndIf
        
        ; Increment t and decrement tool's processing time if busy with a job.
        If toolTimes(i) > 0
          toolTimes(i) = toolTimes(i) - dt
        Else
          ; Do nothing
        EndIf
      EndIf
    Next
    
    t = t + dt
    If myDEBUG = 1
      PrintN("t: " + t)
      PrintN("Job Status:")
      For i = 0 To ArraySize(jobAtTool())
        Print(Str(jobAtTool(i)) + " ")
      Next
      PrintN("")
      
      PrintN("jobsDone: " + Str(jobsDone) + " out of " + Str(ListSize(jobSeq())) )
      
      ;PrintN("Tool Times")
      ;For i = 0 To ArraySize(toolTimes())
      ;  Print(Str(toolTimes(i)) + " ")
      ;Next
      ;PrintN("")
      
      ;Delay(500)
    EndIf
    
  Wend
 
  PrintN("makespan: " + t)
  PrintN("Enter key to quit")
  done$ = Input()
  CloseConsole()
  EndProcedure
 
  Main()
 
; IDE Options = PureBasic 5.42 LTS (Windows - x64)
; ExecutableFormat = Console
; CursorPosition = 30
; FirstLine = 15
; Folding = -
; EnableUnicode
; EnableXP

 

Tuesday, May 26, 2020

Composing with Tandy Model 102 BASIC!

I'm making music people. Here is my debut single available now to download:

https://sweetjehosavan.bandzoogle.com/

I am using my Tandy Model 102 to help me transcribe what I created with the guitar to tabs and sheet music. It's helping me make sure I'm getting all the notes written down and that the timing is correct. Here is the source code so far. I'm not done transcribing the song yet.

 1 'WINDY NIGHT BY JOVAN TRUJILLO
5 G1 = 12538 : G2 = 6269 : G3 = 3134 : G4 = 1567 : G5 = 83
10 N1 = 11836 : N2 = 5918 : N3 = 2959 : N4 = 1479 : N5 = 739
20 BPM = 120
30 BPS = BPM / 60
40 NQ = INT(50/BPS)
50 N8 = NQ/2
60 NH = NQ*2
70 NW = NH * 2
80 A1 = 11172 : A2 = 5586 : A3 = 2793 : A4 = 1396 : A5 = 698
90 H1 = 10544 : H2 = 5272 : H3 = 2636 : H4 = 1318 : H5 = 659
100 B1 = 9952 : B2 = 4976 : B3 = 2488 : B4 = 1244 : B5 = 62
110 C1 = 9394 : C2 = 4697 : C3 = 2348 : C4 = 1174 : C5 = 587
119 ' J IS C#
120 J1 = 8866 : J2 = 4433 : J3 = 2216 : J4 = 1108 : J5 = 554
130 D1 = 8368 : D2 = 4184 : D3 = 2092 : D4 = 1046 : D5 = 523
140 K1 = 7900 : K2 = 3950 : K3 = 1975 : K4 = 987 : K5 = 493
150 E1 = 7456 : E2 = 3728 : E3 = 1864 : E4 = 932 : E5 = 466
160 F1 = 7032 : F2 = 3516 : F3 = 1758 : F4 = 879 : F5 = 439
170 M1 = 6642 : M2 = 3321 : M3 = 1660 : M4 = 830 : M5 = 415
190 FOR X = 1 TO 2
200 SOUND B1, NQ
210 SOUND D2, NQ
220 SOUND B1, N8
230 SOUND A1, NQ
240 SOUND J2, NQ
245 IF X=2 THEN SOUND J2, N8
250 SOUND A1, N8
260 SOUND E1, NQ
270 SOUND G2, NQ
280 SOUND E1, N8
290 SOUND A1, N8
300 SOUND J2, N8
310 SOUND H1, N8
320 SOUND J2, N8
400 NEXT X
405 FOR X = 1 TO 2
410 SOUND B1, NQ
420 SOUND D2, NQ
425 SOUND B1, N8
430 SOUND M3, N8
440 SOUND B2, N8
450 SOUND M2, N8
460 SOUND B1, N8
470 SOUND A1, NQ
480 SOUND J2, NQ
485 SOUND A1, N8
490 SOUND M3, N8
500 SOUND B2, N8
510 SOUND M2, N8
520 SOUND A1, N8
530 SOUND E1, NQ
540 SOUND G2,NQ
545 SOUND G1, N8
550 SOUND M3, N8
560 SOUND B2, N8
570 SOUND M2, N8
580 SOUND A1, NQ
590 SOUND J2, NQ
600 SOUND M3, NH
610 SOUND B1, NQ
620 SOUND D2, N8
630 SOUND B1, N8
640 SOUND B3, N8
650 SOUND B2, N8
660 SOUND M2, N8
670 SOUND B1, N8
680 SOUND A1, NQ
690 SOUND J2, NQ
700 SOUND A1, N8
710 SOUND A3, N8
720 SOUND B2, N8
730 SOUND M2, N8
740 SOUND A1, N8
750 SOUND E1, NQ
760 SOUND G2, NQ
770 SOUND G1, N8
780 SOUND G3, N8
790 SOUND B2, N8
800 SOUND M2, N8
810 SOUND G1, N8
820 SOUND A3, NQ
830 SOUND A3, N8
840 SOUND A3, N8
850 SOUND A3, N8
860 SOUND G3, N8
870 SOUND M3, N8
880 SOUND D2, NQ
890 SOUND B1, NQ
900 SOUND B1, NQ
910 SOUND D2, NQ
915 SOUND B1, N8
920 SOUND B3, N8
930 SOUND M3, N8
935 SOUND B1, N8
940 SOUND A1, NQ
950 SOUND J2, NQ
955 SOUND A1, N8
960 SOUND A3, N8
970 SOUND M3, N8
980 SOUND A1, N8
990 SOUND E1, NQ
1000 SOUND G2, NQ
1010 SOUND G1, N8
1020 SOUND G3, N8
1030 SOUND M3, N8
1035 SOUND A3, NQ
1040 FOR Y = 1 TO 3
1050 SOUND A3, N8
1060 NEXT Y
1070 SOUND G3, N8
1080 SOUND M3, N8
1090 SOUND D2, N8
1100 SOUND B2, N8
1110 SOUND B1, NQ
1120 REM I'm Halfway through this song now! - 5/14/2020