Skip to content

Commit 7db13a7

Browse files
authored
Merge pull request #4 from yuma-m/release/v0.1.5
Release/v0.1.5
2 parents 32e22d2 + 016009c commit 7db13a7

File tree

7 files changed

+38
-18
lines changed

7 files changed

+38
-18
lines changed

.travis.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1+
dist: xenial
12
language: python
23
python:
34
- "2.7"
45
- "3.4"
56
- "3.5"
6-
- "3.5-dev" # 3.5 development branch
77
- "3.6"
8-
- "3.6-dev" # 3.6 development branch
9-
# scipy is not supported
10-
# - "3.7-dev" # 3.7 development branch
11-
# - "nightly"
128

139
before_install:
1410
- sudo apt-get -qq update
1511
- sudo apt-get install -y portaudio19-dev
1612

1713
install:
1814
- pip install -r requirements.txt
19-
- python setup.py develop
15+
- pip install .
2016

2117
script:
2218
- python setup.py test
19+
20+
deploy:
21+
provider: pypi
22+
user: yuma-m
23+
password:
24+
secure: qjpVeA6X06tcuOtaFqoVD9fnbxRW4OGRrP/0bIqCdxj9HoDBPCJkgvcxVSrAzB+4ejsPPvIuqBdtnbcCkYmq+tpsK2Gh8HVU/XBSE0jF4luwKgMvHIh0WxsxgtWjft0tlD14kfGES5zIOyd3Jqz7f7BA+tg+jIn16eysEjysphM2rzlorQdiDfvtvILJZ7NvuCPvV4XD+vVdzzJll5f8Ps9F/Y/F9/nvFjXK1c5+OOrc47o3i/0fA711dcw9h4oho9CNcp904gaEiwtOxTGkAAuxlHSqiD1/aZ3XHKnmEyV00UZlndZXNFjhEqXoGi7QZihO3B0Zf4FbMvydSRzEuPUgqoVaNkLwDN6vr2m9RU9Z8VnkUwgOlqp3QlHF7sOSd1BtjgAmCdctdzjWlHDxwnytP4mgcZsHLb+LHs7k6k2KUtnp7TX2F9EDP/I2u+g3SrgbORkOec0ULFyih4pIhGrGfNwRFVnwaRWRiHGvEpo1GG3EQ+UKJt+o4MEmR23ZSXm2/gOZmpO9sFf/bJsXEm79VSGcmgm3Lxe5Lzdz2GJKFhTZE2VtVrHBY95Uy8TVZPPy1KmrjFEqcoh0Kix5+s0p9oNs+6gpqYpRR5PJOWtK53fyvw/2NQAmeNJ3DTEmfrtbXFiDM4ud8tmt76DxIaJV3jlTvFF8Og27tkwHNxU=
25+
on:
26+
python: 3.6
27+
tags: true

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.1.5
2+
3+
- Support triangle wave.
4+
- Contributor: @AntiMatterAMA
5+
16
## 0.1.4
27

38
- Fix channels of Player class from 2 to 1 to play proper sound.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $ pip install pyaudio
7171

7272
## Supported OS
7373

74-
- macOS Sierra
74+
- macOS 10.12 and above
7575
- Ubuntu 16.04
7676

7777
## Supported versions

example/play_440hz.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ def main():
2020
player.play_wave(synthesizer.generate_constant_wave(440.0, 3.0))
2121
time.sleep(0.5)
2222

23+
print("play triangle wave")
24+
synthesizer = Synthesizer(osc1_waveform=Waveform.triangle, osc1_volume=0.8, use_osc2=False)
25+
player.play_wave(synthesizer.generate_constant_wave(440.0, 3.0))
26+
time.sleep(0.5)
27+
2328
print("play synthesized wave 1")
2429
synthesizer = Synthesizer(
2530
osc1_waveform=Waveform.sawtooth, osc1_volume=1.0,

setup.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
from setuptools import setup, find_packages
2-
version = '0.1.4'
3-
4-
try:
5-
import pypandoc
6-
read_md = lambda f: pypandoc.convert(f, 'rst')
7-
except ImportError:
8-
print("warning: pypandoc module not found, could not convert Markdown to RST")
9-
read_md = lambda f: open(f, 'r').read()
2+
version = '0.1.5'
103

114
setup(
125
name='synthesizer',
@@ -28,7 +21,8 @@
2821
packages=find_packages(exclude=['test']),
2922
include_package_data=True,
3023
zip_safe=True,
31-
long_description=read_md('README.md'),
24+
long_description=open('README.md').read(),
25+
long_description_content_type='text/markdown',
3226
test_suite='nose.collector',
3327
install_requires=[
3428
'enum34>=1.1.6',

synthesizer/synthesizer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ def generate_wave(self, phases):
4545
phases = np.copy(phases) * self._freq_transpose
4646
return self._volume * self._wave_func(phases)
4747

48-
def gen_triang(self,t,width=0.5):
49-
return scipy.signal.sawtooth(t,width)
48+
@staticmethod
49+
def gen_triang(t, width=0.5):
50+
return scipy.signal.sawtooth(t, width)
51+
5052

5153
class Synthesizer(object):
5254
u""" Virtual analog synthesizer object

test/test_synthesizer.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,12 @@ def test_square_wave():
3131
assert_almost_equal(wave.max(), 1.0, places=3)
3232
assert_almost_equal(wave.min(), -1.0, places=3)
3333
assert_almost_equal(wave.mean(), 0.0, places=3)
34+
35+
36+
def test_triangle_wave():
37+
synthesizer = Synthesizer(osc1_waveform=Waveform.triangle, osc1_volume=1.0, use_osc2=False, rate=RATE)
38+
wave = synthesizer.generate_constant_wave(440.0, 1.0)
39+
eq_(wave.size, RATE)
40+
assert_almost_equal(wave.max(), 1.0, places=3)
41+
assert_almost_equal(wave.min(), -1.0, places=3)
42+
assert_almost_equal(wave.mean(), 0.0, places=3)

0 commit comments

Comments
 (0)