-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
83 lines (48 loc) · 1.77 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Rust regular temperament library
================================
This is a re-implementation of some of my Python temperament finding
code in Rust.
Native-code application
-----------------------
The standard target finds regular temperaments and shows the results
in a machine-readable format that is JSON-consistent, and works
with the latest Python library: https://bitbucket.org/x31eq/regular
Supply the number of results for each rank, the cangwu parameter
(cents/octave), and the prime limit.
7-limit:
cargo run 5 1 7
2.3.7-limit:
cargo run 5 1 2 3 7
11-limit as inharmonic timbre:
cargo run 5 1 cents <<FIN
1200.0
1901.9550008653875
2786.3137138648344
3368.825906469125
4151.317942364757
FIN
For other build targets, this project includes a makefile, because
I like makefiles. To do a faster calculation for a big limit
(currently incomplete results):
make release && target/release/regular 5 0.1 257
WebAssembly (Wasm) application
------------------------------
You can also run the code in a web browser without Python
or other server-side support. You need wasm-pack:
https://rustwasm.github.io/wasm-pack/installer/
If you don't have curl, this might work:
wget -O - https://rustwasm.github.io/wasm-pack/installer/init.sh | sh
If that doesn't work (like your platform isn't supported)
you can build it yourself from this repository:
https://github.com/rustwasm/wasm-pack
Once you have it,
make wasm
and run a web server from the project root. For example,
python3 -m http.server
If you have wasm-opt, you can also try
make wasm-release
This should make the code smaller, and maybe faster, and put it in
the root folder. If you don't have wasm-opt, you can get it from
https://github.com/webassembly/binaryen
To get documentation including the Wasm code:
make doc