Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 1653 - Maximum *Table* size 99,999 samples rather than 1M samples
Maximum *Table* size 99,999 samples rather than 1M samples
Status: RESOLVED QUICKFIXED
Product: Audacity
Classification: Unclassified
Component: Nyquist
2.2.0
Per OS All
: P4 Repeatable
Assigned To: Default Assignee for New Bugs
https://sourceforge.net/p/audacity/ma...
: nyquist
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-01 14:15 UTC by Steve Daulton
Modified: 2018-08-20 11:51 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
In the Nyquist prompt with a mono audio selection of more than 99,999 samples, run the following code using the Debug button: (hzosc 0.5 (maketable *track*)) If the selection is less than 1,000,000 samples, the code should run without error. The actual result is an error: "error: maximum table size (100000) exceeded - NIL"
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2017-06-01 14:15:48 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/
Comment 1 Roger Dannenberg 2017-06-15 14:56:23 UTC
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
Comment 2 Steve Daulton 2017-06-15 16:57:30 UTC
(In reply to Roger Dannenberg from comment #1)
Works for me.
https://github.com/audacity/audacity/commit/333c0e34
Comment 3 Peter Sampson 2017-08-04 10:18:48 UTC
(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
Comment 4 Steve Daulton 2017-08-04 11:10:57 UTC
(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.
Comment 5 Steve Daulton 2017-08-08 07:02:58 UTC
I believe this is fixed, but as I made the fix I can't close the bug report.
Comment 6 Peter Sampson 2017-08-08 08:08:14 UTC
(In reply to Steve Daulton from comment #5)
Comment 7 Peter Sampson 2017-08-08 08:18:39 UTC
(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