From c64f09de38cd05cc77237028da34463843323764 Mon Sep 17 00:00:00 2001 From: duangsuse Date: Sun, 26 Apr 2020 10:08:10 +0800 Subject: [PATCH] Ver 1.2: Fix pypi mainfest deps, windows support --- README.md | 2 ++ hachiko/FluidSynth.py | 4 ++-- hachiko/synthesize.py | 7 ++++--- requirements.txt | 1 + setup.py | 8 ++++---- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index af5433e..4b1bdfe 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ The name of the project is *Hachiko*, inspired by the golden yellow Akita dog - Since version 1.1, setting up the installation using `setuptools` is required. +> For Windows installation guide, please read [this wiki](https://github.com/duangsuse-valid-projects/Hachiko/wiki/Windows-Installation) + ```bash python3 setup.py install # can be --user or sudo ``` diff --git a/hachiko/FluidSynth.py b/hachiko/FluidSynth.py index 5ab5954..63aea72 100644 --- a/hachiko/FluidSynth.py +++ b/hachiko/FluidSynth.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- from .funutils import findLibrary, createLibrary # DO NOT EDIT -#This file was generated by ./funutils.py fluidsynth.h FluidSynth libfluidsynth-1 libfluidsynth-2 libfluidsynth fluidsynth +#This file was generated by ./funutils.py fluidsynth.h FluidSynth libfluidsynth-2 libfluidsynth-1 libfluidsynth fluidsynth -lib_names = ['libfluidsynth-1', 'libfluidsynth-2', 'libfluidsynth', 'fluidsynth'] +lib_names = ['libfluidsynth-2', 'libfluidsynth-1', 'libfluidsynth', 'fluidsynth'] lib_path = findLibrary('FluidSynth', lib_names) cfunc = createLibrary(lib_path) diff --git a/hachiko/synthesize.py b/hachiko/synthesize.py index 3e87a90..43e4baa 100644 --- a/hachiko/synthesize.py +++ b/hachiko/synthesize.py @@ -4,15 +4,16 @@ from ctypes import sizeof, create_string_buffer, c_int16 from .funutils import * - -import numpy from sf2utils.sf2parse import Sf2File +try: import numpy +except ImportError: pass + drivers = ["alsa", "oss", "jack", "portaudio", "sndmgr", "coreaudio", "Direct Sound", "pulseaudio"] from .FluidSynth import * -def fluid_synth_write_s16_stereo(synth, n: int, n_channel = 2) -> numpy.ndarray: +def fluid_synth_write_s16_stereo(synth, n: int, n_channel = 2): # -> numpy.ndarray """Return generated samples in stereo 16-bit format""" buf = create_string_buffer(n*n_channel*sizeof(c_int16)) fluid_synth_write_s16(synth, n, buf, 0, n_channel, buf, 1, n_channel) diff --git a/requirements.txt b/requirements.txt index 79ab502..c501636 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ pygame>=1.8 +sf2utils>=0.9 srt>=3.0 mido>=1.2 diff --git a/setup.py b/setup.py index ca22029..bb5e271 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,8 @@ def parse_requirements(requirements): return list(filter(lambda s: s.strip() != "", items)) setup( - name="hachiko-bapu", version="0.1.1", + name="hachiko-bapu", version="0.1.2", + python_requires=">=3.5", author="duangsuse", author_email="fedora-opensuse@outlook.com", url="https://github.com/duangsuse-valid-projects/Hachiko", description="Simple pygame GUI tool for creating pitch timeline", @@ -29,17 +30,16 @@ def parse_requirements(requirements): "Topic :: Utilities" ], - python_requires=">=3.6", packages=find_packages(), + package_data={ "": ["*.sf2"] }, install_requires=parse_requirements("requirements.txt"), extras_require={ "synthesize buffer": ["numpy>=1.0"], "funutils codegen": ["pyparsing>=2.4"] }, - package_data={ "": ["*.sf2"] }, entry_points={ - "gui_scripts": ["hachiko = hachiko.hachi:main"], "console_scripts": [ + "hachiko = hachiko.hachi:main", "srt2mid = hachiko.cli_tools.srt2mid:main", "lrc_merge = hachiko.cli_tools.lrc_merge:main" ]