OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 | 2 |
3 | 3 |
4 | 4 |
5 import inspect | 5 import inspect |
6 import sys | 6 import sys |
7 import re | 7 import re |
8 import math | 8 import math |
9 import lilylib as ly | 9 import lilylib as ly |
10 import warnings | 10 import warnings |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 def pitch_general (pitch): | 315 def pitch_general (pitch): |
316 str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'b'], ['es', 'eh'
, 'ih', 'is']) | 316 str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'b'], ['es', 'eh'
, 'ih', 'is']) |
317 return str.replace ('aes', 'as').replace ('ees', 'es') | 317 return str.replace ('aes', 'as').replace ('ees', 'es') |
318 | 318 |
319 def pitch_nederlands (pitch): | 319 def pitch_nederlands (pitch): |
320 return pitch_general (pitch) | 320 return pitch_general (pitch) |
321 | 321 |
322 def pitch_english (pitch): | 322 def pitch_english (pitch): |
323 str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'b'], ['f', 'qf',
'qs', 's']) | 323 str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'b'], ['f', 'qf',
'qs', 's']) |
324 return str.replace ('aes', 'as').replace ('ees', 'es') | 324 return str[0] + str[1:].replace ('fqf', 'tqf').replace ('sqs', 'tqs') |
325 | 325 |
326 def pitch_deutsch (pitch): | 326 def pitch_deutsch (pitch): |
327 str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'h'], ['es', 'eh'
, 'ih', 'is']) | 327 str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'h'], ['es', 'eh'
, 'ih', 'is']) |
328 return str.replace ('hes', 'b').replace ('aes', 'as').replace ('ees', 'es') | 328 if str == 'hes': |
| 329 return 'b' |
| 330 return str.replace ('aes', 'as').replace ('ase', 'asa').replace ('ees', 'es'
) |
329 | 331 |
330 def pitch_norsk (pitch): | 332 def pitch_norsk (pitch): |
331 return pitch_deutsch (pitch) | 333 return pitch_deutsch (pitch) |
332 | 334 |
333 def pitch_svenska (pitch): | 335 def pitch_svenska (pitch): |
334 str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'h'], ['ess', Non
e, None, 'iss']) | 336 str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'h'], ['ess', Non
e, None, 'iss']) |
335 return str.replace ('hess', 'b').replace ('aes', 'as').replace ('ees', 'es') | 337 return str.replace ('hess', 'b').replace ('aes', 'as').replace ('ees', 'es') |
336 | 338 |
337 def pitch_italiano (pitch): | 339 def pitch_italiano (pitch): |
338 str = pitch_generic (pitch, ['do', 're', 'mi', 'fa', 'sol', 'la', 'si'], ['b
', 'sb', 'sd', 'd']) | 340 str = pitch_generic (pitch, ['do', 're', 'mi', 'fa', 'sol', 'la', 'si'], ['b
', 'sb', 'sd', 'd']) |
(...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2502 expr = test_expr() | 2504 expr = test_expr() |
2503 expr.set_start (Rational (0)) | 2505 expr.set_start (Rational (0)) |
2504 print(expr.ly_expression()) | 2506 print(expr.ly_expression()) |
2505 start = Rational (0, 4) | 2507 start = Rational (0, 4) |
2506 stop = Rational (4, 2) | 2508 stop = Rational (4, 2) |
2507 def sub(x, start=start, stop=stop): | 2509 def sub(x, start=start, stop=stop): |
2508 ok = x.start >= start and x.start + x.get_length() <= stop | 2510 ok = x.start >= start and x.start + x.get_length() <= stop |
2509 return ok | 2511 return ok |
2510 | 2512 |
2511 print(expr.lisp_sub_expression(sub)) | 2513 print(expr.lisp_sub_expression(sub)) |
OLD | NEW |