Debian Codegraph @

festival/lib/upc_catalan/upc_ca_generic_f0model.scm

raw
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;;; ;;;
3 ;;; Carnegie Mellon University ;;;
4 ;;; and Alan W Black and Kevin Lenzo ;;;
5 ;;; Copyright (c) 1998-2000 ;;;
6 ;;; All Rights Reserved. ;;;
7 ;;; ;;;
8 ;;; Permission is hereby granted, free of charge, to use and distribute ;;;
9 ;;; this software and its documentation without restriction, including ;;;
10 ;;; without limitation the rights to use, copy, modify, merge, publish, ;;;
11 ;;; distribute, sublicense, and/or sell copies of this work, and to ;;;
12 ;;; permit persons to whom this work is furnished to do so, subject to ;;;
13 ;;; the following conditions: ;;;
14 ;;; 1. The code must retain the above copyright notice, this list of ;;;
15 ;;; conditions and the following disclaimer. ;;;
16 ;;; 2. Any modifications must be clearly marked as such. ;;;
17 ;;; 3. Original authors' names are not deleted. ;;;
18 ;;; 4. The authors' names are not used to endorse or promote products ;;;
19 ;;; derived from this software without specific prior written ;;;
20 ;;; permission. ;;;
21 ;;; ;;;
22 ;;; CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK ;;;
23 ;;; DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ;;;
24 ;;; ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT ;;;
25 ;;; SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE ;;;
26 ;;; FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ;;;
27 ;;; WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ;;;
28 ;;; AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ;;;
29 ;;; ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF ;;;
30 ;;; THIS SOFTWARE. ;;;
31 ;;; ;;;
32 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
33 ;;;
34 ;;; F0 model for upc_ca
35 ;;;
36
37 ;;; Load any necessary files here
38
39 (set! upc_ca_generic_int_lr_params
40 '(
41 ;; These numbers may be modified the speakers range.
42 (target_f0_mean 105) ;; speaker's mean F0
43 (target_f0_std 14) ;; speaker's range
44 ;; These number should remain as they are
45 (model_f0_mean 170)
46 (model_f0_std 34))
47 )
48
49 (define (upc_ca_generic_targ_func1 utt syl)
50 "(upc_ca_generic_targ_func1 utt syl)
51 Simple hat accents."
52 (let ((start (item.feat syl 'syllable_start))
53 (end (item.feat syl 'syllable_end))
54 (ulen (item.feat (utt.relation.last utt 'Segment ) 'segment_end))
55 nstart nend fustart fuend fuend fstart fend)
56 (set! nstart (/ start ulen))
57 (set! nend (/ end ulen))
58 (set! fustart '130)
59 (set! fuend '110)
60 (set! fstart (+ (* (- fuend fustart) nstart) fustart))
61 (set! fend (+ (* (- fuend fustart) nend) fustart))
62
63 (cond
64 ((equal? (item.feat syl "R:Intonation.daughter1.name") "Accented")
65 (list
66 (list start fstart)
67 (list (+ start 0.010) (+ fstart 10 ))
68 (list (- end 0.010) (+ fstart 8 ))
69 (list end fend)
70 ))
71 ((not (item.next syl))
72 (list
73 (list end fuend)))
74 ((not (item.prev syl))
75 (list
76 (list start fustart)))
77 (t
78 nil)))
79 )
80
81 (define (upc_ca_generic::select_f0model)
82 "(upc_ca_generic::select_f0model)
83 Set up the F0 model for upc_ca."
84
85 (Param.set 'Int_Method 'General)
86 (set! int_general_params (list (list 'targ_func upc_ca_generic_targ_func1)))
87
88 ; (set! F0start_tree upc_ca_generic::start_f0)
89 ; (set! F0mid_tree upc_ca_generic::mid_f0)
90 ; (set! F0end_tree upc_ca_generic::end_f0)
91 ; (set! int_params
92 ; '((target_f0_mean 140) (target_f0_std 44)
93 ; (model_f0_mean 140) (model_f0_std 44)))
94 ; (Param.set 'Int_Target_Method Int_Targets_Tree)
95 )
96
97 (define (upc_ca_generic::reset_f0model)
98 "(upc_ca_generic::reset_f0model)
99 Reset F0 model information."
100 t
101 )
102
103 (provide 'upc_ca_generic_f0model)