annotations.Momel package

Submodules

annotations.Momel.anchor module

src.annotations.Momel.anchor.py

class annotations.Momel.anchor.Anchor[source]

Bases: object

Data structure to store a selected anchor.

Author

Brigitte Bigi

Organization

Laboratoire Parole et Langage, Aix-en-Provence, France

Contact

develop@sppas.org

License

GPL, v3

Copyright

Copyright (C) 2011-2018 Brigitte Bigi

An anchor was initially called a “target”. Daniel Hirst changed the name in 2017.

An anchor is made of 2 or 3 values:
  • x: float : the number of the frame ; required

  • y: float ; the pitch value ; required

  • p: int ; optional

__init__()[source]

Create a new Anchor instance with default values.

get_p()[source]

Return the p value of an anchor.

get_x()[source]

Return the x value of an anchor.

get_y()[source]

Return the y value of an anchor.

property p

Return the p value of an anchor.

set(x, y, p=0)[source]

Set new values to an anchor.

Parameters
  • x – (float)

  • y – (float)

  • p – (int)

set_p(p)[source]

Set a new p value to an anchor.

Parameters

p – (int)

Raises

TypeError

set_x(x)[source]

Set a new x value to an anchor.

Parameters

x – (float)

Raises

TypeError

set_y(y)[source]

Set a new y value to an anchor.

Parameters

y – (float)

Raises

TypeError

property x

Return the x value of an anchor.

property y

Return the y value of an anchor.

annotations.Momel.momel module

filename

sppas.src.annotations.Momel.momel.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

Momel algorithm.

https://en.wikipedia.org/wiki/Momel

Different versions of the Momel algorithm have been developed in the LPL in Aix en Provence over the last twenty years and have been used for the phonetic modelling and symbolic coding of the intonation patterns of a number of languages (including English, French, Italian, Catalan, etc).

The last implementation is presented as a Praat plugin. The modelling and coding algorithms have been implemented as a set of Praat scripts, each corresponding to a specific step in the process.

See:
Hirst, Daniel. (2007).
A Praat plugin for Momel and INTSINT with improved algorithms
for modelling and coding intonation.
Proceedings of the 16th International Congress of Phonetic Sciences.

The quality of the F0 modelling crucially depends on the quality of the F0 detected.

The quadratic spline function used to model the macro-melodic component is defined by a sequence of target points, (couples <s, Hz>) each pair of which is linked by two monotonic parabolic curves with the spline knot occurring (by default) at the midway point between the two targets. The first derivative of the curve thus defined is zero at each target point and the two parabolas have the same value and same derivative at the spline knot. This, in fact, defines the most simple mathematical function for which the curves are both continuous and smooth.

class annotations.Momel.momel.Momel[source]

Bases: object

Implements Momel.

Author

Brigitte Bigi

Organization

Laboratoire Parole et Langage, Aix-en-Provence, France

Contact

develop@sppas.org

License

GPL, v3

Copyright

Copyright (C) 2011-2018 Brigitte Bigi

__init__()[source]

Create a new Momel instance.

annotate(pitch_values)[source]

Apply momel from a vector of pitch values, one each 0.01 sec.

Parameters

pitch_values – (list)

Returns

list of selected anchors

borne()[source]

borne.

Principes: calcul borne G (D) si 1ere (derniere) cible est ( > (debut_voisement+halo) ) ( < (fin_voisement -halo) ) ce pt de debut(fin) voisement == frontiere cible extremite == ancre regression quadratique sur Hz de [frontiere ancre]

calcrgp(pond, dpx, fpx)[source]

From inputs, estimates: a0, a1, a2.

Parameters
  • pond

  • dpx

  • fpx

cible()[source]

Find momel target points.

elim_glitch()[source]

Eliminate Glitch of the pitch values array.

Set a current pith value to 0 if left and right values are greater than 5% more than the current value.

initialize()[source]

Set some variables to their default values.

reduc()[source]

First target reduction of too close points.

reduc2()[source]

reduc2.

2eme filtrage des cibles trop proches en t [et Hz]

set_option_elim_glitch(activate=True)[source]
set_option_hi(val)[source]
set_option_lo(val)[source]
set_option_maxerr(val)[source]
set_option_mind(val)[source]
set_option_minr(val)[source]
set_option_win1(val)[source]
set_option_win2(val)[source]
set_pitch_array(arrayvals)[source]

annotations.Momel.momelutil module

filename

sppas.src.annotations.Align.tracksio.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

utilities for momel

annotations.Momel.momelutil.quicksortcib(ciblist)[source]

Implement quicksort (ie “partition-exchange” sort). that makes on average, O(n log n) comparisons to sort n items. This solution benefits from “list comprehensions”, which keeps the syntax concise and easy to read. Quicksort dedicated to a list of Targets.

annotations.Momel.sppasmomel module

filename

sppas.src.annotations.Momel.sppasmomel.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

SPPAS integration of the Momel automatic annotation.

class annotations.Momel.sppasmomel.sppasMomel(log=None)[source]

Bases: annotations.baseannot.sppasBaseAnnotation

SPPAS integration of Momel.

__init__(log=None)[source]

Create a new sppasMomel instance.

Log is used for a better communication of the annotation process and its results. If None, logs are redirected to the default logging system.

Parameters

log – (sppasLog) Human-readable logs.

static anchors_to_tier(anchors)[source]

Transform anchors to a sppasTier.

Anchors are stored in frames. It is converted to seconds (a frame is during 10ms).

Parameters

anchors – (List of Anchor)

Returns

(sppasTier)

convert(pitch)[source]

Search for momel anchors.

Parameters

pitch – (list of float) pitch values samples at 10ms

Returns

sppasTier

estimate_momel(ipu_pitch, current_time)[source]

Estimate momel on an IPU.

Parameters
  • ipu_pitch – (list of float) Pitch values of an IPU.

  • current_time – (float) Time value of the last pitch value

Returns

(list of Anchor)

fix_options(options)[source]

Fix all options.

Available options are:

  • lfen1

  • hzinf

  • hzsup

  • maxec

  • lfen2

  • seuildiff_x

  • seuildiff_y

  • glitch

Parameters

options – (sppasOption)

static fix_pitch(input_filename)[source]

Load pitch values from a file.

It is supposed that the given file contains a tier with name “Pitch” with a pitch value every 10ms, or a tier with name “PitchTier”.

Returns

A list of pitch values (one value each 10 ms).

static get_input_extensions()[source]

Extensions that the annotation expects for its input filename.

get_output_pattern()[source]

Pattern this annotation uses in an output filename.

run(input_files, output=None)[source]

Run the automatic annotation process on an input.

Parameters
  • input_files – (list of str) Pitch values

  • output – (str) the output name

Returns

(sppasTranscription)

set_option_elim_glitch(value)[source]
set_option_hi(value)[source]
set_option_lo(value)[source]
set_option_maxerr(value)[source]
set_option_mind(value)[source]
set_option_minr(value)[source]
set_option_win1(value)[source]
set_option_win2(value)[source]

Module contents

filename

sppas.src.annotations.Momel.__init__.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

Modelling Melodie

class annotations.Momel.Momel[source]

Bases: object

Implements Momel.

Author

Brigitte Bigi

Organization

Laboratoire Parole et Langage, Aix-en-Provence, France

Contact

develop@sppas.org

License

GPL, v3

Copyright

Copyright (C) 2011-2018 Brigitte Bigi

__init__()[source]

Create a new Momel instance.

annotate(pitch_values)[source]

Apply momel from a vector of pitch values, one each 0.01 sec.

Parameters

pitch_values – (list)

Returns

list of selected anchors

borne()[source]

borne.

Principes: calcul borne G (D) si 1ere (derniere) cible est ( > (debut_voisement+halo) ) ( < (fin_voisement -halo) ) ce pt de debut(fin) voisement == frontiere cible extremite == ancre regression quadratique sur Hz de [frontiere ancre]

calcrgp(pond, dpx, fpx)[source]

From inputs, estimates: a0, a1, a2.

Parameters
  • pond

  • dpx

  • fpx

cible()[source]

Find momel target points.

elim_glitch()[source]

Eliminate Glitch of the pitch values array.

Set a current pith value to 0 if left and right values are greater than 5% more than the current value.

initialize()[source]

Set some variables to their default values.

reduc()[source]

First target reduction of too close points.

reduc2()[source]

reduc2.

2eme filtrage des cibles trop proches en t [et Hz]

set_option_elim_glitch(activate=True)[source]
set_option_hi(val)[source]
set_option_lo(val)[source]
set_option_maxerr(val)[source]
set_option_mind(val)[source]
set_option_minr(val)[source]
set_option_win1(val)[source]
set_option_win2(val)[source]
set_pitch_array(arrayvals)[source]
class annotations.Momel.sppasMomel(log=None)[source]

Bases: annotations.baseannot.sppasBaseAnnotation

SPPAS integration of Momel.

__init__(log=None)[source]

Create a new sppasMomel instance.

Log is used for a better communication of the annotation process and its results. If None, logs are redirected to the default logging system.

Parameters

log – (sppasLog) Human-readable logs.

static anchors_to_tier(anchors)[source]

Transform anchors to a sppasTier.

Anchors are stored in frames. It is converted to seconds (a frame is during 10ms).

Parameters

anchors – (List of Anchor)

Returns

(sppasTier)

convert(pitch)[source]

Search for momel anchors.

Parameters

pitch – (list of float) pitch values samples at 10ms

Returns

sppasTier

estimate_momel(ipu_pitch, current_time)[source]

Estimate momel on an IPU.

Parameters
  • ipu_pitch – (list of float) Pitch values of an IPU.

  • current_time – (float) Time value of the last pitch value

Returns

(list of Anchor)

fix_options(options)[source]

Fix all options.

Available options are:

  • lfen1

  • hzinf

  • hzsup

  • maxec

  • lfen2

  • seuildiff_x

  • seuildiff_y

  • glitch

Parameters

options – (sppasOption)

static fix_pitch(input_filename)[source]

Load pitch values from a file.

It is supposed that the given file contains a tier with name “Pitch” with a pitch value every 10ms, or a tier with name “PitchTier”.

Returns

A list of pitch values (one value each 10 ms).

static get_input_extensions()[source]

Extensions that the annotation expects for its input filename.

get_output_pattern()[source]

Pattern this annotation uses in an output filename.

run(input_files, output=None)[source]

Run the automatic annotation process on an input.

Parameters
  • input_files – (list of str) Pitch values

  • output – (str) the output name

Returns

(sppasTranscription)

set_option_elim_glitch(value)[source]
set_option_hi(value)[source]
set_option_lo(value)[source]
set_option_maxerr(value)[source]
set_option_mind(value)[source]
set_option_minr(value)[source]
set_option_win1(value)[source]
set_option_win2(value)[source]