Advertisement
sumguytwitches

chatgpt plays kos

May 5th, 2023
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. set tempo to 120. // adjust tempo as desired
  2. set rootnote to 55. // adjust root note as desired
  3.  
  4. // define notes
  5. set n0 to rootnote.
  6. set n1 to n0 + 2.
  7. set n2 to n1 + 2.
  8. set n3 to n2 + 1.
  9. set n4 to n3 + 2.
  10. set n5 to n4 + 2.
  11. set n6 to n5 + 1.
  12.  
  13. // define durations
  14. set d1 to 1 / 16. // sixteenth note
  15. set d2 to 2 * d1 // eighth note
  16. set d4 to 2 * d2 // quarter note
  17. set d8 to 2 * d4 // half note
  18.  
  19. // define melody
  20. set melody to list(n0, n1, n2, n3, n4, n5, n6, n5, n4, n3, n2, n1).
  21.  
  22. // define durations for melody
  23. set durations to list(d4, d8, d8, d4, d8, d8, d2, d2, d2, d2, d2, d2).
  24.  
  25. // play melody
  26. for i in range(0, length(melody) - 1) {
  27. skid:play(1, melody[i], durations[i] * tempo).
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement