A python wrapper for REAPER

Related tags

Audiopyreaper
Overview
Comments
  • Compilation error: cannot initialize a parameter of type 'int32_t *'

    Compilation error: cannot initialize a parameter of type 'int32_t *'

    Hi, I've being trying to install pyreaper, first with pip install pyreaper and then by cloning the repository and doing: git submodule update --init --recursive python setup.py build (I also tried python setup.py develop)

    however in each case I got this error:

    pyreaper/creaper.cpp:4153:155: error: cannot initialize a parameter of type 'int32_t *' (aka 'int *') with an rvalue of type '__pyx_t_5numpy_int32_t *' (aka 'long *')

    it was preceded by this warning (although I think it's independent from the error message). warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

    Have you encountered this error before ?

    bug help wanted 
    opened by cveaux 14
  • This is a bug when the frame_period parameter is set to 0.016

    This is a bug when the frame_period parameter is set to 0.016

    hello,

    There is a wav example (Maybe I will sent it by email). I just to extract the pitch features, but unfortunately when I use the frame_period and it is set to 0.016 rather than the default value 0.005. The code didn't work, the error is: image

    However, when I change the frame_period to default value 0.005, the code is ok. So how to deal with it? and could you fix the bug? Thx

    opened by gemengtju 6
  • Option to suppress REAPER output

    Option to suppress REAPER output

    Hi,

    Is there any method I can use to suppress printing statements like

    Residual symmetry: P:2468.209473  N:1539.423462  MEAN:0.045802
    Inverting signal
    

    when I run pyreaper.reaper()?

    I tried using a context like this:

    class DummyFile(object):
        def write(self, x): pass
    
    @contextlib.contextmanager
    def suppress_print():
        save_stdout = sys.stdout
        save_stderr = sys.stderr
        sys.stdout = DummyFile()
        sys.stderr = DummyFile()
        yield
        sys.stdout = save_stdout
        sys.stderr = save_stderr
    

    but it doesn't work. I guess since cython is used, the output is going through somewhere else besides stdout.

    opened by terriyu 5
  • Fixed compilation on windows

    Fixed compilation on windows

    I have fixed the compiler error preventing the installation on Windows. MSVC refused to cast the pointers, but both pointers should point to typedef'ed int32_t on all platforms so reinterpret_cast should not be a problem here. This also fixes #6.

    opened by OrcusCZ 3
  • Pyreaper pypi package

    Pyreaper pypi package

    In the pypi released package there's a built reaper.cpp which is incompatible with python3.7. I got these errors:

    pyreaper/creaper.cpp:8197:69: error: too many arguments to function
             return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
                                                                             ^
        pyreaper/creaper.cpp: In function ‘void __Pyx__ExceptionSave(PyThreadState*, PyObject**, PyObject**, PyObject**)’:
        pyreaper/creaper.cpp:9364:21: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
             *type = tstate->exc_type;
                             ^~~~~~~~
                             curexc_type
        pyreaper/creaper.cpp:9365:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
             *value = tstate->exc_value;
                              ^~~~~~~~~
                              curexc_value
        pyreaper/creaper.cpp:9366:19: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
             *tb = tstate->exc_traceback;
                           ^~~~~~~~~~~~~
                           curexc_traceback
        pyreaper/creaper.cpp: In function ‘void __Pyx__ExceptionReset(PyThreadState*, PyObject*, PyObject*, PyObject*)’:
        pyreaper/creaper.cpp:9373:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
             tmp_type = tstate->exc_type;
                                ^~~~~~~~
                                curexc_type
        pyreaper/creaper.cpp:9374:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
             tmp_value = tstate->exc_value;
                                 ^~~~~~~~~
                                 curexc_value
        pyreaper/creaper.cpp:9375:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
             tmp_tb = tstate->exc_traceback;
                              ^~~~~~~~~~~~~
                              curexc_traceback
        pyreaper/creaper.cpp:9376:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
             tstate->exc_type = type;
                     ^~~~~~~~
                     curexc_type
        pyreaper/creaper.cpp:9377:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
             tstate->exc_value = value;
                     ^~~~~~~~~
                     curexc_value
        pyreaper/creaper.cpp:9378:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
             tstate->exc_traceback = tb;
                     ^~~~~~~~~~~~~
                     curexc_traceback
        pyreaper/creaper.cpp: In function ‘int __Pyx__GetException(PyThreadState*, PyObject**, PyObject**, PyObject**)’:
        pyreaper/creaper.cpp:9433:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
             tmp_type = tstate->exc_type;
                                ^~~~~~~~
                                curexc_type
        pyreaper/creaper.cpp:9434:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
             tmp_value = tstate->exc_value;
                                 ^~~~~~~~~
                                 curexc_value
        pyreaper/creaper.cpp:9435:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
             tmp_tb = tstate->exc_traceback;
                              ^~~~~~~~~~~~~
                              curexc_traceback
        pyreaper/creaper.cpp:9436:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
             tstate->exc_type = local_type;
                     ^~~~~~~~
                     curexc_type
        pyreaper/creaper.cpp:9437:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
             tstate->exc_value = local_value;
                     ^~~~~~~~~
                     curexc_value
        pyreaper/creaper.cpp:9438:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
             tstate->exc_traceback = local_tb;
                     ^~~~~~~~~~~~~
                     curexc_traceback
        error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    

    I think it would be better to delete it and rebuild extension using Cython from scratch during installation. In that case installation is fine.

    bug 
    opened by vladbataev 3
  • Small differences between pyreaper and original REAPER

    Small differences between pyreaper and original REAPER

    Hi, I ran pyreaper and the original Google REAPER on some wav files. The F0 results are very similar, but there are a few small differences even though I think I am using the same parameters. Do you know why there are differences?

    For pyreaper, I'm running the following commands in my Python script:

    from scipy.io import wavfile from pyreaper import reaper fs, y = wavfile.read('my-wavfile.wav') pm_times, pm, F0_times, F0, corr = reaper(y, fs, minf0=40.0, maxf0=500.0, do_high_pass=True, do_hilbert_transform=False, inter_pulse=0.01, frame_period=0.001)

    For Google's original REAPER, I'm running this on the command line:

    $ ./reaper -i my-wavfile.wav -f f0.txt -p pitchmarks.txt -c corr.txt -s -e 0.001 -x 500.0 -m 40.0 -u 0.01 -a

    opened by terriyu 3
  • python is crashing with 'malloc' error when batch processing

    python is crashing with 'malloc' error when batch processing

    When I apply a pyreaper.reaper function on a folder of files, it's crashing with this error:

    python(94746,0x119755dc0) malloc: Incorrect checksum for freed object 0x7f9d2c43d780: probably modified after being freed. Corrupt value: 0x800000003f052325 python(94746,0x119755dc0) malloc: *** set a breakpoint in malloc_error_break to debug Abort trap: 6

    I tried python 3.6.9 with pyreaper 0.0.8 and 0.0.6 and python 3.7.8 with pyreaper 0.0.8. Here is an output from the report on mac os in case that might help:

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff6e86033a __pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fff6e91ce60 pthread_kill + 430 2 libsystem_c.dylib 0x00007fff6e7e7808 abort + 120 3 libsystem_malloc.dylib 0x00007fff6e8dd50b malloc_vreport + 548 4 libsystem_malloc.dylib 0x00007fff6e8eed27 malloc_zone_error + 183 5 libsystem_malloc.dylib 0x00007fff6e8d5081 tiny_free_list_remove_ptr + 690 6 libsystem_malloc.dylib 0x00007fff6e8d4279 tiny_free_no_lock + 1018 7 libsystem_malloc.dylib 0x00007fff6e8d3d8b free_tiny + 459 8 creaper.cpython-36m-darwin.so 0x000000013ad2b952 __pyx_f_8pyreaper_7creaper_12EpochTracker_GetF0AndCorrTrack(__pyx_obj_8pyreaper_7creaper_EpochTracker*, float, Track*, Track*) + 578 9 creaper.cpython-36m-darwin.so 0x000000013ad3201a __pyx_pf_8pyreaper_7creaper_reaper_internal(_object*, tagPyArrayObject_fields*, _object*, float, float, bool, bool, float, float, float) + 5306 10 python 0x000000010eab28fb _PyCFunction_FastCallDict + 475 11 python 0x000000010eb42d4b call_function + 539 12 python 0x000000010eb3f98e _PyEval_EvalFrameDefault + 26014 13 python 0x000000010eb438aa _PyEval_EvalCodeWithName + 2698 14 python 0x000000010eb440b2 fast_function + 386 15 python 0x000000010eb42d15 call_function + 485 16 python 0x000000010eb3fa34 _PyEval_EvalFrameDefault + 26180 17 python 0x000000010eb438aa _PyEval_EvalCodeWithName + 2698 18 python 0x000000010eb440b2 fast_function + 386 19 python 0x000000010eb42d15 call_function + 485 20 python 0x000000010eb3f98e _PyEval_EvalFrameDefault + 26014 21 python 0x000000010eb438aa _PyEval_EvalCodeWithName + 2698 22 python 0x000000010eb440b2 fast_function + 386 23 python 0x000000010eb42d15 call_function + 485 24 python 0x000000010eb3f98e _PyEval_EvalFrameDefault + 26014 25 python 0x000000010eb438aa _PyEval_EvalCodeWithName + 2698 26 python 0x000000010eb440b2 fast_function + 386 27 python 0x000000010eb42d15 call_function + 485 28 python 0x000000010eb3fa34 _PyEval_EvalFrameDefault + 26180 29 python 0x000000010eb44159 fast_function + 553 30 python 0x000000010eb42d15 call_function + 485 31 python 0x000000010eb3f98e _PyEval_EvalFrameDefault + 26014 32 python 0x000000010eb44159 fast_function + 553 33 python 0x000000010eb42d15 call_function + 485 34 python 0x000000010eb3f98e _PyEval_EvalFrameDefault + 26014 35 python 0x000000010eb438aa _PyEval_EvalCodeWithName + 2698 36 python 0x000000010eb39360 PyEval_EvalCode + 48 37 python 0x000000010eb7293e PyRun_FileExFlags + 174 38 python 0x000000010eb71ede PyRun_SimpleFileExFlags + 270 39 python 0x000000010eb8e72a Py_Main + 3306 40 python 0x000000010ea59ac8 main + 248 41 libdyld.dylib 0x00007fff6e718cc9 start + 1

    opened by ap-respeecher 2
  • Pyreaper install failed on windows

    Pyreaper install failed on windows

    I got the error when I was install pyreaper

    How can I solve this problem?

    pyreaper\creaper.cpp(4680): error C2664: 'PyObject *(__pyx_obj_8pyreaper_7creaper_EpochTracker *,Track *,int32_t *)': cannot convert argument 3 from '__pyx_t_5numpy_int32_t *' to 'int32_t *'

    wontfix 
    opened by yuuSiVo 1
  • add build dependencies to fix install from source

    add build dependencies to fix install from source

    pip install pyreaper fails to install
    pip install pyreaper
    Collecting pyreaper
      Using cached pyreaper-0.0.8.tar.gz (124 kB)
      Preparing metadata (setup.py) ... error
      error: subprocess-exited-with-error
    

    × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-s03_fbrw/pyreaper_473cbdcdb56d4bc3b46dfa8bce38e114/setup.py", line 8, in import numpy as np ModuleNotFoundError: No module named 'numpy' [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

    × Encountered error while generating package metadata. ╰─> See above for output.

    note: This is an issue with the package mentioned above, not pip. hint: See above for details.

    I'tried to install from source but it seems like build dependencies (numpy, Cython) are not configured correctly

    pip install git+https://github.com/r9y9/pyreaper

    Collecting git+https://github.com/r9y9/pyreaper Cloning https://github.com/r9y9/pyreaper to /tmp/pip-req-build-gtap3quc Running command git clone --filter=blob:none --quiet https://github.com/r9y9/pyreaper /tmp/pip-req-build-gtap3quc Resolved https://github.com/r9y9/pyreaper to commit f0f09a0735edac92a54095c6752ddbd7b8a450c2 Running command git submodule update --init --recursive -q Preparing metadata (setup.py) ... error
    error: subprocess-exited-with-error

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [6 lines of output]
    Traceback (most recent call last):
    File "", line 2, in File "", line 34, in
    File "/tmp/pip-req-build-gtap3quc/setup.py", line 8, in import numpy as np
    ModuleNotFoundError: No module named 'numpy'
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: metadata-generation-failed

    × Encountered error while generating package metadata.
    ╰─> See above for output.

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.

    This PR fixes that, I tested installation in isolated virtualenv and it installs correctly:

    pip install git+https://github.com/tandav/pyreaper
    pip install git+https://github.com/tandav/pyreaper
    Collecting git+https://github.com/tandav/pyreaper                                                             
      Cloning https://github.com/tandav/pyreaper to /tmp/pip-req-build-5va0xf3f
      Running command git clone --filter=blob:none --quiet https://github.com/tandav/pyreaper /tmp/pip-req-build-5va0xf3f
      Resolved https://github.com/tandav/pyreaper to commit 1d9cd22b324d4e05bde917c86f5e29c5cf6572d5
      Running command git submodule update --init --recursive -q
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Collecting numpy>=1.8.0
      Using cached numpy-1.23.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
    Building wheels for collected packages: pyreaper
      Building wheel for pyreaper (pyproject.toml) ... done
      Created wheel for pyreaper: filename=pyreaper-0.0.9.dev0-cp310-cp310-linux_x86_64.whl size=614301 sha256=0aeb4a5b9f6e46bc8d46a86497386aa56ff0d5be8fc39fc3f1aef22e7cfa66be
      Stored in directory: /tmp/pip-ephem-wheel-cache-8ugsflvx/wheels/b0/2d/9b/45bf5cc06c19cc079084b01ee402d3677aa809f826ef03f90b
    Successfully built pyreaper
    Installing collected packages: numpy, pyreaper
    Successfully installed numpy-1.23.4 pyreaper-0.0.9.dev0 
    python -c 'import pyreaper' # works
    
    opened by tandav 0
  • frame_period bug

    frame_period bug

    when set the frame period to 0.0125, the pyreaper may cause memory free() error. This is random in different wavs. But it is right with the default frame period.
    something may be wrong because of the mismatch between the wave length and frame period

    opened by fanpengustc 6
  • IndexError when narrowing F0 range

    IndexError when narrowing F0 range

    pyreaper crashes when I narrow the F0 range (e.g. when I set minf0=100 and maxf0=170).

    The particular minf0 and maxf0 values that cause the crash depend on the analyzed waveform but you can try such extreme values as minf0=160 and maxf0=170 and pyreaper should crash for sure.

    The original REAPER works fine and does not crash even with the extreme F0 values.

    The error message is:

    File "/Users/jmatouse/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pyreaper/__init__.py", line 95, in reaper
        unvoiced_cost)
      File "pyreaper/creaper.pyx", line 183, in pyreaper.creaper.reaper_internal
    IndexError: Out of bounds on buffer access (axis 0)
    
    bug 
    opened by jmaty 0
Releases(v0.0.8)
Owner
Ryuichi Yamamoto
Speech Synthesis, Voice Conversion, Machine Learning
Ryuichi Yamamoto
Audio augmentations library for PyTorch for audio in the time-domain

Audio augmentations library for PyTorch for audio in the time-domain, with support for stochastic data augmentations as used often in self-supervised / contrastive learning.

Janne 166 Jan 08, 2023
Real-Time Spherical Microphone Renderer for binaural reproduction in Python

ReTiSAR Implementation of the Real-Time Spherical Microphone Renderer for binaural reproduction in Python [1][2]. Contents: | Requirements | Setup | Q

Division of Applied Acoustics at Chalmers University of Technology 51 Dec 17, 2022
a library for audio and music analysis

aubio aubio is a library to label music and sounds. It listens to audio signals and attempts to detect events. For instance, when a drum is hit, at wh

aubio 2.9k Dec 30, 2022
python wrapper for rubberband

pyrubberband A python wrapper for rubberband. For now, this just provides lightweight wrappers for pitch-shifting and time-stretching. All processing

Brian McFee 106 Nov 28, 2022
A python script that can play .mp3 URLs upon the ringing or motion detection of a Ring doorbell. The sound plays through Sonos speakers.

Ring x Sonos A python script that plays .mp3 files whenever a doorbell is rung or a doorbell detects motion. Features Music! Authors @braden Running T

braden 0 Nov 12, 2021
Simple, hackable offline speech to text - using the VOSK-API.

Nerd Dictation Offline Speech to Text for Desktop Linux. This is a utility that provides simple access speech to text for using in Linux without being

Campbell Barton 844 Jan 07, 2023
Play any song directly into your group voice chat.

Telegram VCPlayer Bot Play any song directly into your group voice chat. Official Bot : VCPlayerBot | Discussion Group : VoiceChat Music Player Suppor

Shubham Kumar 50 Nov 21, 2022
pyo is a Python module written in C to help digital signal processing script creation.

pyo is a Python module written in C to help digital signal processing script creation.

Olivier Bélanger 1.1k Jan 01, 2023
A Python 3 script for capturing and recording a SDR stream to a WAV file (or serving it to a HTTP audio stream).

rfsoapyfile A Python 3 script for capturing and recording a SDR stream to a WAV file (or serving it to a HTTP audio stream). The script is threaded fo

4 Dec 19, 2022
Voice helper on russian

Voice helper on russian

KreO 1 Jun 30, 2022
Code to work with wave files!

Code to work with wave files!

Mohammad Dori 3 Jul 15, 2022
Linear Prediction Coefficients estimation from mel-spectrogram implemented in Python based on Levinson-Durbin algorithm.

LPC_for_TTS Linear Prediction Coefficients estimation from mel-spectrogram implemented in Python based on Levinson-Durbin algorithm. 基于Levinson-Durbin

Zewang ZHANG 58 Nov 17, 2022
Guide & Examples to create deeplearning gstreamer plugins and use them in your pipeline

upai-gst-dl-plugins Guide & Examples to create deeplearning gstreamer plugins and use them in your pipeline Introduction Thanks to the work done by @j

UPAI.IO 11 Dec 11, 2022
Mina - A Telegram Music Bot 5 mandatory Assistant written in Python using Pyrogram and Py-Tgcalls

Mina - A Telegram Music Bot 5 mandatory Assistant written in Python using Pyrogram and Py-Tgcalls

3 Feb 07, 2022
A Music Player Bot for Discord Servers

A Music Player Bot for Discord Servers

Halil Acar 2 Oct 25, 2021
Audio2midi - Automatic Audio-to-symbolic Arrangement

Automatic Audio-to-symbolic Arrangement This is the repository of the project "A

Ziyu Wang 24 Dec 05, 2022
Sequencer: Deep LSTM for Image Classification

Sequencer: Deep LSTM for Image Classification Created by Yuki Tatsunami Masato Taki This repository contains implementation for Sequencer. Abstract In

Yuki Tatsunami 111 Dec 16, 2022
This library provides common speech features for ASR including MFCCs and filterbank energies.

python_speech_features This library provides common speech features for ASR including MFCCs and filterbank energies. If you are not sure what MFCCs ar

James Lyons 2.2k Jan 04, 2023
A library for augmenting annotated audio data

muda A library for Musical Data Augmentation. muda package implements annotation-aware musical data augmentation, as described in the muda paper. The

Brian McFee 214 Nov 22, 2022
This is an OverPowered Vc Music Player! Will work for you and play music in Voice Chatz

VcPlayer This is an OverPowered Vc Music Player! Will work for you and play music in Voice Chatz Telegram Voice-Chat Bot [PyTGCalls] ⇝ Requirements ⇜

1 Dec 20, 2021