I found a 300 line C routine in early 2020, which can raise or lower the pitch of an audio buffer by up to 2 octives without changing the length, written by an Audio professional. I tried back then to translate it into Typescript, but it does a lot of heavy math / bit manipulation. It is just not going to work right without integer types.
I need this to work. It does not have to be fast, at all. It is for my voice font builder tool.
Rust / WebAssembly seemed like the best option, but I had never done anything with it before. I decided 2 days ago to do a small project, to replicate
VertexData.ComputeNormals() in Rust.
ComputeNormals also needs to pass Float32Arrays, and I could easily check if it worked by comparing output with the JS version.
A small project to figure out the process with verification would mean that I was not trying to do too many things for the first time all at the same time.
This went faster and easier than I even thought, published here GitHub - Palmer-JC/normal-rust: A small Rust / Webassembly project to calculate Normals.
The only downside is it is massively slower. Here is a screen shot of the little test page:
I do perform
ComputeNormals a lot, so it would have been nice, if it were actually faster. Just passing what I found out for anyone also thinking about using Rust / WebAssembly.