### 18.6 Using ToBI ¶

An example implementation of a ToBI to F0 target module is included in `lib/tobi_rules.scm` based on the rules described in jilka96. This uses the general intonation method discussed in the previous section. This is designed to be useful to people who are experimenting with ToBI (silverman92), rather than general text to speech.

To use this method you need to load `lib/tobi_rules.scm` and call `setup_tobi_f0_method`. The default is in a male’s pitch range, i.e. for `voice_rab_diphone`. You can change it for other pitch ranges by changing the folwoing variables.

    (Parameter.set 'Default_Topline 110)
    (Parameter.set 'Default_Start_Baseline 87)
    (Parameter.set 'Default_End_Baseline 83)
    (Parameter.set 'Current_Topline (Parameter.get 'Default_Topline))
    (Parameter.set 'Valley_Dip 75)

An example using this from STML is given in `examples/tobi.stml`. But it can also be used from Scheme. For example before defining an utterance you should execute the following either from teh command line on in some setup file

    (voice_rab_diphone)
    (require 'tobi_rules)
    (setup_tobi_f0_method)

In order to allow specification of accents, tones, and break levels you must use an utterance type that allows such specification. For example

    (Utterance
     Words
     (boy
      (saw ((accent H*)))
       the
       (girl ((accent H*)))
       in the
       (park ((accent H*) (tone H-)))
       with the
       (telescope ((accent H*) (tone H-H%)))))

    (Utterance Words
     (The
      (boy ((accent L*)))
      saw
      the
      (girl ((accent H*) (tone L-)))
      with
      the
      (telescope ((accent H*) (tone H-H%))))))

You can display the the synthesized form of these utterance in Xwaves. Start an Xwaves and an Xlabeller and call the function `display` on the synthesized utterance.