Skip to content

Commit

Permalink
Update and document signalflow_examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Dec 3, 2023
1 parent c66d332 commit 1ad5037
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ For complete per-platform instructions and setup guides, see [Installing SignalF

## Examples

See [examples](examples) for a number of example scripts.
Several example scripts are provided in [examples](examples).

To download the `examples` folder:

```python
import signalflow_examples
signalflow_examples.download_examples()
```

## Documentation

More detailed documentation can be found at [signalflow.dev](https://signalflow.dev/).
In-depth documentation, including a reference guide to each of the Node classes, can be found at [signalflow.dev](https://signalflow.dev/).

## Node classes

Expand Down
12 changes: 12 additions & 0 deletions auxiliary/libs/signalflow_examples/signalflow_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,27 @@ def download_examples() -> None:
"sequencing-example.py",
"wavetable-2d-example.py",
]
audio_files = [
"stereo-count.wav"
]
local_dir = "examples"
local_audio_dir = os.path.join(local_dir, "audio")
os.makedirs(local_dir, exist_ok=True)
os.makedirs(local_audio_dir, exist_ok=True)
print("Downloading examples to: %s" % local_dir)

for filename in examples:
url = "%s/%s" % (url_prefix, urllib.parse.quote(filename))
output_path = os.path.join(local_dir, filename)
urllib.request.urlretrieve(url, output_path)
os.chmod(output_path, 755)
print(" - Downloaded: %s" % filename)

for filename in audio_files:
url = "%s/audio/%s" % (url_prefix, urllib.parse.quote(filename))
output_path = os.path.join(local_audio_dir, filename)
urllib.request.urlretrieve(url, output_path)

def download_notebooks() -> None:
"""
Download all example scripts from GitHub to the current directory.
Expand Down

0 comments on commit 1ad5037

Please sign in to comment.