Scheme playground.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

29 lines
736 B

  1. ;;; An example file to demonstrate/test the
  2. ;;; audio functionality of Interscheme.
  3. ;; Play a wav file when the program starts.
  4. (play-wav-file "Test.wav" 0)
  5. ;; Play the wav file AND loop forever:
  6. ;;(play-wav-file "Test.wav" -1)
  7. ;; We define a single bool that acts as a switch.
  8. ;; Once the audio plays once, turn the switch off.
  9. ;; This lets the program know we don't want to loop forever.
  10. (define play-sound1? #t)
  11. ;; Define a function that plays 3 tones
  12. (define (sound1)
  13. (display "Playing sound1\n")
  14. (generate-tone 440.0 0.4)
  15. (generate-tone 700.0 0.5)
  16. (generate-tone 440.0 0.4)
  17. (set! play-sound1? #f))
  18. (define (main)
  19. ;; (display "main\n")
  20. ;; (pixel-rect 32 32 128 128 #xffffff)
  21. ;;
  22. (if play-sound1?
  23. (sound1)))