Ejemplo n.º 1
0
def question(f, b, c):
    low = 60
    tone_a = MusicalPitch.new_from_int(low)
    tone_b = MusicalPitch.new_from_int(low + b)
    tone_c = MusicalPitch.new_from_int(low + c)
    print >> f, 'question {'
    print >> f, '  question_text = _("Sing the three tones")'
    print >> f, '  music = voice("< %s2 %s %s >")' % (
        (tone_a.get_octave_notename(), tone_b.get_octave_notename(),
         tone_c.get_octave_notename()))
    print >> f, '  answer = voice("%s8 %s %s")' % (
        (tone_a.get_octave_notename(), tone_b.get_octave_notename(),
         tone_c.get_octave_notename()))
    print >> f, '}'
Ejemplo n.º 2
0
def question(f, b, c):
    low = 60
    tone_a = MusicalPitch.new_from_int(low)
    tone_b = MusicalPitch.new_from_int(low + b)
    tone_c = MusicalPitch.new_from_int(low + c)
    f.write('question {\n')
    f.write('  question_text = _("Sing the three tones")\n')
    f.write('  music = voice("< %s2 %s %s >")\n' % (
        (tone_a.get_octave_notename(),
         tone_b.get_octave_notename(),
         tone_c.get_octave_notename())))
    f.write('  answer = voice("%s8 %s %s")\n' % (
        (tone_a.get_octave_notename(),
         tone_b.get_octave_notename(),
         tone_c.get_octave_notename())))
    f.write('}\n')
Ejemplo n.º 3
0
def question(f, b, c):
    low = 60
    tone_a = MusicalPitch.new_from_int(low)
    tone_b = MusicalPitch.new_from_int(low + b)
    tone_c = MusicalPitch.new_from_int(low + c)
    print >> f, 'question {'
    print >> f, '  question_text = _("Sing the three tones")'
    print >> f, '  music = voice("< %s2 %s %s >")' % (
        (tone_a.get_octave_notename(),
         tone_b.get_octave_notename(),
         tone_c.get_octave_notename()))
    print >> f, '  answer = voice("%s8 %s %s")' % (
        (tone_a.get_octave_notename(),
         tone_b.get_octave_notename(),
         tone_c.get_octave_notename()))
    print >> f, '}'
Ejemplo n.º 4
0
def int_to_user_octave_notename(i):
    return MusicalPitch.new_from_int(i).get_user_octave_notename()
Ejemplo n.º 5
0
 def test_add_interval_fail(self):
     n = MusicalPitch.new_from_int(120)
     i = Interval("M10")
     self.assertRaises(ValueError, lambda: n + i)
Ejemplo n.º 6
0
 def test_add_integer_fail(self):
     n = MusicalPitch.new_from_int(120)
     self.assertRaises(ValueError, lambda: n + 20)
Ejemplo n.º 7
0
def int_to_user_octave_notename(i):
    return MusicalPitch.new_from_int(i).get_user_octave_notename()
Ejemplo n.º 8
0
 def test_add_interval_fail(self):
     n = MusicalPitch.new_from_int(120)
     i = Interval("M10")
     self.assertRaises(ValueError, lambda: n + i)
Ejemplo n.º 9
0
 def test_add_integer_fail(self):
     n = MusicalPitch.new_from_int(120)
     self.assertRaises(ValueError, lambda: n + 20)