| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
(require 'czech) |
| 29 |
|
| 30 |
|
| 31 |
(define (czech-unisyn-dirname name) |
| 32 |
(substring name 0 (- (length name) (+ 1 (length (basename name)))))) |
| 33 |
|
| 34 |
(define (czech-unisyn-db-init name index-file) |
| 35 |
(if (not (member name (us_list_dbs))) |
| 36 |
(let ((lpc-dir (path-append (czech-unisyn-dirname |
| 37 |
(czech-unisyn-dirname index-file)) |
| 38 |
"lpc"))) |
| 39 |
(us_diphone_init |
| 40 |
(list (list 'name name) |
| 41 |
(list 'index_file index-file) |
| 42 |
(list 'grouped "false") |
| 43 |
(list 'coef_dir lpc-dir) |
| 44 |
(list 'sig_dir lpc-dir) |
| 45 |
(list 'coef_ext ".lpc") |
| 46 |
(list 'sig_ext ".res") |
| 47 |
(list 'default_diphone "#-#")))))) |
| 48 |
|
| 49 |
(define (czech-unisyn-group-db-init name group-file) |
| 50 |
(if (not (member name (us_list_dbs))) |
| 51 |
(us_diphone_init |
| 52 |
(list (list 'name name) |
| 53 |
(list 'index_file group-file) |
| 54 |
(list 'grouped "true") |
| 55 |
(list 'default_diphone "#-#"))))) |
| 56 |
|
| 57 |
(define (czech-unisyn-param-init) |
| 58 |
(set! us_abs_offset 0.0) |
| 59 |
(set! window_factor 1.0) |
| 60 |
(set! us_rel_offset 0.0) |
| 61 |
(set! us_gain 0.9) |
| 62 |
(Parameter.set 'us_sigpr 'lpc)) |
| 63 |
|
| 64 |
(define (czech-unisyn-init name index-file) |
| 65 |
((if (string-matches index-file ".*\.group$") |
| 66 |
czech-unisyn-group-db-init |
| 67 |
czech-unisyn-db-init) |
| 68 |
name index-file) |
| 69 |
(czech-unisyn-param-init) |
| 70 |
(us_db_select name)) |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
(provide 'czech-unisyn) |