import time
import board
import audiobusio
import audiomixer
from cedargrove_chime import Chime, Scale

# Instantiate chime synthesizer
audio_output = audiobusio.I2SOut(bit_clock=board.D12, word_select=board.D9, data=board.D6)
mixer = audiomixer.Mixer(sample_rate=11020, buffer_size=4096, voice_count=1, channel_count=1)
audio_output.play(mixer)
mixer.voice[0].level = 0.8

chime = Chime(mixer.voice[0], scale=Scale.HarryDavidPear)

# Sequentially play all the notes in the scale
for index, note in enumerate(chime.scale):
    chime.strike(note, 1)
    time.sleep(0.4)
time.sleep(1)