Skip to content

Commit

Permalink
Add signalflow_examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Nov 10, 2023
1 parent 1479245 commit f3788e8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions auxiliary/libs/signalflow_examples/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .signalflow_examples import download_notebooks
38 changes: 38 additions & 0 deletions auxiliary/libs/signalflow_examples/signalflow_examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import urllib.request
import logging
import ssl

#--------------------------------------------------------------------------------
# ignore local expired SSL certificates
#--------------------------------------------------------------------------------
ssl._create_default_https_context = ssl._create_unverified_context

logger = logging.getLogger(__name__)

def download_examples() -> None:
"""
Download all example scripts from GitHub to the current directory.
"""
url_prefix = "https://raw.githubusercontent.com/ideoforms/signalflow/master/examples/"
examples = [
"audio-through-example.py",
"buffer-play-example.py",
"chaotic-feedback-example.py",
"euclidean-rhythm-example.py",
"granulation-example.py",
"hello-world-example.py",
"karplus-strong-example.py",
"list-output-devices.py",
"midi-fm-voicer-example.py",
"midi-keyboard-example.py",
"modulation-example.py",
"sequencing-example.py",
"wavetable-2d-example.py",
]
for filename in examples:
url = "%s%s" % (url_prefix, filename)
urllib.request.urlretrieve(url, filename)
print(" - Downloaded: %s" % filename)

if __name__ == "__main__":
download_examples()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def build_extension(self, ext):
install_requires=['numpy'],
tests_require=['pytest', 'numpy', 'scipy'],
package_dir={ '': 'auxiliary/libs' },
packages=['signalflow_midi', 'signalflow-stubs'],
packages=['signalflow_midi', 'signalflow-stubs', 'signalflow_examples'],
include_package_data=True,
# signalflow-stubs contains type hint data in a .pyi file, per PEP 561
package_data={"signalflow-stubs": ["*.pyi"]},
Expand Down

0 comments on commit f3788e8

Please sign in to comment.