# Mac: Problem Using Nyquist Prompt

**URL:** <https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277>\
**Category:** macOS\
**Created:** [February 20, 2024, 8:36pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277 "2024-02-20T20:36:56Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![dparker](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/d/db5fbb/32.png) [@dparker](https://forum.audacityteam.org/u/dparker)\
**Post date:** [February 20, 2024, 8:36pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/1 "2024-02-20T20:36:56Z")

</div>

Hi all,

A short while ago, I created [this forum topic](https://forum.audacityteam.org/t/question-about-generating-tones-in-audacity/97738) asking for accessible suggestions on how to create amplitude-modulated sine tones (see link for details). @Trebor told me to generate silence, select it and use the Nyquist Prompt feature to generate the tone, providing the following sample code which works on Windows:

(sim (mult 0.3 (osc-tri 18.5) (osc-tri 18.5) (hzosc 3700)))

However, on pasting this into the Nyquist Prompt box in Audacity I get the following error message:

Nyquist Prompt: Error in Nyquist code  
Your code looks like SAL syntax, but there is no ‘return’ statement.  
For SAL, use a return statement such as:  
return _track_ \* 0.1  
or for LISP, begin with an open parenthesis such as:  
(mult _track_ 0.1).

Since this seems to work for Trebor on Windows, I’m wondering if there is anything specific to Mac which makes this not work as expected. Are there any solutions or workarounds? My coding knowledge is nonexistent, so unfortunately I’m not sure I can figure this one out myself. For context, I’m running Audacity 3.4.2 on MacOS Sonoma 14.3.1, and I use the VoiceOver screen reader.

Thanks in advance,  
Daniel

---

<div class="post-metadata">

**Author:** ![Trebor](https://forum.audacityteam.org/user_avatar/forum.audacityteam.org/trebor/32/45854_2.png) [@Trebor](https://forum.audacityteam.org/u/Trebor)\
**Post date:** [February 21, 2024, 1:04am UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/2 "2024-02-21T01:04:38Z")

</div>

> [@dparker](#):
>
> Since this seems to work for Trebor on Windows …

Still working in Audacity 2 & 3 on Windows 8.

> [@dparker](#):
>
> … I’m wondering if there is anything specific to Mac which makes this not work as expected

Here’s another Mac user reporting the same error message with Nyquist code

> [@setRMS nyquist code not working](https://forum.audacityteam.org/t/setrms-nyquist-code-not-working/54033/6):
>
> Hi, I’m talking about the setRMS nyquist code. I get the following error when trying to load it. Your code looks like SAL syntax, but there is no ‘return’ statement. For SAL, use a return statement such as: return track \* 0.1 or for LISP, begin with an open parenthesis such as: (mult track 0.1) All I want to do is prep an audio book for ACX in a few easy steps. There is nothing easy about this. The following video comes close, except for this compile error on the nyquist code. [https:…](https://www.youtube.com/watch?v=o8wPxxyuVGg)

but no solution in that thread. ☹

@steve@kozikowski

---

<div class="post-metadata">

**Author:** ![steve](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://forum.audacityteam.org/u/steve)\
**Post date:** [February 21, 2024, 1:50am UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/3 "2024-02-21T01:50:24Z")

</div>

> `(sim (mult 0.3 (osc-tri 18.5) (osc-tri 18.5) (hzosc 3700)))`

Ensure that there are no spaces before the first “(”.

---

<div class="post-metadata">

**Author:** ![dparker](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/d/db5fbb/32.png) [@dparker](https://forum.audacityteam.org/u/dparker)\
**Post date:** [February 21, 2024, 10:22am UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/4 "2024-02-21T10:22:28Z")

</div>

@Steve Thanks. Unless they are being automatically generated when I paste in the code, there shouldn’t be any. However there’s a quirk in which VoiceOver will not read out the contents of this and many other Audacity text boxes. This is new in Audacity version 3.4 I think, but I am still able to type and paste into boxes.

---

<div class="post-metadata">

**Author:** ![steve](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://forum.audacityteam.org/u/steve)\
**Post date:** [February 21, 2024, 10:55am UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/5 "2024-02-21T10:55:02Z")

</div>

Copying code from a website and pasting into the Nyquist prompt can sometimes add leading spaces. (This is not a bug in Audacity, it is a problem with some web page / browser interactions.)

---

<div class="post-metadata">

**Author:** ![dparker](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/d/db5fbb/32.png) [@dparker](https://forum.audacityteam.org/u/dparker)\
**Post date:** [February 21, 2024, 11:07am UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/6 "2024-02-21T11:07:27Z")

</div>

I copied the code into a .txt file (which opens in the TextEdit app on Mac) and paste it from there.

---

<div class="post-metadata">

**Author:** ![steve](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://forum.audacityteam.org/u/steve)\
**Post date:** [February 21, 2024, 11:13am UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/7 "2024-02-21T11:13:58Z")

</div>

Can you try typing directly into the Nyquist Prompt? (ensure that the code entry box is completely empty before typing)  
Try something really simple first, such as:  
(print 42)

---

<div class="post-metadata">

**Author:** ![dparker](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/d/db5fbb/32.png) [@dparker](https://forum.audacityteam.org/u/dparker)\
**Post date:** [February 21, 2024, 12:27pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/8 "2024-02-21T12:27:33Z")

</div>

@Steve So I did try typing, but as soon as I hit the space bar it thinks I’m done inputting and I get an error message. I don’t think this is just a trick of how the VoiceOver screen reader handles buttons, as I believe this also happened when I turned VO off. But I can investigate again.

---

<div class="post-metadata">

**Author:** ![steve](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://forum.audacityteam.org/u/steve)\
**Post date:** [February 21, 2024, 1:14pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/9 "2024-02-21T13:14:14Z")

</div>

> [@dparker](#):
>
> and I get an error message.

The same error message? (“…Your code looks like SAL syntax, …”)

---

<div class="post-metadata">

**Author:** ![dparker](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/d/db5fbb/32.png) [@dparker](https://forum.audacityteam.org/u/dparker)\
**Post date:** [February 21, 2024, 1:34pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/10 "2024-02-21T13:34:37Z")

</div>

So here’s what happens when I type with VoiceOver on and off:

When starting to type @trebor’s code, as soon as I type the space after "(sim ", I get the same error message as above, regardless of whether VoiceOver is on or off.

When typing “(print 42)”, sometimes it acts as if I’ve clicked the “load” button to load a Nyquist script, and sometimes it gives me the same error. I only got it to want to load a script when VoiceOver was on.

---

<div class="post-metadata">

**Author:** ![steve](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://forum.audacityteam.org/u/steve)\
**Post date:** [February 21, 2024, 2:03pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/11 "2024-02-21T14:03:00Z")

</div>

When typing into the Nyquist Prompt’s code window, nothing should happen other than the typed characters going into the code window. Nyquist (the programming language) is not launched until the “Apply” or “Debug” buttons are pressed / activated.

Do you see similar problems (plugins running before activating “Apply”) in any other effects?  
Have you previously run any older versions of Audacity, and if so, did you experience the same or similar problem?

---

<div class="post-metadata">

**Author:** ![dparker](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/d/db5fbb/32.png) [@dparker](https://forum.audacityteam.org/u/dparker)\
**Post date:** [February 21, 2024, 2:22pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/12 "2024-02-21T14:22:17Z")

</div>

I seem to be getting mixed behavior in other effects. For example, when typing in boxes within the normalize or amplify dialogs, when I hit the space bar it checks and unchecks the ‘allow clipping’ box. But I think the reason for this is because the decibels or peak amplitude field doesn’t expect a space. Otherwise I don’t really use enough plugins to know what a good test subject would be. I have also not tried to run Nyquist Prompt in previous versions. I can tell you that VoiceOver does not read out my typing in the export or save as dialogs, but the typing works and my files do save with the expected names, spaces included.

EDIT: It sounds to me like there are two issues here. One is that it doesn’t seem to like my code, but the other is that when I press the space bar in Nyquist Prompt it thinks I’m clicking the OK or Debug buttons. Is there any way to solve this?

EDIT 2: I tried messing around with keyboard command assignments on Mac without results, but I may be getting closer to a solution on my own by focusing on the textbox using the tab key without VoiceOver enabled…

EDIT 3: It now seems to work! Thanks @trebor and @steve for bearing with me. The problem appears to have been that VoiceOver was not focusing properly on the code box, but rather on one of the buttons. This meant that characters other than space were being typed into the text box, but because the space activates the selected item it tried to apply an incomplete code. I’ve noticed a similar behavior in other areas of MacOS, but I didn’t realize it was happening here.

Thanks again for all your help!

---

<div class="post-metadata">

**Author:** ![steve](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://forum.audacityteam.org/u/steve)\
**Post date:** [February 21, 2024, 3:21pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/13 "2024-02-21T15:21:39Z")

</div>

> [@dparker](#):
>
> The problem appears to have been that VoiceOver was not focusing properly on the code box, but rather on one of the buttons.

That would explain the weird behaviour. Pleased to hear that you have resolved the issue.  
Is there any advice you could give to other macOS users to get VoiceOver working correctly with Audacity?

---

<div class="post-metadata">

**Author:** ![dparker](https://forum.audacityteam.org/letter_avatar_proxy/v4/letter/d/db5fbb/32.png) [@dparker](https://forum.audacityteam.org/u/dparker)\
**Post date:** [February 21, 2024, 3:46pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/14 "2024-02-21T15:46:21Z")

</div>

VoiceOver support is famously spotty, and there are some controls for which I haven’t had an accessible workaround. However, ensuring that you have focused on an edit box with the Tab key, rather than Ctrl-Option-Down Arrow, may help with some uncooperative edit boxes.

---

<div class="post-metadata">

**Author:** ![system](https://forum.audacityteam.org/uploads/default/original/1X/81a69b20bcd548215067cfaceccc8a10bfa2d176.png) [@system](https://forum.audacityteam.org/u/system)\
**Post date:** [March 21, 2024, 8:37pm UTC](https://forum.audacityteam.org/t/mac-problem-using-nyquist-prompt/99277/16 "2024-03-21T20:37:53Z")

</div>

Closed on March 21, 2024, 8:37pm UTC

This topic was automatically closed after 30 days. New replies are no longer allowed.
