Bugzilla – Bug 1653
Maximum *Table* size 99,999 samples rather than 1M samples
Last modified: 2018-08-20 11:51:46 UTC
The Nyquist manual says that maximum *table* size is 1,000,000 samples. http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index359 The actual maximum table size is 99,999 samples (a little over 2 seconds at 44100 Hz sample rate). This was discussed in 2011, and the plan was to fix the code to match the documentation: https://sourceforge.net/p/audacity/mailman/message/28003873/
Yes, this is a bug. In my sources, nyqsrc/sound.h says #define max_table_len 100000 and the number should be 1000000, however, the current version of Nyquist seems to have no limit on table size at all. I think that's a bug too, so I should fix the latest sources to enforce the 1M limit, and then maybe we can figure out why Audacity is different. Meanwhile, I think it would be safe to change nyqsrc/sound.h to say #define max_table_len 1000000 (That might make the actual max become 999999) or #define max_table_len 1000001
(In reply to Roger Dannenberg from comment #1) Works for me. https://github.com/audacity/audacity/commit/333c0e34
(In reply to Steve Daulton from comment #2) Testing on W10 audacity-win-ra45f3bb-2.2.0-alpha-22-jul-17 With a sample size of just over 1,000,000 samples - I get no error with that Nyquist code. The Preview works fine producing chipmunks - but pressing Ok leaves the waveform untouched. If I use a less tha 1M size sample the Preview works and the OK works changing the audio to chipmunks. Same happens on macOS Sierra 10.12.6 aae0c4c
(In reply to Peter Sampson from comment #3) > With a sample size of just over 1,000,000 samples - I get no error with > that Nyquist code. That is to be expected if the preview length is less than 1,000,000 samples. If instead of the code in "steps to reproduce" you use this code (2 lines): ;preview selection (hzosc 0.5 (maketable *track*)) then preview should (and does for me) play the selection unaltered and output an error to Audacity's log: 16:07:04: 'Nyquist Prompt' returned: error: maximum table size (1000000) exceeded - NIL if continued: use truncated sound for table 1> 16:07:04: Nyquist returned nyx_error. A similar (but longer) error message should be presented in the debug window if you apply the code (or the original "steps to reproduce" code) using the Debug button.
I believe this is fixed, but as I made the fix I can't close the bug report.
(In reply to Steve Daulton from comment #5)
(In reply to Steve Daulton from comment #5) Testing on W10 audacity-win-eee58d9-2.2.0-alpha-06aug07 and on macOS Sierra 10.12.6 95560ad 9Aug17 Well it does what it says in your comment #4 Steve So if that's what it's supposed to do then it does it (I am no Nyquist expert here) - but on that basis and your confidence I am prepared to mark this Resolved