### 18.5 General intonation ¶

As there seems to be a number of intonation theories that predict F0 contours by rule (possibly using trained parameters) this module aids the external specification of such rules for a wide class of intonation theories (through primarily those that might be referred to as the ToBI group). This is designed to be multi-lingual and offer a quick way to port often pre-existing rules into Festival without writing new C++ code.

The accent prediction part uses the same mechanisms as the Simple intonation method described above, a decision tree for accent prediction, thus the tree in the variable `int_accent_cart_tree` is used on each syllable to predict an `IntEvent`.

The target part calls a specified Scheme function which returns a list of target points for a syllable. In this way any arbitrary tests may be done to produce the target points. For example here is a function which returns three target points for each syllable with an `IntEvent` related to it (i.e. accented syllables).

    (define (targ_func1 utt syl)
      "(targ_func1 UTT STREAMITEM)
    Returns a list of targets for the given syllable."
      (let ((start (item.feat syl 'syllable_start))
            (end (item.feat syl 'syllable_end)))
        (if (equal? (item.feat syl "R:Intonation.daughter1.name") "Accented")
            (list
             (list start 110)
             (list (/ (+ start end) 2.0) 140)
             (list end 100)))))

This function may be identified as the function to call by the following setup parameters.

    (Parameter.set 'Int_Method 'General)
    (Parameter.set 'Int_Target_Method Int_Targets_General)

    (set! int_general_params
          (list
           (list 'targ_func targ_func1)))