View source: R/pitch_postprocessing.R

costPerPath | R Documentation |

Internal soundgen function.

```
costPerPath(
path,
pitchCands,
pitchCert,
certWeight,
pitchCenterGravity,
manual = NULL
)
```

`path` |
evaluated path through pitch candidates (as integers specifying the rows in pitchCands, not the actual values of pitch) |

`pitchCands` |
a matrix of multiple pitch candidates per fft frame. Each column is one fft frame, each row is one candidate (the last row is always "manual") |

`pitchCert` |
a matrix of the same dimensionality as pitchCands specifying our certainty in pitch candidates |

`certWeight` |
(0 to 1) in pitch postprocessing, specifies how much we prioritize the certainty of pitch candidates vs. pitch jumps / the internal tension of the resulting pitch curve |

`pitchCenterGravity` |
numeric vector giving the mean of all pitch candidates per fft frame weighted by our certainty in each of these candidates |

`manual` |
a dataframe of manual pitch candidates from pathfinder() |

Internal helper function for postprocessing of pitch contours called by
`pathfinding_slow`

. Calculates the cost of a particular path
through pitch candidates based on pitch jumps and distance from
high-certainty candidates.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.