PaulBatchelor / voc

A physical model of the human vocal tract using literate programming, based on Pink Trombone.
https://paulbatchelor.github.io/proj/voc
149 stars 10 forks source link

append_transient never returns 1 #15

Open dkadish opened 5 years ago

dkadish commented 5 years ago

https://github.com/PaulBatchelor/voc/blob/20a17d66b178d1e05b8e3d96c61f6f22e79fb1f6/tract.w#L413

Documentation states that append_transient should return 1 on success, but the function as written will never return 1. I think the last statement (line 413) should return 1. Unless I've missed something?

PaulBatchelor commented 5 years ago

Yup, the documentation is correct. The code is wrong. It would seem that the return code is never checked anywhere in the code.

dkadish commented 5 years ago

Ahh, got it. I'm working on a Python port of this (I'll post a link once I have something rough working), so I'm going over the code pretty closely. I'll let you know if I see anything else!

PaulBatchelor commented 5 years ago

Wow! Good luck. This code is quite a mess, as I was mostly trying to translate the core of Pink Trombone JS to ANSI C. So sorry about that. It could use a rewrite or two, so I'm happy to see someone trying to tackle a rewrite in another language. Personally, I've been meaning to try to make a version of this (or portions of it) in FAUST. Someday I'll hopefully get to it...

If you make a PR with this fix, I'll be happy to merge it.