Skip to content

Instantly share code, notes, and snippets.

@TedThompson
Created September 20, 2018 01:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TedThompson/f24afa324949bee61114ac22e1bf6df2 to your computer and use it in GitHub Desktop.
Save TedThompson/f24afa324949bee61114ac22e1bf6df2 to your computer and use it in GitHub Desktop.
Apple //e Applesoft BASIC Music to play the opening melody of the Star Trek theme.
100 DIM SC(10)
110 PLAY = 768
120 DATA 160,100,169,1,133,250,174,3,3,228,250,208,3,173,48,192,202,208,246,173,48,192,136,240,7,198,250,208,233,76,2,3,96
130 REM
140 REM 233,220,208,195,184,175,164,154,146,137,129,122,114,108
150 REM G G# A A# B C C# D D# E F F# G G#
160 REM
170 FOR I = 0 TO 32
180 READ V: POKE PLAY + I,V: NEXT
190 POKE 769,200: REM 769 IS DURATION; 771 IS PITCH
200 POKE 771,233: CALL PLAY: CALL PLAY
210 POKE 771,175: CALL PLAY
220 POKE 771,129: CALL PLAY: CALL PLAY: CALL PLAY: CALL PLAY: CALL PLAY: CALL PLAY
230 FOR I = 1 TO 100: NEXT
240 POKE 771,137: CALL PLAY: CALL PLAY
250 POKE 771,175: CALL PLAY
260 POKE 771,208: CALL PLAY
270 POKE 771,154: CALL PLAY
280 POKE 771,114: CALL PLAY: CALL PLAY: CALL PLAY: CALL PLAY: CALL PLAY: CALL PLAY
@Cynicide
Copy link

Thanks for this, my cousin and I grew up playing Apple ][e and it's his birthday today. I was able to mod your code to play Happy Birthday and send him a video.

@TedThompson
Copy link
Author

Awesome! Im glad you found a use for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment