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 Retrieval with Natural Language Queries: A Benchmark Study

Audio Retrieval with Natural Language Queries: A Benchmark Study Paper | Project page | Text-to-audio search demo This repository is the implementatio

21 Oct 31, 2022
Cobra is a highly-accurate and lightweight voice activity detection (VAD) engine.

On-device voice activity detection (VAD) powered by deep learning.

Picovoice 88 Dec 16, 2022
Vixtify - Python Controlled Music Player

Strumm Sound Playlist : Click me to listen Welcome to GitHub Pages You can use the editor on GitHub to maintain and preview the content for your websi

Vicky Kumar 2 Feb 03, 2022
Oliva music bot help to play vc music

OLIVA V2 🎵 Requirements 📝 FFmpeg NodeJS nodesource.com Python 3.7+ PyTgCalls Commands 🛠 For all in group /play - reply to youtube url or song file

SOUL々H҉A҉C҉K҉E҉R҉ 2 Oct 22, 2021
A simple voice detection system which can be applied practically for designing a device with capability to detect a baby’s cry and automatically turning on music

Auto-Baby-Cry-Detection-with-Music-Player A simple voice detection system which can be applied practically for designing a device with capability to d

2 Dec 15, 2021
voice assistant made with python that search for covid19 data(like total cases, deaths and etc) in a specific country

covid19-voice-assistant voice assistant made with python that search for covid19 data(like total cases, deaths and etc) in a specific country installi

Miguel 2 Dec 05, 2021
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 module for handling audio metadata

Mutagen is a Python module to handle audio metadata. It supports ASF, FLAC, MP4, Monkey's Audio, MP3, Musepack, Ogg Opus, Ogg FLAC, Ogg Speex, Ogg The

Quod Libet 1.1k Dec 31, 2022
Using python to generate a bat script of repetitive lines of code that differ in some way but can sort out a group of audio files according to their common names

Batch Sorting Using python to generate a bat script of repetitive lines of code that differ in some way but can sort out a group of audio files accord

David Mainoo 1 Oct 29, 2021
A tool for retrieving audio in the past

Rewinder A tool for retrieving audio in the past. Ever felt like, I need to remember that discussion which happened 10 min back. Now you can! Rewind a

Bharat 1 Jan 24, 2022
extract unpack asset file (form unreal engine 4 pak) with extenstion *.uexp which contain awb/acb (cri/cpk like) sound or music resource

Uexp2Awb extract unpack asset file (form unreal engine 4 pak) with extenstion .uexp which contain awb/acb (cri/cpk like) sound or music resource. i ju

max 6 Jun 22, 2022
❤️ This Is The EzilaXMusicPlayer Advaced Repo 🎵

Telegram EzilaXMusicPlayer Bot 🎵 A bot that can play music on telegram group's voice Chat ❤️ Requirements 📝 FFmpeg NodeJS nodesource.com Python 3.7+

Sadew Jayasekara 11 Nov 12, 2022
Pyrogram bot to automate streaming music in voice chats

Pyrogram bot to automate streaming music in voice chats Help If you face an error, want to discuss this project or get support for it, join it's group

Roj 124 Oct 21, 2022
Voice helper on russian

Voice helper on russian

KreO 1 Jun 30, 2022
Audio spatialization over WebRTC and JACK Audio Connection Kit

Audio spatialization over WebRTC Spatify provides a framework for building multichannel installations using WebRTC.

Bruno Gola 34 Jun 29, 2022
Use android as mic/speaker for ubuntu

Pulse Audio Control Panel Platforms Requirements sudo apt install ffmpeg pactl (already installed) Download Download the AppImage from release page ch

19 Dec 01, 2022
Python audio and music signal processing library

madmom Madmom is an audio signal processing library written in Python with a strong focus on music information retrieval (MIR) tasks. The library is i

Institute of Computational Perception 1k Dec 26, 2022
Suyash More 111 Jan 07, 2023
controls volume using hand gestures

controls volume using hand gestures

1 Oct 11, 2021
Algorithmic Multi-Instrumental MIDI Continuation Implementation

Matchmaker Algorithmic Multi-Instrumental MIDI Continuation Implementation Taming large-scale MIDI datasets with algorithms This is a WIP so please ch

Alex 2 Mar 11, 2022