Tone and beat syncgenerator with customized fields

Hi,


I am working on a project to develop a new technology and it would be great if I could have a tone and beat syncgenerator with amplitude/volume, pitch carrier, time frequency change, sweep frequencies with customized fields.

Any help would be very appreciated :smiley:


Mary

As a starting point, try out the hzosc command in the Nyquist Prompt effect.

As an example, try the following code:

(setq frequency 440)
(setq amplitude 0.8)
(mult amplitude
  (hzosc frequency))

Can you work out what the above code is doing?
Are you able to make it into a plug-in?
Can you add controls to the plug-in so that it can generate a constant tone at a frequency and amplitude set by the user?
See how far you can get. I’ll be back on the forum in a day or two and suggest how you might proceed, based on what you do with the above.

For writing and editing Nyquist scripts, if you use Windows I would highly recommend using Notepad++

In a complete newbie perspective , I think this code :

  1. sets frequency at 440hz
    2.sets amplitude at 0.8
    3.adds function returning a waveshape considering multiple amplitudes oscillating with the frequency

I am not a programmer at all, but this is what i read, it can be completely erroneous!

To be honest , I haven’t read so far data about SAL or LISP. Please give me a couple of days to understand it.

Bye for now
Mary

You’re not far off at all :slight_smile:

Small pieces of code can be conveniently run by copy and pasting them into the ā€œNyquist Promptā€ effect (in the Audacity Effect menu). You can then make changes to the code to see how it affects the output, for example, try running different versions like these:

(setq frequency 440)
(setq amplitude 0.8)
(mult amplitude
  (hzosc frequency))



(setq frequency 440)
(setq amplitude 0.2)
(mult amplitude
  (hzosc frequency))



(setq frequency 220)
(setq amplitude 0.8)
(mult amplitude
  (hzosc frequency))



(mult 0.5
  (hzosc 1000))



Unless you have previous programming experience with C or C++, I’d suggest that you concentrate on the LISP examples.
Nyquist can be written in SAL or in LISP, but most of the people on this forum that use Nyquist (including myself) write in LISP rather than SAL, so we are better able to provide support if you are working in LISP.


Sure, no problem. There’s no rush.
I think it’ll be better if we approach this steadily so that you understand, then you will be able to modify code and tailor the plug-in to suit your needs.

Hi Steve,

I am back!
The LISP protocol is obviously extensive, so for now I concentrated myself in learning some of the basic functions, behaviors, oscillators, once that my main goal is not make music only generate sounds.
So , I suppose I am ready for the next step!! Let’s see…
Please go ahead.

Hi Mary,
I’m not going to be on the forum over the weekend, so I’ll check in on Monday. Between now and then, have a look at the following functions in the Nyquist manual, and try and create a ā€œGeneratorā€ type plug-in using some or all of these functions. The information necessary to convert a simple code snippet into a plug-in is here: http://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference
Make a note of any questions that you can’t figure out, and post a couple of plug-ins, whether they work or not.
.NY files can be attached directly to forum posts as described here: https://forum.audacityteam.org/t/how-to-attach-files-to-forum-posts/24026/1

The functions to look at:
hzosc
osc
hz-to-step
pwl
pwlv

Also look at using ā€œslider widgetsā€ http://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference#Slider_Widget
Good luck.

Hi Steve,

I was really busy last week and I still will be in a couple of seminars during the next two weeks. I will get back to you soon.
Thank you

Mary

No worries Mary, I’m sure it won’t take long to knock up a working plug-in once you have the time to concentrate on the job. Just post here when you’re ready :wink: