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
Klangbecken: The RaBe Endless Music Player

Klangbecken Klangbecken is the minimalistic endless music player for Radio Bern RaBe based on liquidsoap. It supports configurable and editable playli

Radio Bern RaBe 8 Oct 09, 2021
User-friendly Voice Cloning Application

Multi-Language-RTVC stands for Multi-Language Real Time Voice Cloning and is a Voice Cloning Tool capable of transfering speaker-specific audio featur

Sven Eschlbeck 19 Dec 30, 2022
XA Music Player - Telegram Music Bot

XA Music Player Requirements 📝 FFmpeg (Latest) NodeJS nodesource.com (NodeJS 17+) Python (3.10+) PyTgCalls (Lastest) MongoDB (3.12.1) 2nd Telegram Ac

RexAshh 3 Jun 30, 2022
A voice based calculator by using termux api in Android

termux_voice_calculator This is. A voice based calculator by using termux api in Android Instagram account 👉 👈 Requirements and installation Downloa

ʕ´•ᴥ•`ʔ╠ŞĦỮβĦa̷m̷╣ʕ´•ᴥ•`ʔ 2 Apr 29, 2022
Reading list for research topics in sound event detection

Sound event detection aims at processing the continuous acoustic signal and converting it into symbolic descriptions of the corresponding sound events present at the auditory scene.

Soham 64 Jan 05, 2023
Code for csig audio deepfake detection

FMFCC Audio Deepfake Detection Solution This repo provides an solution for the 多媒体伪造取证大赛. Our solution achieve the 1st in the Audio Deepfake Detection

BokingChen 9 Jun 04, 2022
Library for Python 3 to communicate with the Google Chromecast.

pychromecast Library for Python 3.6+ to communicate with the Google Chromecast. It currently supports: Auto discovering connected Chromecasts on the n

Home Assistant Libraries 2.4k Jan 02, 2023
Users can transcribe their favorite piano recordings to MIDI files after installation

Users can transcribe their favorite piano recordings to MIDI files after installation

190 Dec 17, 2022
Open-Source Tools & Data for Music Source Separation: A Pragmatic Guide for the MIR Practitioner

Open-Source Tools & Data for Music Source Separation: A Pragmatic Guide for the MIR Practitioner

IELab@ Korea University 0 Nov 12, 2021
Synchronize a local directory of songs' (MP3, MP4) metadata (genre, ratings) and playlists with a Plex server.

PlexMusicSync Synchronize a local directory of songs' (MP3, MP4) metadata (genre, ratings) and playlists (m3u, m3u8) with a Plex server. The song file

Tom Goetz 9 Jul 07, 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
IDing the songs played on the do you radio show

IDing the songs played on the do you radio show

Rasmus Jones 36 Nov 15, 2022
AudioDVP:Photorealistic Audio-driven Video Portraits

AudioDVP This is the official implementation of Photorealistic Audio-driven Video Portraits. Major Requirements Ubuntu = 18.04 PyTorch = 1.2 GCC =

232 Jan 03, 2023
Omniscient Mozart, being able to transcribe everything in the music, including vocal, drum, chord, beat, instruments, and more.

OMNIZART Omnizart is a Python library that aims for democratizing automatic music transcription. Given polyphonic music, it is able to transcribe pitc

MCTLab 1.3k Jan 08, 2023
A Quick Music Player Made Fully in Python

Quick Music Player Made Fully In Python. Pure Python, cross platform, single function module with no dependencies for playing sounds. Installation & S

1 Dec 24, 2021
Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications

A Python library for audio feature extraction, classification, segmentation and applications This doc contains general info. Click here for the comple

Theodoros Giannakopoulos 5.1k Jan 02, 2023
live coding in python + supercollider

live coding in python + supercollider

Zack 6 Feb 06, 2022
A Music Player Bot for Discord Servers

A Music Player Bot for Discord Servers

Halil Acar 2 Oct 25, 2021
A Python library for audio data augmentation. Inspired by albumentations. Useful for machine learning.

Audiomentations A Python library for audio data augmentation. Inspired by albumentations. Useful for deep learning. Runs on CPU. Supports mono audio a

Iver Jordal 1.2k Jan 07, 2023
Spotipy - Player de música simples em Python

Spotipy Player de música simples em Python, utilizando a biblioteca Pysimplegui para a interface gráfica. Este tocador é bastante simples em si, mas p

Adelino Almeida 4 Feb 28, 2022