Listing 1. RandomNotes Deck ************* * Deck "RandomNotes" * Time 21:03:50 * Date 05/15/94 ************* ************* * Card(s) in deck. * Card "DMCard" ************* * 1 Card(s), 1 were printed. ************* ************* * Natural order of Cards * Card "DMCard" ************* ************* * Global Routine(s) in deck. * Routine "ShowKey" * Routine "ShowTime" ************* * 2 Global routines(s), 2 were printed. ************* ************* * Card "DMCard" BeforeAttachment ; used to be OnStartup Nop ; Speak to DMusic - Load it if not in memory SpeakTo "DMUSIC" IfError Dos "run >nil: Beats Let CurNoteBeat=CurNoteBeat*2 EndLoop Nop ; Insert the note and go to next position SendMessage "INSERTITEM NOTE DURATION "||CurNoteBeat||" LINE "||Line SendMessage "NEXT NOTE" Nop ; Update the number of current beats in the song and Nop ; the current measure Let NumBeats=NumBeats+NoteBeat/CurNoteBeat Let NumBeatsMeasure=NumBeatsMeasure+NoteBeat/CurNoteBeat Nop ; Go to next measure if current one full If NumBeatsMeasure>=Beats SendMessage "NEXT MEASURE" Let NumBeats=Integer(NumBeats) Let NumBeatsMeasure=0 EndIf EndLoop Nop ; Unlock the display, activate song window, Nop ; update the display, and go to the first measure SendMessage "UNLOCKGUI" SendMessage "UNLOCKDISPLAY" SendMessage "WINDOW DOCUMENT ACTIVATE" SendMessage "UPDATEDISPLAY" SendMessage "POSITION SOF" EndScript EndObject TextButton "Play" Definition Origin 536,48 Font "topaz",8 ; FontName, PointSize PrintStyle SHADOW ,2,3 ; Style, Pen1, Pen2 TextColors 1,0,NORMAL ; PenA, PenB, DrawMode Text " Play " Border BEVEL ,2,1 ; BorderStyle, MainPen, ExtraPen Highlight COMPLEMENT ButtonFlags NONE EndScript OnRelease Nop ; Activate the song window and play song SendMessage "WINDOW DOCUMENT ACTIVATE" SendMessage "PLAY" EndScript EndObject TextButton "Stop" Definition Origin 536,72 Font "topaz",8 ; FontName, PointSize PrintStyle SHADOW ,2,3 ; Style, Pen1, Pen2 TextColors 1,0,NORMAL ; PenA, PenB, DrawMode Text " Stop " Border BEVEL ,2,1 ; BorderStyle, MainPen, ExtraPen Highlight COMPLEMENT ButtonFlags NONE EndScript OnRelease Nop ; Stop playing the song SendMessage "STOP" EndScript EndObject ImageButton "BeatsLeft" Definition Origin 110,60 Image "RCF:CanDo2.51/Brushes/Left.br" Highlight COMPLEMENT ButtonFlags NONE EndScript OnClick Nop ; Change beats while pressing button Nop ; Do not allow value below 1 Loop Let Beats=Max(Beats-1,1) Do "ShowTime" Delay 0,0,10 Until ObjectState("BeatsLeft")=OFF EndScript EndObject ImageButton "BeatsRight" Definition Origin 132,60 Image "RCF:CanDo2.51/Brushes/Right.br" Highlight COMPLEMENT ButtonFlags NONE EndScript OnClick Nop ; Change beats while pressing button Nop ; Do not allow value above 16 Loop Let Beats=Min(Beats+1,16) Do "ShowTime" Delay 0,0,10 Until ObjectState("BeatsRight")=OFF EndScript EndObject ImageButton "NoteBeatLeft" Definition Origin 110,72 Image "RCF:CanDo2.51/Brushes/Left.br" Highlight COMPLEMENT ButtonFlags NONE EndScript OnClick Nop ; Change beats while pressing button Nop ; Do not allow value below 1 Loop Let NoteBeat=Max(NoteBeat/2,1) Do "ShowTime" Delay 0,0,10 Until ObjectState("NoteBeatLeft")=OFF EndScript EndObject ImageButton "NoteBeatRight" Definition Origin 132,72 Image "RCF:CanDo2.51/Brushes/Right.br" Highlight COMPLEMENT ButtonFlags NONE EndScript OnClick Nop ; Change beats while pressing button Nop ; Do not allow value above 64 Loop Let NoteBeat=Min(NoteBeat*2,64) Do "ShowTime" Delay 0,0,10 Until ObjectState("NoteBeatRight")=OFF EndScript EndObject * End of Card "DMCard" ************* ************* * Global routine "ShowKey" Nop ; Set font and style SetPrintFont "topaz",8 SetPrintStyle PLAIN ,2,3 SetPen 1,0 SetDrawMode JAM2 Nop ; Erase current key in rollo button PrintText " ",83,28 Nop ; Print the new key based on current index PrintText KeyText[KeyTextIndex],83,28 * End of routine "ShowKey" ************* ************* * Global routine "ShowTime" Nop ; Show the music staff brush ShowBrush "ClippedBrush",79,61 Nop ; Set font and style SetPrintFont "topaz",9 SetPrintStyle BOLD OUTLINE ,2,3 SetPen 1,0 SetDrawMode JAM1 Nop ; Print the top and bottom number of time signature Nop ; Note the different position if number is two digits PrintText Beats,83-4*(Beats>=10),62 PrintText NoteBeat,83-4*(NoteBeat>=10),72 * End of routine "ShowTime" *************