Giter Site home page Giter Site logo

tdklatt's Introduction

tdklatt

tdklatt is an open-source implementation of the Klatt synthesizer in Python 3.6. It was developed for use in the TrackDraw visual formant synthesizer.

People

tdklatt was written by Daniel Guest. You can contact him at [email protected] with questions. The TrackDraw project was written by A.Y. Cho and Daniel Guest.

Usage

Right now, all of the classes and functions of tdklatt are available as a single module (tdklatt.py). In the future, it will likely be distributed in a package format instead.

To use tdklatt, all you need to do is clone the repository, and to ensure that you have the dependencies installed. They're listed in the requirements.txt file in this repository. To clone the repository, type the following in a terminal:

git clone https://github.com/guestdaniel/tdklatt 

Alternatively (if you don't use git) you can download the repository in RAR format using the button in the upper right of the repoistory page and unzip it somewhere.

Once you have the repository on your computer, you can hear a quick example synthesized by tdklatt if you just type the following in a terminal to run tdklatt as a script:

python tdklatt.py

Here, take care to make sure python points to Python 3.6 on your computer! Earlier versions of Python won't work.

If you want to explore more of tdklatt, launch a Python 3.6 session in the folder containing the repository and run the following:

import tdklatt

Now, every class and function provided by tdklatt is available to you in that namespace. To synthesize a speech waveform, try the following:

s = tdklatt.klatt_make() # Creates a Klatt synthesizer w/ default settings
s.run()

To play the waveform you just synthesized, try the following:

s.play()

Synthesis parameters are stored in s.params, which is a standard dictionary. The names of parameters are typically the same as in the Klatt paper, but there may be some exceptions. To see a list of parameters along with explanations, simply access the docstrings of NTVParams1980 (for non-time-varying parameters) and TVParams1980 (for time-varying parameters).

help(tdklatt.NTVParams1980)
help(tdklatt.TVParams1980)

To see how different parameters are internally represented, you can call the params dictionary:

s.params

To change a parameter, simply modify or replace existing values appropriately. For example, F0 is represented as a numpy.array with length N_SAMP, so we can replace it with a new numpy array to change the F0.

s.params["F0"] = np.ones(s.params["N_SAMP"])*200 # Change F0 to steady-state 200 Hz
s.run() # Rerun synthesizer
s.play() # Hear the result of the higher F0

Currently, only time-varying parameters can be changed in place. Future versions will implement the ability to change non-time-varying parameters as well without re-creating the Synth object.

tdklatt's People

Contributors

guestdaniel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.