Skip to content

Commit c51d956

Browse files
Release 0.9.5 work, more python3 and documentation updates.
(cherry picked from commit 04efa1edc9dba40fd20af3e36db023ed53ec7847)
1 parent 66ea49e commit c51d956

39 files changed

+361
-1199
lines changed

Diff for: .github/workflows/linux.yml renamed to .github/workflows/linux.yaml

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: linux
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
- 'release/**'
68
pull_request:
7-
branches: [ master ]
9+
branches:
10+
- master
11+
- 'release/**'
812

913
jobs:
1014
build:
@@ -19,7 +23,7 @@ jobs:
1923
sudo apt-get update && sudo apt-get -y install portaudio19-dev libao-dev python3-virtualenv
2024
python3 -m venv venv
2125
. venv/bin/activate
22-
pip install matplotlib scons
26+
pip install matplotlib scons wheel
2327
- name: Build nsound
2428
run: |
2529
. venv/bin/activate
@@ -31,4 +35,4 @@ jobs:
3135
- name: Run python tests
3236
run: |
3337
. venv/bin/activate
34-
scons --disable-libportaudio --pytest
38+
scons --pytest --disable-libportaudio --config=force

Diff for: .github/workflows/macos.yml renamed to .github/workflows/macos.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: macos
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
- 'release/**'
68
pull_request:
7-
branches: [ master ]
9+
branches:
10+
- master
11+
- 'release/**'
812

913
jobs:
1014

@@ -19,7 +23,7 @@ jobs:
1923
name: Install Python
2024
- name: Install dependencies
2125
run: |
22-
pip3 install matplotlib scons
26+
pip3 install matplotlib scons wheel
2327
- name: Build nsound
2428
run: |
2529
scons

Diff for: .github/workflows/windows.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: windows
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
- 'release/**'
68
pull_request:
7-
branches: [ master ]
9+
branches:
10+
- master
11+
- 'release/**'
812

913
jobs:
1014

@@ -19,7 +23,7 @@ jobs:
1923
name: Install Python
2024
- name: Install dependencies
2125
run: |
22-
pip3 install matplotlib scons
26+
pip3 install matplotlib scons wheel
2327
- name: Build nsound
2428
run: |
2529
scons

Diff for: ChangeLog

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ Key:
1313
+ Finished item
1414
- Planned item
1515

16+
2021-12-30 Nsound 0.9.5
17+
+ Lots of updates for building and linking with Python3
18+
+ Added github Actions to build on Linux, MacOs and Windows
19+
+ Added FilterMedian
20+
+ Updated Plotter to use latest matplotlib.pyplot
21+
+ Added an Intersteller inspired example: src/examples/interstellar.cc
22+
23+
1624
2015-08-23 Nsound 0.9.4
1725

1826
+ C++11 now required for compiling Nsound

Diff for: README.rst

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
.. image:: https://github.com/weegreenblobbie/nsound/workflows/linux/badge.svg
2-
:target: https://github.com/weegreenblobbie/nsound/actions?query=workflow%3Alinux
1+
.. image:: https://github.com/weegreenblobbie/nsound/actions/workflows/linux.yaml/badge.svg?branch=release/0.9.5
2+
:target: https://github.com/weegreenblobbie/nsound/actions/workflows/linux.yaml?query=workflow%3Alinux+branch%3Arelease%2F0.9.5
33
:alt: Github Actions
44

5-
.. image:: https://github.com/weegreenblobbie/nsound/workflows/macos/badge.svg
6-
:target: https://github.com/weegreenblobbie/nsound/actions?query=workflow%3Amacos
5+
.. image:: https://github.com/weegreenblobbie/nsound/actions/workflows/macos.yaml/badge.svg?branch=release/0.9.5
6+
:target: https://github.com/weegreenblobbie/nsound/actions/workflows/macos.yaml?query=workflow%3Amacos+branch%3Arelease%2F0.9.5
77
:alt: Github Actions
88

9-
.. image:: https://github.com/weegreenblobbie/nsound/workflows/windows/badge.svg
10-
:target: https://github.com/weegreenblobbie/nsound/actions?query=workflow%3Awindows
9+
.. image:: https://github.com/weegreenblobbie/nsound/actions/workflows/windows.yaml/badge.svg?query=branch:release/0.9.5
10+
:target: https://github.com/weegreenblobbie/nsound/actions/workflows/windows.yaml?query=workflow:windows+branch:release/0.9.5
1111
:alt: Github Actions
1212

1313
Nsound, a C++ framework for synthesizing sound
1414
==============================================
1515

1616
.. hyper link references
1717
18-
.. _`Nsound Homepage`: http://nsound.sourceforge.net/
19-
.. _`Nsound User's Guide`: http://nsound.sourceforge.net/users_guide/
20-
.. _`Nsound Doxygen Reference`: http://nsound.sourceforge.net/doxygen/index.html
18+
.. _`Nsound Homepage`: https://github.com/weegreenblobbie/nsound
19+
.. _`Nsound User's Guide`: https://weegreenblobbie.com/nsound/user_guide/index.html
20+
.. _`Nsound Doxygen Reference`: https://weegreenblobbie.com/nsound/doxygen/index.html
2121

2222
.. _`Introduction & Bebot`: https://www.youtube.com/watch?v=j4uLvl68PtI
23-
.. _`bebot.py`: http://sourceforge.net/p/nsound/code/HEAD/tree/branch/nsound-dev-weegreenblobbie/src/examples/bebot.py
23+
.. _`bebot.py`: https://github.com/weegreenblobbie/nsound/blob/master/src/examples/bebot.py
2424

2525
.. _`Oscilloscope`: https://www.youtube.com/watch?v=ORnQVFpdSoA
26-
.. _`make_oscilloscope_video.py`: http://sourceforge.net/p/nsound/code/HEAD/tree/branch/nsound-dev-weegreenblobbie/src/examples/make_oscilloscope_video.py
26+
.. _`make_oscilloscope_video.py`: https://github.com/weegreenblobbie/nsound/blob/master/src/examples/make_oscilloscope_video.py
2727

2828
.. _`Moog VCF & Delayline`: https://www.youtube.com/watch?v=9m3KA6JBDH8
29-
.. _`moogvcf-rt.py`: http://sourceforge.net/p/nsound/code/HEAD/tree/branch/nsound-dev-weegreenblobbie/src/examples/moogvcf-rt.py
30-
.. _`delayline-rt.py`: http://sourceforge.net/p/nsound/code/HEAD/tree/branch/nsound-dev-weegreenblobbie/src/examples/delayline-rt.py
29+
.. _`moogvcf-rt.py`: https://github.com/weegreenblobbie/nsound/blob/master/src/examples/moogvcf-rt.py
30+
.. _`delayline-rt.py`: https://github.com/weegreenblobbie/nsound/blob/master/src/examples/delayline-rt.py
3131

3232
.. _`Tape Deck`: https://www.youtube.com/watch?v=Al6aHlwyEuA
33-
.. _`tapedeck-rt.py`: http://sourceforge.net/p/nsound/code/HEAD/tree/branch/nsound-dev-weegreenblobbie/src/examples/tapedeck-rt.py
33+
.. _`tapedeck-rt.py`: https://github.com/weegreenblobbie/nsound/blob/master/src/examples/tapedeck-rt.py
3434

3535

3636
Important Links
@@ -59,5 +59,5 @@ If you're on Windows, OS X, or Linux:
5959

6060
.. code-block:: bash
6161
62-
pip install nsound --user
62+
python3 -m pip install Nsound
6363

Diff for: SConstruct

+10-52
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ VERSION_A = "0"
4040
VERSION_B = "9"
4141
VERSION_C = "5"
4242

43-
DEVELOPMENMT = True
43+
DEVELOPMENMT = False
4444

4545
PACKAGE_VERSION = "%s.%s.%s" % (VERSION_A, VERSION_B, VERSION_C)
4646

4747
if DEVELOPMENMT:
48-
PACKAGE_VERSION += ".dev1"
48+
PACKAGE_VERSION += ".dev10"
4949

5050
PACKAGE_RELEASE = PACKAGE_NAME + "-" + PACKAGE_VERSION
5151

@@ -184,11 +184,14 @@ if GetOption("pytest"):
184184
commands = [
185185
["scons", "-c"],
186186
build_cmd,
187-
["python", "setup_builder.py", "install"],
187+
["python", "setup_builder.py", "bdist_wheel"],
188+
["python", "-m", "pip", "install", "--isolated", "--ignore-installed", "dist/*"],
188189
["python", "-m", "unittest", "discover"],
189190
]
190191

191192
for cmd in commands:
193+
if cmd[-1] == "dist/*":
194+
cmd[-1] = glob.glob("dist/*")[0]
192195
print(" " + str(cmd))
193196
subprocess.check_call(cmd)
194197

@@ -549,15 +552,17 @@ if not nsound_config.env.GetOption("help"):
549552
#--------------------------------------------------------------------------
550553
# Extra Cleaning
551554

555+
nsound_config.env.Clean(libNsound, "Nsound.egg-info")
552556
nsound_config.env.Clean(libNsound, "Nsound.py")
553-
nsound_config.env.Clean(libNsound, "swig/Nsound.py")
557+
nsound_config.env.Clean(libNsound, "__pycache__")
554558
nsound_config.env.Clean(libNsound, "bin")
555559
nsound_config.env.Clean(libNsound, "build")
556560
nsound_config.env.Clean(libNsound, "dist")
557561
nsound_config.env.Clean(libNsound, "docs/user_guide/build/doctrees")
558562
nsound_config.env.Clean(libNsound, "docs/user_guide/build/html")
559563
nsound_config.env.Clean(libNsound, "docs/user_guide/build/plot_directive")
560564
nsound_config.env.Clean(libNsound, "lib")
565+
nsound_config.env.Clean(libNsound, "swig/Nsound.py")
561566
nsound_config.env.Clean(libNsound, "swig/nsound_wrap.cxx")
562567
nsound_config.env.Clean(libNsound, "swig/nsound_wrap.os")
563568
nsound_config.env.Clean(libNsound, doxyfile)
@@ -570,8 +575,8 @@ if not nsound_config.env.GetOption("help"):
570575
nsound_config.env.Clean(libNsound, glob.glob("src/examples/Temperature_out.wav"))
571576
nsound_config.env.Clean(libNsound, glob.glob("src/examples/example*.wav"))
572577
nsound_config.env.Clean(libNsound, glob.glob("src/examples/mynameis-*.wav"))
573-
nsound_config.env.Clean(libNsound, glob.glob("src/test/*.wav"))
574578
nsound_config.env.Clean(libNsound, glob.glob("src/test/*.obj"))
579+
nsound_config.env.Clean(libNsound, glob.glob("src/test/*.wav"))
575580
nsound_config.env.Clean(libNsound, nsound_h)
576581
nsound_config.env.Clean(libNsound, setup_builder_py)
577582
nsound_config.env.Clean(libNsound, unit_tests)
@@ -598,51 +603,4 @@ if not nsound_config.env.GetOption("help"):
598603

599604
nsound_config.env.Alias("install", [nsound_config.env['NS_BINDIR'], nsound_config.env['NS_LIBDIR']])
600605

601-
#--------------------------------------------------------------------------
602-
# Setup Tar and Zip
603-
604-
EXCLUDE_EXTENSIONS = [
605-
#~ ".a", need to include mingw32 libs
606-
".cache",
607-
".cvsignore",
608-
".dblite",
609-
".dll",
610-
".gz",
611-
".jpg",
612-
".log",
613-
".mp3",
614-
".o",
615-
".os",
616-
".png",
617-
".pyc",
618-
".so",
619-
".tar",
620-
".tmp",
621-
".zip",
622-
"core",
623-
"~"
624-
]
625-
626-
EXCLUDE_DIRS = [
627-
".svn",
628-
".sconf_temp",
629-
"./bin",
630-
"./lib",
631-
"./docs/user_guide/build",
632-
"./msw"
633-
]
634-
635-
if 'release' in COMMAND_LINE_TARGETS:
636-
if(use_disttar):
637-
nsound_config.env['DISTTAR_FORMAT']='gz'
638-
639-
nsound_config.env.Append(\
640-
DISTTAR_EXCLUDE_EXTS = EXCLUDE_EXTENSIONS,
641-
DISTTAR_EXCLUDE_DIRS = EXCLUDE_DIRS)
642-
643-
tar = env.DistTar(PACKAGE_RELEASE + ".tar.gz", [nsound_config.env.Dir(".")])
644-
645-
nsound_config.env.Alias("release", tar)
646-
647-
648606
# :mode=python:

Diff for: docs/reference/Doxyfile.in

+1
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@ PDF_HYPERLINKS = NO
10851085
# higher quality PDF documentation.
10861086

10871087
USE_PDFLATEX = NO
1088+
USE_MATHJAX = YES
10881089

10891090
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
10901091
# command to the generated LaTeX files. This will instruct LaTeX to keep
File renamed without changes.
File renamed without changes.

Diff for: docs/user_guide/my/pyexec_directive.py

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
"""
2+
$Id: pyexec_directive.py 589 2010-12-18 11:13:05Z weegreenblobbie $
3+
4+
This Sphinx extentsion allows one to inline python code and have it execute,
5+
the results of the code snippit should be stored in a string with the name
6+
template.
7+
8+
For example, to embed the current date and time, to the following.
9+
10+
.. pyexec::
11+
12+
from datetime import datetime
13+
template = "%s" % datetime.now()
14+
15+
Larger strings can be made using Python's tripple quote syntax.
16+
17+
.. pyexec::
18+
19+
frome datetime import datetime
20+
21+
template = '''
22+
This text will get inserted into the document at the pyexec directive
23+
above. Inline code can all be used::
24+
25+
print("I love Python, the current time is %s"''' % datetime.now())
26+
27+
"""
28+
import sys
29+
30+
from docutils.parsers.rst import Directive
31+
32+
class PyExec(Directive):
33+
34+
has_content = True
35+
required_arguments = 0
36+
optional_arguments = 0
37+
38+
def run(self):
39+
40+
py_code = "\n".join(self.content)
41+
42+
globals_ = globals()
43+
locals_ = locals()
44+
45+
try:
46+
exec(py_code, globals_, locals_)
47+
template = locals_['template']
48+
49+
except Exception as e:
50+
message = f"""
51+
52+
ERROR: An exception occured during the evaluation of the pyexec directive
53+
54+
The offending code was:
55+
56+
{py_code}
57+
58+
"""
59+
sys.stderr.write(message)
60+
sys.stderr.flush()
61+
raise
62+
63+
lines = ["%s" % row.rstrip() for row in template.split('\n')]
64+
self.state_machine.insert_input(
65+
lines, self.state_machine.input_lines.source(0))
66+
67+
return []
68+
69+
70+
def setup(app):
71+
app.add_directive('pyexec', PyExec, True)
72+

Diff for: docs/user_guide/source/_static/bebot-rt.wav

1.66 MB
Binary file not shown.

Diff for: docs/user_guide/source/_static/piano-rt.wav

711 KB
Binary file not shown.

0 commit comments

Comments
 (0)