Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@ Audio for [Bend 2](https://github.com/bendlang/bend).

## Install

With [Bend](https://github.com/bendlang/bend) alone there is nothing to
install: import ezaudio by its hub name and `bend` fetches it from
ezaudio is built and checked on bend 2.0.34.

With [Bend](https://github.com/bendlang/bend) alone there is no install
step: import ezaudio by its hub name and `bend` fetches it from
[the hub](https://hub.bend-lang.com) into `~/.bend/lib` on the first run.
`0x05eb91b04a37c34a9abe2324661894f5` is ezaudio v0.2.9.
`emerging-ezaudio@0.4.0.0` is ezaudio v0.4.0:

```
import 0x05eb91b04a37c34a9abe2324661894f5/main.bend as Au
import emerging-ezaudio@0.4.0.0/main.bend as Au
```

That name resolves to `0xd2dab0fbc9db2e9ba3da65dae724eb41`.
To pin by content instead, import `0xd2dab0fbc9db2e9ba3da65dae724eb41/main.bend`.

Use 0.4.0 or later. Versions before 0.4.0 on the hub carry no LICENSE
file, so the hub shows them under the default license in its terms, not
this repository's LICENSE.

Or with [ez](https://github.com/Emerging-Patterns/ez), which records the
package in `ez.toml` (`ez init` makes one):

Expand All @@ -33,7 +42,7 @@ the filterbank. `count`, `fill`, `trim`, and `concat` are the raw-frame
helpers. Resampling is not in this version.

```
import 0x05eb91b04a37c34a9abe2324661894f5/main.bend as Au
import emerging-ezaudio@0.4.0.0/main.bend as Au

def main() -> U32:
Au.rate(Au.clip(8000, 1, Au.s16(), [0, 1]))
Expand Down
6 changes: 3 additions & 3 deletions ez.lock.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ hub = "https://hub.bend-lang.com"
[tools]
[tools.bolt]
git = "https://github.com/Emerging-Patterns/bolt"
rev = "d5a67600a96ba423f2212bd661a30c1fba38eb55"
tag = "v1.9.0"
rev = "91efe4bbaad91953652794ad55be7b49c10a2eff"
tag = "v1.11.0"
root = "."
narHash = "sha256-HmJ8J1xDshBdSWXIiEp48GZ9qHsm+bmpHw06ZWwcDVE="
narHash = "sha256-0xjoxoByI8PKBrbFy4eYGbKQ3ZVscknZLKkWQroYAUI="
entry = "main.bend"
8 changes: 4 additions & 4 deletions ez.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "ezaudio"
entry = "main.bend"

[tools]
[tools.bolt]
git = "https://github.com/Emerging-Patterns/bolt"
rev = "d5a67600a96ba423f2212bd661a30c1fba38eb55"
tag = "v1.9.0"
rev = "91efe4bbaad91953652794ad55be7b49c10a2eff"
tag = "v1.11.0"
root = "."
narHash = "sha256-HmJ8J1xDshBdSWXIiEp48GZ9qHsm+bmpHw06ZWwcDVE="
narHash = "sha256-0xjoxoByI8PKBrbFy4eYGbKQ3ZVscknZLKkWQroYAUI="
entry = "main.bend"
47 changes: 7 additions & 40 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 5 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
url = "github:bendlang/bend/777ee0b55c485afdd7e68bd917b3d23a88d77371";
inputs.nixpkgs.follows = "nixpkgs";
};
# ez and its bolt stay on the bend ez's own flake.lock records until ez
# releases on 2.0.34, so ez's inputs.bend is pinned, not followed. The
# package's own builds and its proofs (checks.proofs) run on 2.0.34.
# ez 1.3.0 runs on bend 2.0.34, so its bend follows this flake's bend:
# ez, `ez prove` and bolt all build on 2.0.34.
inputs.ez = {
url = "github:Emerging-Patterns/ez";
inputs.nixpkgs.follows = "nixpkgs";
inputs.bend.url = "github:bendlang/bend/af569d4826913b2ce3557e9829ccad31fcf86f94";
inputs.bend.follows = "bend";
};

outputs = { self, nixpkgs, ... }@inputs:
Expand All @@ -25,7 +24,7 @@
ez = inputs.ez.lib.${system};
ezBin = inputs.ez.packages.${system}.default;
bend = inputs.bend.packages.${system}.default;
bolt = ez.toolPackage { name = "bolt"; src = self; wrapFlags = [ "--gpu" "off" ]; };
bolt = ez.toolPackage { name = "bolt"; src = self; inherit bend; wrapFlags = [ "--gpu" "off" ]; };
bend-cc = ez.bend-cc;

bench = import ./bench {
Expand All @@ -42,21 +41,7 @@
apps.${system} = bench.apps;

checks.${system} = {
# every PROOF.bend on this flake's bend: its first line must be
# ALL PROOFS CHECK. ez.mkProofs comes back when ez runs on 2.0.34.
proofs = pkgs.runCommand "ezaudio-proofs" {
nativeBuildInputs = [ bend ];
BEND_LIB = ez.bendLib ./ez.lock.toml;
} ''
export HOME=$TMPDIR
cp -r ${self} src && chmod -R u+w src && cd src
for p in $(find . -name PROOF.bend -not -path './.ez/*' | sort); do
first=$(cd "$(dirname "$p")" && bend "$(basename "$p")" | head -n 1)
echo "$p: $first"
[ "$first" = "ALL PROOFS CHECK" ] || exit 1
done
touch $out
'';
proofs = ez.mkProofs { ez = ezBin; src = self; };
lint = ez.mkLint { src = self; };
} // bench.checks;

Expand Down
Loading