Package: copasul
CoPaSul - Contour-based, parametric, and superpositional intonation stylizationAuthorUwe Reichel, Research Institute for Linguistics, Hungarian Academy of Sciences, BudapestPurpose: Prosodic Feature extractionIntonationGlobal f0 registerLocal f0 shapesProsodic boundariesEnergyRhythmVoice qualityDependenciesPython:>= 3.8Packages: seerequirements.txttested for Linux and Python 3.8, and 3.10InstallationFrom PyPIset up a virtual environmentvenv_copasul, activate it, and install copasul. For Linux this works e.g. as follows:$virtualenv--python="/usr/bin/python3"venv_copasul
$sourcevenv_copasul/bin/activate(venv_copasul)$pipinstallcopasulFrom GitHubproject URL:https://github.com/reichelu/copasulset up a virtual environmentvenv_copasul, activate it, and install requirements. For Linux this works e.g. as follows:$gitclonegit@github.com:reichelu/copasul.git
$cdcopasul/
$virtualenv--python="/usr/bin/python3"venv_copasul
$sourcevenv_copasul/bin/activate(venv_copasul)$pipinstall-rrequirements.txtUsageRequired filesaudio (wav), f0, pulse, and annotation files (Textgrid), see on GitHub:tests/minex/inputf0 and pulse files can be generated with the help of the praat scripts on Github:scripts/*praata config file (json), see on GitHubtests/minex/config/minex.jsonsee on Githubdocs/copasul_commented_config.json.txtand thearticlefor further detailsCall from terminal (if cloned from GitHub)see onGitHub project pagescripts/run_copasul.py [-c myConfigFile.json]PROJECT_DIR: directory where GitHub project has been cloned(venv_copasul)$cdPROJECT_DIR/scripts/(venv_copasul)$pythonrun_copasul.py-c../tests/minex/config/minex.jsonif you use../tests/minex/config/minex.jsonas config file, CoPaSulprocesses the files in../tests/minex/input/, andoutputs feature tables to../tests/minex/output/test.FEATURESET.{csv, R}outputs the CoPaSul output dict to../tests/minex/output/test.picklethis output dict can be used for further (warm start) processingif you use your own config file, make sure, that all directories infsys:*:dirare either absolute paths or relative paths relative to your config fileExample integration into python codeimportjsonimportpickleimportsys# add this line if you use the cloned code from GitHub# sys.path.append(PROJECT_DIR)fromcopasulimportcopasul# feature extractorfex=copasul.Copasul()# processing based on config fileconfig_file=MYCONFIGFILE.jsoncopa=fex.process(config=config_file)# processing based on config dictwithopen(config_file,'r')ash:config_dict=json.load(h)copa=fex.process(config=config_dict)# warm start: continue processing#   - implicit loading from configconfig_dict["navigate"]["from_scratch"]=Falseconfig_dict["navigate"]["overwrite_config"]=True#     ... change further navigation values to your needscopa_further_processed=fex.process(config=config_dict)#   - explicit loading from filecopa_file=MYCOPASULOUTPUT.pickleconfig_dict["navigate"]["overwrite_config"]=True#     ... change further navigation values to your needswithopen(copa_file,"rb")ash:copa=pickle.load(h)copa_further_processed=fex.process(config=config_dict,copa=copa)MaterialManualExample configurationCommented configurationReferenceReichel, U.D. (2017).CoPaSul Manual: Contour-based, parametric, and superpositional intonation stylization, arXiv:1612.04765.