haybale-audio 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. haybale_audio-0.4.0/.gitignore +228 -0
  2. haybale_audio-0.4.0/PKG-INFO +13 -0
  3. haybale_audio-0.4.0/README.md +26 -0
  4. haybale_audio-0.4.0/haybale_audio/OVERVIEW.md +22 -0
  5. haybale_audio-0.4.0/haybale_audio/QUICKREF.md +19 -0
  6. haybale_audio-0.4.0/haybale_audio/__init__.py +33 -0
  7. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.AudioClockNode.md +36 -0
  8. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.AudioEventNode.md +35 -0
  9. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.AudioMixerNode.md +47 -0
  10. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.ChannelMergeNode.md +21 -0
  11. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.ChannelSelectNode.md +21 -0
  12. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.ChannelSplitNode.md +21 -0
  13. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.DeviceOutNode.md +45 -0
  14. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.FilePlayerNode.md +38 -0
  15. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.MixToMonoNode.md +17 -0
  16. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.ReblockNode.md +37 -0
  17. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.RecorderNode.md +32 -0
  18. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.node.ResampleNode.md +39 -0
  19. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.type.AUDIO.md +15 -0
  20. haybale_audio-0.4.0/haybale_audio/docs/haybale-audio.type.CALLBACK_AUDIO.md +24 -0
  21. haybale_audio-0.4.0/haybale_audio/dsp/__init__.py +0 -0
  22. haybale_audio-0.4.0/haybale_audio/dsp/buffer.py +82 -0
  23. haybale_audio-0.4.0/haybale_audio/dsp/channels.py +90 -0
  24. haybale_audio-0.4.0/haybale_audio/dsp/fifo.py +79 -0
  25. haybale_audio-0.4.0/haybale_audio/dsp/mix.py +21 -0
  26. haybale_audio-0.4.0/haybale_audio/dsp/reblock.py +44 -0
  27. haybale_audio-0.4.0/haybale_audio/dsp/resample.py +74 -0
  28. haybale_audio-0.4.0/haybale_audio/emitter.py +95 -0
  29. haybale_audio-0.4.0/haybale_audio/haybale.toml +13 -0
  30. haybale_audio-0.4.0/haybale_audio/io/__init__.py +0 -0
  31. haybale_audio-0.4.0/haybale_audio/io/device.py +234 -0
  32. haybale_audio-0.4.0/haybale_audio/io/files.py +81 -0
  33. haybale_audio-0.4.0/haybale_audio/nodes/__init__.py +0 -0
  34. haybale_audio-0.4.0/haybale_audio/nodes/audio_clock.py +116 -0
  35. haybale_audio-0.4.0/haybale_audio/nodes/audio_event.py +97 -0
  36. haybale_audio-0.4.0/haybale_audio/nodes/audio_mixer.py +200 -0
  37. haybale_audio-0.4.0/haybale_audio/nodes/channel_merge.py +65 -0
  38. haybale_audio-0.4.0/haybale_audio/nodes/channel_select.py +43 -0
  39. haybale_audio-0.4.0/haybale_audio/nodes/channel_split.py +71 -0
  40. haybale_audio-0.4.0/haybale_audio/nodes/device_out.py +151 -0
  41. haybale_audio-0.4.0/haybale_audio/nodes/file_player.py +137 -0
  42. haybale_audio-0.4.0/haybale_audio/nodes/reblock.py +93 -0
  43. haybale_audio-0.4.0/haybale_audio/nodes/recorder.py +88 -0
  44. haybale_audio-0.4.0/haybale_audio/nodes/resample.py +112 -0
  45. haybale_audio-0.4.0/haybale_audio/nodes/to_mono.py +30 -0
  46. haybale_audio-0.4.0/haybale_audio/py.typed +0 -0
  47. haybale_audio-0.4.0/haybale_audio/types/__init__.py +0 -0
  48. haybale_audio-0.4.0/haybale_audio/types/audio.py +53 -0
  49. haybale_audio-0.4.0/haybale_audio/types/callback.py +31 -0
  50. haybale_audio-0.4.0/haybale_audio/value/__init__.py +3 -0
  51. haybale_audio-0.4.0/haybale_audio/value/audio_block.py +44 -0
  52. haybale_audio-0.4.0/pyproject.toml +26 -0
@@ -0,0 +1,228 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # The MANIFEST/*.manifest packaging-artifact rules above are unanchored and
36
+ # (on a case-insensitive filesystem) also match our real, tracked
37
+ # haywire_studio/share/manifest/ package — un-ignore it explicitly.
38
+ !packages/haywire-studio/src/haywire_studio/share/manifest/
39
+
40
+ # Installer logs
41
+ pip-log.txt
42
+ pip-delete-this-directory.txt
43
+
44
+ # Unit test / coverage reports
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py,cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+ db.sqlite3-journal
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ .pybuilder/
81
+ target/
82
+
83
+ # Jupyter Notebook
84
+ .ipynb_checkpoints
85
+
86
+ # IPython
87
+ profile_default/
88
+ ipython_config.py
89
+
90
+ # pyenv
91
+ # For a library or package, you might want to ignore these files since the code is
92
+ # intended to run in multiple environments; otherwise, check them in:
93
+ # .python-version
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ #Pipfile.lock
101
+
102
+ # UV
103
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
104
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
105
+ # commonly ignored for libraries.
106
+ #uv.lock
107
+
108
+ # poetry
109
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
110
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
111
+ # commonly ignored for libraries.
112
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
113
+ #poetry.lock
114
+
115
+ # pdm
116
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117
+ #pdm.lock
118
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
119
+ # in version control.
120
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
121
+ .pdm.toml
122
+ .pdm-python
123
+ .pdm-build/
124
+
125
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
126
+ __pypackages__/
127
+
128
+ # Celery stuff
129
+ celerybeat-schedule
130
+ celerybeat.pid
131
+
132
+ # SageMath parsed files
133
+ *.sage.py
134
+
135
+ # Environments
136
+ **/.env
137
+ .venv
138
+ env/
139
+ venv/
140
+ ENV/
141
+ env.bak/
142
+ venv.bak/
143
+
144
+ # Spyder project settings
145
+ .spyderproject
146
+ .spyproject
147
+
148
+ # Rope project settings
149
+ .ropeproject
150
+
151
+ # mkdocs documentation
152
+ /site
153
+
154
+ # mypy
155
+ .mypy_cache/
156
+ .dmypy.json
157
+ dmypy.json
158
+
159
+ # Pyre type checker
160
+ .pyre/
161
+
162
+ # pytype static type analyzer
163
+ .pytype/
164
+
165
+ # Cython debug symbols
166
+ cython_debug/
167
+
168
+ # PyCharm
169
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
170
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
171
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
172
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
173
+ .idea/
174
+
175
+ # Abstra
176
+ # Abstra is an AI-powered process automation framework.
177
+ # Ignore directories containing user credentials, local state, and settings.
178
+ # Learn more at https://abstra.io/docs
179
+ .abstra/
180
+
181
+ # Visual Studio Code
182
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
183
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
184
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
185
+ # you could uncomment the following to ignore the enitre vscode folder
186
+ .vscode/
187
+
188
+ # Ruff stuff:
189
+ .ruff_cache/
190
+
191
+ # PyPI configuration file
192
+ .pypirc
193
+
194
+ # Cursor
195
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
196
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
197
+ # refer to https://docs.cursor.com/context/ignore-files
198
+ .cursorignore
199
+ .cursorindexingignore
200
+
201
+ .DS_Store
202
+ saves/*.*
203
+
204
+ # Dev-mode graphs (local testing only, not part of the repo)
205
+ graphs/*.json
206
+ # MkDocs build output
207
+ site/
208
+
209
+ # Baked docs for the haywire-core wheel (generated by scripts/bake_docs.py;
210
+ # force-included into the wheel at build time). The *contents* are never
211
+ # committed, but the directory itself is kept via a committed .gitkeep so the
212
+ # hatchling force-include target exists in a fresh checkout — otherwise every
213
+ # editable install (`uv sync`) fails the build on a missing force-include path.
214
+ packages/haywire-core/src/haywire/_baked_docs/*
215
+ !packages/haywire-core/src/haywire/_baked_docs/.gitkeep
216
+
217
+ # Local git worktrees (claude-code workflow)
218
+ .worktrees/
219
+
220
+ # Haywire project config (user-local, not repo state)
221
+ .haywire/
222
+
223
+ # Local symlinks to external dev projects (machine-specific paths)
224
+ barn/haybale-visiongraph
225
+ barn/haybale-spandrel
226
+ barn/haybale-stream
227
+
228
+ assets/*
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.5
2
+ Name: haybale-audio
3
+ Version: 0.4.0
4
+ Summary: Audio blocks, events and routing shared by speech and streaming libraries
5
+ License: MIT
6
+ Keywords: audio
7
+ Requires-Python: >=3.12
8
+ Requires-Dist: haybale-core>=0.4.0
9
+ Requires-Dist: haywire-core>=0.4.0
10
+ Requires-Dist: numpy
11
+ Requires-Dist: samplerate>=0.2.4
12
+ Requires-Dist: sounddevice>=0.5
13
+ Requires-Dist: soundfile>=0.12
@@ -0,0 +1,26 @@
1
+ # Audio
2
+
3
+ <!-- marketstall:share-url:start -->
4
+ *Subscribe URL not yet published — run `uv run --frozen haywire share --bump patch`.*
5
+ <!-- marketstall:share-url:end -->
6
+
7
+ Audio blocks, events and routing shared by speech and streaming libraries
8
+
9
+ ## Nodes
10
+ ### Audio
11
+ - **Audio Clock** — Emits a silent audio block at a steady rate
12
+ - **Audio Event** — Triggered for each audio block a connected audio emitter delivers
13
+ - **Audio Mixer** — Sums several audio sources into one block per clock tick
14
+ - **Channel Merge** — Stacks audio blocks into one block with all their channels
15
+ - **Channel Select** — Picks, reorders or repeats the channels of an audio block
16
+ - **Channel Split** — Gives each channel of an audio block its own output
17
+ - **Device Out** — Plays audio blocks on a sound device
18
+ - **File Player** — Plays an audio file as audio blocks, in real time
19
+ - **Mix to Mono** — Averages all channels of an audio block into one
20
+ - **Reblock** — Re-cuts audio blocks to a fixed size and delivers them to Audio Event nodes
21
+ - **Recorder** — Writes audio blocks to a file
22
+ - **Resample** — Converts audio blocks to another sample rate and delivers them to Audio Event nodes
23
+
24
+ ## Types
25
+ - **Audio** — A block of audio samples. Never saved with the graph.
26
+ - **Callback Audio** — Subscription for emitters that deliver audio blocks
@@ -0,0 +1,22 @@
1
+ # Audio
2
+
3
+ Audio blocks, events and routing shared by speech and streaming libraries
4
+
5
+ ## Nodes
6
+ ### Audio
7
+ - **Audio Clock** — Emits a silent audio block at a steady rate
8
+ - **Audio Event** — Triggered for each audio block a connected audio emitter delivers
9
+ - **Audio Mixer** — Sums several audio sources into one block per clock tick
10
+ - **Channel Merge** — Stacks audio blocks into one block with all their channels
11
+ - **Channel Select** — Picks, reorders or repeats the channels of an audio block
12
+ - **Channel Split** — Gives each channel of an audio block its own output
13
+ - **Device Out** — Plays audio blocks on a sound device
14
+ - **File Player** — Plays an audio file as audio blocks, in real time
15
+ - **Mix to Mono** — Averages all channels of an audio block into one
16
+ - **Reblock** — Re-cuts audio blocks to a fixed size and delivers them to Audio Event nodes
17
+ - **Recorder** — Writes audio blocks to a file
18
+ - **Resample** — Converts audio blocks to another sample rate and delivers them to Audio Event nodes
19
+
20
+ ## Types
21
+ - **Audio** — A block of audio samples. Never saved with the graph.
22
+ - **Callback Audio** — Subscription for emitters that deliver audio blocks
@@ -0,0 +1,19 @@
1
+ # haybale-audio — component index (v0.4.0)
2
+
3
+ ## node
4
+ - `haybale-audio:node:AudioClockNode` — Audio Clock — Emits a silent audio block at a steady rate _tags: audio, clock, tick, timer, master, pace, emit_
5
+ - `haybale-audio:node:AudioEventNode` — Audio Event — Triggered for each audio block a connected audio emitter delivers _tags: audio, block, event, callback, receive, stream, microphone_
6
+ - `haybale-audio:node:AudioMixerNode` — Audio Mixer — Sums several audio sources into one block per clock tick _tags: audio, mixer, mix, sum, gain, mute, combine, bus_
7
+ - `haybale-audio:node:ChannelMergeNode` — Channel Merge — Stacks audio blocks into one block with all their channels _tags: audio, channel, merge, combine, stack, join, multichannel_
8
+ - `haybale-audio:node:ChannelSelectNode` — Channel Select — Picks, reorders or repeats the channels of an audio block _tags: audio, channel, select, route, map, left, right, stereo, mono_
9
+ - `haybale-audio:node:ChannelSplitNode` — Channel Split — Gives each channel of an audio block its own output _tags: audio, channel, split, separate, left, right, mono, multichannel_
10
+ - `haybale-audio:node:DeviceOutNode` — Device Out — Plays audio blocks on a sound device _tags: audio, play, speaker, output, device, sound_
11
+ - `haybale-audio:node:FilePlayerNode` — File Player — Plays an audio file as audio blocks, in real time _tags: audio, file, play, wav, flac, ogg, read, emit_
12
+ - `haybale-audio:node:MixToMonoNode` — Mix to Mono — Averages all channels of an audio block into one _tags: audio, mono, mix, downmix, average, stereo_
13
+ - `haybale-audio:node:ReblockNode` — Reblock — Re-cuts audio blocks to a fixed size and delivers them to Audio Event nodes _tags: audio, reblock, block, size, buffer, chunk_
14
+ - `haybale-audio:node:RecorderNode` — Recorder — Writes audio blocks to a file _tags: audio, record, write, save, file, wav, flac, ogg_
15
+ - `haybale-audio:node:ResampleNode` — Resample — Converts audio blocks to another sample rate and delivers them to Audio Event nodes _tags: audio, resample, sample rate, convert, 44100, 48000, 16000_
16
+
17
+ ## type
18
+ - `haybale-audio:type:AUDIO` — Audio — A block of audio samples. Never saved with the graph.
19
+ - `haybale-audio:type:CALLBACK_AUDIO` — Callback Audio — Subscription for emitters that deliver audio blocks
@@ -0,0 +1,33 @@
1
+ """Haybale-Audio: audio blocks shared by speech, streaming and device libraries.
2
+
3
+ Provides:
4
+ - AudioBlock (``haybale_audio.value``): one block of planar float32 samples with its
5
+ sample rate, passed between nodes by reference and never mutated.
6
+
7
+ Component folders (registered in ``register_components``):
8
+ - ``types``, ``nodes``: the AUDIO and CALLBACK_AUDIO types and the Audio Event node.
9
+ """
10
+
11
+ from pathlib import Path
12
+
13
+ from haywire.core.library.base import BaseLibrary
14
+ from haywire.core.library.decorator import library
15
+ from haywire.core.node.registry import NodeRegistry
16
+ from haywire.core.types.registry import TypeRegistry
17
+
18
+
19
+ @library(
20
+ file_watcher=True,
21
+ )
22
+ class Library(BaseLibrary):
23
+ """Audio library — audio block value, types and events."""
24
+
25
+ def register_components(self):
26
+ """Register the component folders with their registries."""
27
+ base_path = Path(__file__).parent
28
+
29
+ self.add_folder_to_registry(folder_path=str(base_path / "types"), registry_cls=TypeRegistry)
30
+ self.add_folder_to_registry(folder_path=str(base_path / "nodes"), registry_cls=NodeRegistry)
31
+
32
+ def validate(self) -> bool:
33
+ return True
@@ -0,0 +1,36 @@
1
+ # Audio Clock
2
+
3
+ `haybale-audio:node:AudioClockNode` · kind: node
4
+
5
+ Emits a silent audio block at a steady rate
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `start` | inlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
12
+ | `stop` | inlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
13
+ | `callbacks` | inlet | `haybale-core:type:PooledType` | Connect to an Audio Event node. |
14
+ | `status` | config | `haywire-core:type:STRING` | Text data |
15
+ | `started` | outlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
16
+ | `stopped` | outlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
17
+
18
+ ## Settings
19
+
20
+ | name | bag | default | description |
21
+ |---|---|---|---|
22
+ | `sample_rate` | clock | `48000` | Samples per second of the blocks. |
23
+ | `block_size` | clock | `256` | Samples per block. 256 at 48 kHz is a block every 5.3 ms. |
24
+
25
+ ## Notes
26
+
27
+ Paces audio flows: one silent single-channel block per period, to every Audio Event listening.
28
+
29
+ Wire the Audio Event that triggers a mixer to this node; the mixer then runs once per block.
30
+
31
+ Inputs:
32
+ start / stop: Begin or end the ticks
33
+ callbacks: Pooled CALLBACK_AUDIO subscriptions from Audio Event nodes
34
+
35
+ Outputs:
36
+ started / stopped: Control flow after the matching input
@@ -0,0 +1,35 @@
1
+ # Audio Event
2
+
3
+ `haybale-audio:node:AudioEventNode` · kind: node
4
+
5
+ Triggered for each audio block a connected audio emitter delivers
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `listen_callback` | outlet | `haybale-audio:type:CALLBACK_AUDIO` | Subscription for emitters that deliver audio blocks |
12
+ | `block_ready` | outlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
13
+ | `audio` | outlet | `haybale-audio:type:AUDIO` | A block of audio samples. Never saved with the graph. |
14
+ | `timestamp` | outlet | `haywire-core:type:FLOAT` | Decimal number |
15
+ | `block_number` | outlet | `haywire-core:type:INT` | Whole number |
16
+
17
+ ## Settings
18
+
19
+ | name | bag | default | description |
20
+ |---|---|---|---|
21
+ | `queue_mode` | dispatch | `'Block (every block)'` | Block queues every block and back-pressures the emitter. Drop keeps only the newest block, so audio is lost whenever the flow runs behind. |
22
+ | `max_queue_size` | dispatch | `100` | How many pending blocks to hold. 100 blocks of 256 samples at 48 kHz are about 0.5 s. |
23
+
24
+ ## Notes
25
+
26
+ Runs its flow once per audio block from the emitter it is wired to.
27
+
28
+ Connect `Listen` to the audio-callback inlet of an emitter (a device input, a stream
29
+ receiver, a file player, a clock). The emitter sends
30
+ `{"audio": AudioBlock, "timestamp": float, "block_number": int}`.
31
+
32
+ Outputs:
33
+ block_ready: Control flow when a block arrives
34
+ audio: The block
35
+ timestamp / block_number: Seconds since the emitter started, and the count
@@ -0,0 +1,47 @@
1
+ # Audio Mixer
2
+
3
+ `haybale-audio:node:AudioMixerNode` · kind: node
4
+
5
+ Sums several audio sources into one block per clock tick
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `tick` | inlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
12
+ | `clock` | inlet | `haybale-audio:type:AUDIO` | Block of the Audio Clock |
13
+ | `in_0` | inlet | `haywire-core:type:ADD` | Grows a new port from whatever connects to it |
14
+ | `status` | config | `haywire-core:type:STRING` | Text data |
15
+ | `next` | outlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
16
+ | `mixed` | outlet | `haybale-audio:type:AUDIO` | A block of audio samples. Never saved with the graph. |
17
+
18
+ ## Settings
19
+
20
+ | name | bag | default | description |
21
+ |---|---|---|---|
22
+ | `prefill` | mixer | `8` | Blocks an input queues before it is mixed. More blocks ride out longer stalls. |
23
+
24
+ ## Notes
25
+
26
+ Mixes live sources that run on their own flows. Each source has its own input: connect its audio
27
+ output to the open input at the bottom and it gets a `Write` pin, a `Gain` and a `Mute`; a new open
28
+ input appears below.
29
+
30
+ Wire each source's Audio Event Block Ready to its `Write` pin: the block is queued for that input.
31
+ Wire an Audio Clock's Audio Event to `Tick` and `Clock`: every tick mixes one block per input, in the
32
+ clock's sample rate and block size. Inputs at another sample rate or block size are converted, and
33
+ a source clock that differs slightly from the tick clock is absorbed.
34
+
35
+ An input is mixed once its prefill is queued, and again after a stall; until then it is silent. The
36
+ sum is not limited, so loud sources can exceed ±1; the output has the most channels of any input, and
37
+ a mono input plays on all of them.
38
+
39
+ Inputs:
40
+ tick: Mix one block (wire it to the clock's Block Ready)
41
+ clock: The clock's block; its sample rate and size set the output
42
+ in_N / write_N: An input's audio and the pin that queues it
43
+ gain_N / mute_N: An input's level and mute
44
+
45
+ Outputs:
46
+ next: Control flow after a block is mixed
47
+ mixed: The mixed block
@@ -0,0 +1,21 @@
1
+ # Channel Merge
2
+
3
+ `haybale-audio:node:ChannelMergeNode` · kind: node
4
+
5
+ Stacks audio blocks into one block with all their channels
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `in_0` | inlet | `haywire-core:type:ADD` | Grows a new port from whatever connects to it |
12
+ | `merged` | outlet | `haybale-audio:type:AUDIO` | A block of audio samples. Never saved with the graph. |
13
+
14
+ ## Notes
15
+
16
+ Joins the blocks on its inputs, in order, into one block. A single-channel input adds one
17
+ channel; a multichannel input adds all of its channels.
18
+
19
+ Connect an audio output to the open input at the bottom: it becomes an input of its own and a
20
+ new open input appears below. Inputs without a block are skipped. All blocks must have the same
21
+ sample rate and number of samples; an error names the difference.
@@ -0,0 +1,21 @@
1
+ # Channel Select
2
+
3
+ `haybale-audio:node:ChannelSelectNode` · kind: node
4
+
5
+ Picks, reorders or repeats the channels of an audio block
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `audio` | inlet | `haybale-audio:type:AUDIO` | A block of audio samples. Never saved with the graph. |
12
+ | `channels` | config | `haywire-core:type:STRING` | Channel numbers from 0, like 0, 2-3 |
13
+ | `selected` | outlet | `haybale-audio:type:AUDIO` | A block of audio samples. Never saved with the graph. |
14
+
15
+ ## Notes
16
+
17
+ Builds a block from the channels named in `Channels`, in that order.
18
+
19
+ `Channels` is a list of channel numbers from 0 and inclusive ranges: `0` is the first channel,
20
+ `1, 0` swaps a stereo pair, `0, 0` makes mono into stereo, `2-3` takes the third and fourth.
21
+ An error names a channel the block does not have.
@@ -0,0 +1,21 @@
1
+ # Channel Split
2
+
3
+ `haybale-audio:node:ChannelSplitNode` · kind: node
4
+
5
+ Gives each channel of an audio block its own output
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `audio` | inlet | `haybale-audio:type:AUDIO` | A block of audio samples. Never saved with the graph. |
12
+ | `ch_0` | outlet | `haywire-core:type:ADD` | Grows a new port from whatever connects to it |
13
+
14
+ ## Notes
15
+
16
+ Outputs single channels of the input block. Output `Channel 0` is the first channel, `Channel 1`
17
+ the second, and so on.
18
+
19
+ Connect the open output at the bottom to something: it becomes the output for the next channel
20
+ and a new open output appears below. Removing an output leaves the numbers of the others as they
21
+ are. An error names a channel the block does not have.
@@ -0,0 +1,45 @@
1
+ # Device Out
2
+
3
+ `haybale-audio:node:DeviceOutNode` · kind: node
4
+
5
+ Plays audio blocks on a sound device
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `write` | inlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
12
+ | `stop` | inlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
13
+ | `audio` | inlet | `haybale-audio:type:AUDIO` | Block to play |
14
+ | `status` | config | `haywire-core:type:STRING` | Text data |
15
+ | `next` | outlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
16
+ | `depth` | outlet | `haywire-core:type:INT` | Whole number |
17
+
18
+ ## Settings
19
+
20
+ | name | bag | default | description |
21
+ |---|---|---|---|
22
+ | `device` | output | `'System default'` | Output device to play on. The list is read when the node is shown. |
23
+ | `buffer_ms` | output | `300` | Audio the sound device holds ahead. It keeps playing when the program is busy for less than this, for example while a large graph loads; 0 uses the device's default. |
24
+ | `prefill` | output | `8` | Blocks queued before playback starts and kept queued. More blocks ride out longer stalls of the flow, with more delay. |
25
+
26
+ ## Notes
27
+
28
+ Plays each block on an output device. The first block opens the device at its own sample rate;
29
+ blocks are converted to it, and a mono block plays on both speakers of a stereo device.
30
+
31
+ Playback starts once the prefill is queued and restarts after a stall. A producer clock that
32
+ differs slightly from the device clock is absorbed by adjusting the conversion ratio.
33
+
34
+ Crackling means the computer was too busy to feed the device in time. The status shows two
35
+ counters: `stalls` are times the flow did not deliver blocks fast enough (raise Prefill), `late`
36
+ are times the sound device ran dry because the program was busy longer than the Device Buffer (raise it).
37
+
38
+ Inputs:
39
+ write: Queue the block on `audio` (wire it to an Audio Event's Block Ready)
40
+ stop: Close the device; the next `write` opens it again
41
+ audio: The block to play
42
+
43
+ Outputs:
44
+ next: Control flow after a block is queued
45
+ depth: Frames queued for the device
@@ -0,0 +1,38 @@
1
+ # File Player
2
+
3
+ `haybale-audio:node:FilePlayerNode` · kind: node
4
+
5
+ Plays an audio file as audio blocks, in real time
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `start` | inlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
12
+ | `stop` | inlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
13
+ | `path` | inlet | `haywire-core:type:FILE_PATH` | Audio file to play |
14
+ | `callbacks` | inlet | `haybale-core:type:PooledType` | Connect to an Audio Event node. |
15
+ | `status` | config | `haywire-core:type:STRING` | Text data |
16
+ | `started` | outlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
17
+ | `stopped` | outlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
18
+
19
+ ## Settings
20
+
21
+ | name | bag | default | description |
22
+ |---|---|---|---|
23
+ | `block_size` | playback | `256` | Samples per block. The file's own sample rate and channels are kept. |
24
+ | `loop` | playback | `False` | Start again at the end of the file instead of stopping. |
25
+
26
+ ## Notes
27
+
28
+ Reads an audio file from a volume and delivers it, paced at the file's sample rate, to every
29
+ Audio Event listening. The file's own sample rate and channel count are kept: a node that needs
30
+ another format converts it (Reblock/Resample).
31
+
32
+ Inputs:
33
+ start / stop: Begin or end playback
34
+ path: Audio file to play
35
+ callbacks: Pooled CALLBACK_AUDIO subscriptions from Audio Event nodes
36
+
37
+ Outputs:
38
+ started / stopped: Control flow after the matching input
@@ -0,0 +1,17 @@
1
+ # Mix to Mono
2
+
3
+ `haybale-audio:node:MixToMonoNode` · kind: node
4
+
5
+ Averages all channels of an audio block into one
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `audio` | inlet | `haybale-audio:type:AUDIO` | A block of audio samples. Never saved with the graph. |
12
+ | `mono` | outlet | `haybale-audio:type:AUDIO` | A block of audio samples. Never saved with the graph. |
13
+
14
+ ## Notes
15
+
16
+ Outputs one channel that is the average of the input's channels, which keeps the level of a
17
+ stereo pair that carries the same signal on both sides.
@@ -0,0 +1,37 @@
1
+ # Reblock
2
+
3
+ `haybale-audio:node:ReblockNode` · kind: node
4
+
5
+ Re-cuts audio blocks to a fixed size and delivers them to Audio Event nodes
6
+
7
+ ## Ports
8
+
9
+ | id | direction | type | description |
10
+ |---|---|---|---|
11
+ | `write` | inlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
12
+ | `audio` | inlet | `haybale-audio:type:AUDIO` | Block to add |
13
+ | `callbacks` | inlet | `haybale-core:type:PooledType` | Connect to an Audio Event node. |
14
+ | `status` | config | `haywire-core:type:STRING` | Text data |
15
+ | `next` | outlet | `haywire-core:type:EXEC` | Signal for controlling execution flow between nodes |
16
+
17
+ ## Settings
18
+
19
+ | name | bag | default | description |
20
+ |---|---|---|---|
21
+ | `block_size` | reblock | `256` | Samples per delivered block. |
22
+
23
+ ## Notes
24
+
25
+ Collects the blocks that reach `Write` and delivers blocks of exactly `Block Size` samples to
26
+ every Audio Event listening, in order. One input block can give several output blocks or none.
27
+
28
+ The delivered blocks start a new flow: the Audio Event that receives them is the queue between
29
+ the two rates. A change of channel count or sample rate in the input drops the samples still held.
30
+
31
+ Inputs:
32
+ write: Add the block on `audio`
33
+ audio: The block to add
34
+ callbacks: Pooled CALLBACK_AUDIO subscriptions from Audio Event nodes
35
+
36
+ Outputs:
37
+ next: Control flow after the block is taken in