# Path: pgzero/tone.py
# def sine_array_onecycle(hz):
#     """Returns a single sin wave for a given frequency."""
#     length = SAMPLE_RATE / hz
#     omega = np.pi * 2 / length
#     xvalues = np.arange(int(length)) * omega
#     return (np.sin(xvalues) * (2 ** 15)).astype(np.int16)
# 
# def note_value(note, accidental, octave):
#     value = NOTE_VALUE[note]
#     if accidental:
#         value += 1 if accidental == '#' else -1
#     return (4 - octave) * -12 + value


from unittest import TestCase
from pgzero.tone import sine_array_onecycle, note_value
from tone import note_to_hertz, validate_note, InvalidNote
import numpy
import re




TEST_NOTES = {
    'A4': dict(val = 0, hertz = 440, parts = ('A', '', 4)),
    'C4': dict(val = -9, hertz = 261.63, parts = ('C', '', 4)),
    'C0': dict(val = -57, hertz = 16.35, parts = ('C', '', 0)),
    'B8': dict(val = 50, hertz = 7902.13, parts = ('B', '', 8)),
    'A#4': dict(val = 1, hertz = 466.16, parts = ('A', '#', 4)),
    'Ab4': dict(val = -1, hertz = 415.30, parts = ('A', 'b', 4)),
    'Bb4': dict(val = 1, hertz = 466.16, parts = ('B', 'b', 4)),
}

class ToneTest(TestCase):
    def test_sine_array(self):
        numpy.allclose(

# Path: pgzero/tone.py
# def sine_array_onecycle(hz):
#     """Returns a single sin wave for a given frequency."""
#     length = SAMPLE_RATE / hz
#     omega = np.pi * 2 / length
#     xvalues = np.arange(int(length)) * omega
#     return (np.sin(xvalues) * (2 ** 15)).astype(np.int16)
# 
# def note_value(note, accidental, octave):
#     value = NOTE_VALUE[note]
#     if accidental:
#         value += 1 if accidental == '#' else -1
#     return (4 - octave) * -12 + value


# Path: test/test_tone.py
from unittest import TestCase
from pgzero.tone import sine_array_onecycle, note_value
from tone import note_to_hertz, validate_note, InvalidNote
import numpy
import re





TEST_NOTES = {
    'A4': dict(val = 0, hertz = 440, parts = ('A', '', 4)),
    'C4': dict(val = -9, hertz = 261.63, parts = ('C', '', 4)),
    'C0': dict(val = -57, hertz = 16.35, parts = ('C', '', 0)),
    'B8': dict(val = 50, hertz = 7902.13, parts = ('B', '', 8)),
    'A#4': dict(val = 1, hertz = 466.16, parts = ('A', '#', 4)),
    'Ab4': dict(val = -1, hertz = 415.30, parts = ('A', 'b', 4)),
    'Bb4': dict(val = 1, hertz = 466.16, parts = ('B', 'b', 4)),
}

class ToneTest(TestCase):
    def test_sine_array(self):
        numpy.allclose(

            sine_array_onecycle(2205),