コード例 #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, '}'
コード例 #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')
コード例 #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, '}'
コード例 #4
0
ファイル: mpdutils.py プロジェクト: PauloJava2016/Solfege
def int_to_user_octave_notename(i):
    return MusicalPitch.new_from_int(i).get_user_octave_notename()
コード例 #5
0
 def test_add_interval_fail(self):
     n = MusicalPitch.new_from_int(120)
     i = Interval("M10")
     self.assertRaises(ValueError, lambda: n + i)
コード例 #6
0
 def test_add_integer_fail(self):
     n = MusicalPitch.new_from_int(120)
     self.assertRaises(ValueError, lambda: n + 20)
コード例 #7
0
ファイル: mpdutils.py プロジェクト: gitGNU/gnu_solfege
def int_to_user_octave_notename(i):
    return MusicalPitch.new_from_int(i).get_user_octave_notename()
コード例 #8
0
 def test_add_interval_fail(self):
     n = MusicalPitch.new_from_int(120)
     i = Interval("M10")
     self.assertRaises(ValueError, lambda: n + i)
コード例 #9
0
 def test_add_integer_fail(self):
     n = MusicalPitch.new_from_int(120)
     self.assertRaises(ValueError, lambda: n + 20)