Music Player

Date: 198x
Type: Program
Platform(s): TS 2068

Type in music as a line of letters and numbers; plays the composition.

Appears on

Library tape of the Indiana Sinclair Timex User’s Group.

Gallery

Music Player

Source Code

    5 GO TO 1000
   10 INPUT "What speed? 1 is slow, 5 is fast";x
   20 REM MUSIC PLAYER
   30 DIM X(50): DIM Y(50)
   40 LET K=0: LET L=1
   50 BORDER 2: PAPER 4: INK 9: CLS 
   60 PRINT AT 0,10; INVERSE 1;"MUSIC PLAYER"''
   70 PRINT "TYPE IN YOUR MUSIC AS A LINE OF LETTERS AND NUMBERS."
   80 PRINT ''"PUT NOTES AS LETTERS FOLLOWED BY THEIR LENGTH IN BEATS"
   90 PRINT ''"YOU  HAVE TWO OCTAVES.THE LOWER ONE IS FROM A TO G AND THE UPPER FROM a TO c."
  100 INPUT N$
  110 FOR A=1 TO LEN N$ STEP 2
  120 IF CODE N$(A)<97 THEN GO TO 290
  130 IF N$(A)="a" THEN LET K=-0.5
  140 IF N$(A)="d" THEN LET K=0.5
  150 IF N$(A)="e" THEN LET K=1
  160 IF N$(A)="f" THEN LET K=1
  170 IF N$(A)="g" THEN LET K=1.5
  180 LET Y(L)=(CODE N$(A)-87)+(2*K)
  190 LET L=L+1
  200 LET K=0
  210 NEXT A
  220 LET L=1
  230 FOR T=2 TO LEN N$ STEP 2
  240 LET X(L)=VAL N$(T)/2
  250 LET L=L+1
  260 NEXT T
  270 GO TO 370
  280 STOP 
  290 IF N$(A)="A" THEN LET K=-0.5
  300 IF N$(A)="B" THEN LET K=-0.5
  310 IF N$(A)="F" THEN LET K=0.5
  320 IF N$(A)="G" THEN LET K=0.5
  330 LET Y(L)=(CODE N$(A)-67-K)*2
  340 LET K=0
  350 LET L=L+1
  360 GO TO 210
  370 FOR Z=1 TO LEN N$/2
  380 BEEP X(Z)/2,Y(Z)
  390 NEXT Z
  400 PRINT #1,"Press any key": PAUSE NOT PI: RUN 
  500 CLS : GO SUB 580
  510 LET n$="q2w3er5t6y7ui9o0p"
  520 DIM a(256)
  530 FOR j=1 TO 17: LET a(CODE n$(j)+1)=j
  540 NEXT j
  550 LET i=CODE INKEY$+1
  560 IF a(i) THEN BEEP .5,a(i)-1
  570 GO TO 550
  590 PRINT '"    2  3     5  6  7     9  0": PRINT 
  610 PRINT "\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::D#\::E#\::\::\::\::G#\::A#\::B#\::\::\::\::D#\::E#\::\::"
  620 PRINT "\::\::\::\::__\::__\::\::\::\::__\::__\::__\::\::\::\::__\::__\::\::"
  650 PRINT "\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::C \::D \::E \::F \::G \::A \::B \::C \::D \::E \::"
  660 PRINT "\::\::__\::__\::__\::__\::__\::__\::__\::__\::__\::__\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::"
  680 PRINT : PRINT "  Q  W  E  R  T  Y  U  I  O  P"
  690 PRINT AT 15,2;"USE THE TOP TWO ROWS OF KEYS"
  700 RETURN 
 1000 BORDER 7: PAPER 7: INK 9: CLS 
 1010 PRINT 'TAB 9;"Piano Simulations"''''"      1  Write a tune"''"      2  Play the Keys"''"      3  Parakeet"
 1020 INPUT "Select 1, 2, 3,   ";x: IF x=1 THEN GO TO 10
 1030 IF x=2 THEN GO TO 500
 1035 IF x=3 THEN GO TO 1500
 1040 GO TO 1020
 1500 SOUND 7,62;8,16;9,0;10,0
 1510 FOR I=INT (RND*75)+25 TO INT (RND*75)+20 STEP INT (RND*4)*2-5
 1520 SOUND 0,I;11,32;12,100;13,2
 1530 NEXT I
 1540 SOUND 12,1;13,0
 1550 IF INT (RND*2)=1 THEN PAUSE INT ((RND*60)+1)
 1560 IF INT (RND*4)<>1 THEN RUN 1500
 1570 FOR J=RND*1 TO RND*10
 1580 FOR K=0 TO INT (RND*4)
 1590 NEXT K
 1600 SOUND 6,16;7,7;8,16;9,16;10,16;11,300+INT (RND*10);12,INT (((RND*2)+.5)/2);13,INT (RND*2)*8
 1610 FOR K=0 TO INT (RND*10)
 1620 NEXT K
 1630 SOUND 7,63;8,0;9,0;10,0
 1640 NEXT j: RUN 1500
 2000 SAVE "3 Musics" LINE 1

People

No people associated with this content.

Scroll to Top