Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ideoforms/signalflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Feb 16, 2025
2 parents 9992308 + 7f665ce commit 1f8ea21
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
# used a different build path to the .so file as located in tests/__init__.py
# 2024-07-29: Require importlib_metadata for now due to this:
# https://github.com/pypa/setuptools/issues/4478
sudo pip3 install -U pytest numpy scipy setuptools>=62.1.0 importlib_metadata
# 2025-02-06: Require packaging version due to this:
# https://github.com/pypa/setuptools/issues/4501
sudo pip3 install -U pytest numpy scipy setuptools>=62.1.0 importlib_metadata packaging>=24.1
curl https://raw.githubusercontent.com/mackron/miniaudio/master/miniaudio.h -o source/include/signalflow/node/io/output/miniaudio-library.h
- name: Configure
run: mkdir build && cd build && cmake ..
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Building from source assumes that you have a working installation of Python 3, i
To build on macOS from source, install dependencies with Homebrew:
```
brew install cmake libsndfile
curl https://raw.githubusercontent.com/mackron/miniaudio/master/miniaudio.h -o source/include/signalflow/node/io/output/miniaudio-library.h
```

Clone this repository, then build and install with `pip`:
Expand All @@ -37,6 +38,7 @@ To build the Python library from source on Linux, install dependencies with apt:
```
# If on Raspberry Pi: libfftw3-dev
apt-get install -y git cmake g++ python3-pip libasound2-dev libsndfile1-dev fftw3-dev
curl https://raw.githubusercontent.com/mackron/miniaudio/master/miniaudio.h -o source/include/signalflow/node/io/output/miniaudio-library.h
```

Clone this repository, then build and install with `pip`:
Expand Down
1 change: 1 addition & 0 deletions auxiliary/cibuildwheel/make-raspberry-pi-aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#
# May be ultimately better to switch to this arm runner action:
# https://github.com/pguyot/arm-runner-action
# Or at least cibuildwheel
#--------------------------------------------------------------------------------

# Fail if any subcommands fail
Expand Down
28 changes: 28 additions & 0 deletions auxiliary/cibuildwheel/make-windows-amd64.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python

import os
import re
import glob
import subprocess

os.environ["CIBW_BUILD"] = "cp*-win_amd64"
os.environ["CIBW_ARCHS_WINDOWS"] = "AMD64"
os.environ["CIBW_BUILD_VERBOSITY"] = "1"

rv = subprocess.call(["python", "-m", "cibuildwheel"])
if rv == 0:
os.chdir("wheelhouse")
wheels = glob.glob("*.whl")
for wheel in wheels:
print(" - %s" % wheel)
# NOTE: cibuildwheel seemed to be formerly creating wheels labelled
# as -win32, this conditional is to catch and correct this.
if re.search("-win32.whl", wheel):
wheel_corrected = re.sub("-win32.whl", "-win_amd64.whl", wheel)
os.rename(wheel, wheel_corrected)
wheel = wheel_corrected
print(" - renamed to %s" % wheel)
print(" - running delvewheel")
subprocess.call(["python", "-m", "delvewheel", "repair", wheel, "--add-path", "dlls"])
else:
print("Failed to run python -m cibuildwheel")
4 changes: 2 additions & 2 deletions auxiliary/libs/signalflow_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def main():
# --------------------------------------------------------------------------------
test = subparsers.add_parser('test', help='play a test tone')
test.add_argument('--gain', type=float, help='tone level, in dB (default: -12)', default=-12)
test.add_argument('--channels', '-c', type=int, help='number of channels to output, in sequence')
test.add_argument('--channels', '-c', type=int, help='number of channels to output, in sequence', default=1)
test.add_argument('--frequency', type=float, help='tone frequency, in Hz (default: 440)', default=440)
test.add_argument('--backend-name', type=str,
help='name of audio backend to use (default: system default backend)', default=None)
Expand Down Expand Up @@ -185,7 +185,7 @@ def main():
elif args.command == 'version':
run_version()
elif args.command == 'test':
run_test(args.frequency, args.gain, args.backend_name, args.output_device_name)
run_test(args.frequency, args.gain, args.channels, args.backend_name, args.output_device_name)
elif args.command == 'list-output-device-names':
run_list_output_device_names(args.backend_name)
elif args.command == 'list-input-device-names':
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = signalflow
version = 0.5.1
version = 0.5.2
author = Daniel Jones
author_email = dan@erase.net
description = SignalFlow is a sound synthesis library designed for clear and concise expression of sonic ideas
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def build_extension(self, ext):
# --------------------------------------------------------------------------------
if os.name == "nt":
libname = "signalflow.pyd"
shutil.copy(os.path.join(self.build_temp, cfg, libname), "auxiliary/libs/signalflow")
dll_path = os.path.join(self.build_temp, cfg, libname)
shutil.copy(dll_path, "%s/signalflow" % extdir)


signalflow_packages = [
Expand Down
2 changes: 1 addition & 1 deletion source/src/node/io/output/miniaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void AudioOut::init()
// On Core Audio, let the application select a preferred sample rate.
config.coreaudio.allowNominalSampleRateChange = 1;

rv = ma_device_init(NULL, &config, &device);
rv = ma_device_init(&this->context, &config, &device);
if (rv != MA_SUCCESS)
{
throw audio_io_exception("miniaudio: Error initialising output device");
Expand Down

0 comments on commit 1f8ea21

Please sign in to comment.