Exercise - Playing music
Your work
Play the Happy Birthday song. Copy-paste notes and then write the code
notes:={261,0,261,294,261,349,330,0,261,0,261,294,261,392,349,0,261,0,261,523,440,348,349,330,294,0,465,466,440,349,392, 349,0}
durations:={12,1,12,8,8,8,4,16,1,12,12,8,8,8,4,16,16,16,8,8,16,1,16,16,8,4,16,16,8,8,8,4,4}/42
You may need
- For statements
- Selecting note from the list using notes[i] if i is the index (and durations[i])
- Counting amount of elements using dim(notes)
Solutions