home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / gwbasic / guitar / fretscls.bas next >
Encoding:
BASIC Source File  |  1991-05-22  |  1.2 KB  |  47 lines

  1. 90      DIM X(45)
  2. 100     REM
  3. 110     REM GET THE FRET CONSTANT
  4. 120     REM
  5. 130     K = 17.818
  6. 140     PRINT "fret constant is "; K; ", is this ok";
  7. 150     INPUT A$
  8. 160     IF ((A$ = "y") OR (A$ = "yes") OR (A$ = "Y") OR (A$ = "YES")) THEN GOTO 210
  9. 170     INPUT "what constant would you like"; K
  10. 180     IF ABS(K - 17.818) <= .3 THEN GOTO 210
  11. 190     PRINT "invalid constant"
  12. 200     GOTO 170
  13. 210     REM
  14. 220     REM  get number of frets
  15. 230     REM
  16. 240     INPUT "how many frets"; F
  17. 250     IF ((F >= 12) AND (F <= 45)) THEN GOTO 280
  18. 260     PRINT "dumb number of frets"
  19. 270     GOTO 240
  20. 280     F = F + 1
  21. 290     REM
  22. 300     REM
  23. 310     INPUT "what is the scale length"; S
  24. 320     IF ((S >= 9) AND (S <= 40)) THEN GOTO 350
  25. 330     PRINT "don't be ridiculous"
  26. 340     GOTO 310
  27. 350     REM
  28. 360     REM calculate the fret positions
  29. 370     REM
  30. 380     PRINT
  31. 390     PRINT
  32. 400     X(0) = 0
  33. 420     FOR I = 1 TO F
  34. 430       X(I) = (S - X(I - 1)) / K + X(I - 1)
  35. 440     NEXT I
  36. 445     F$ = "fret ## ##.##     "
  37. 450     N = F - INT(F / 2)
  38. 460     FOR I = 1 TO N
  39. 470       PRINT USING F$; I; X(I);
  40. 480       IF I + N <= F THEN PRINT USING F$; I + N; X(I + N);
  41. 490       PRINT
  42. 500     NEXT I
  43. 510     PRINT
  44. 520     PRINT
  45. 530     END
  46.  
  47.