possible to make this plugin? ("auto draw wave")

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: possible to make this plugin? ("auto draw wave")

Post by steve » Mon Mar 31, 2014 5:30 pm

I'm not sure that I understand your use case, but the requested modification is very simple.
Just change (setq amp 0.5) to (setq amp (snd-fetch s))

So then you have:

Code: Select all

(setq amp (snd-fetch s))  ; set amplitude = first sample
(setq offset 0.)          ; DC offset
(setq phase -270)         ; start phase in degrees
(setq cycles 1.0)         ; number of cycles

(sum offset
  (mult amp
    (osc (hz-to-step (/ cycles (get-duration 1)))
         1 *sine-table* phase)))
(Reminder for other readers: this is for short mono tracks only)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

N871
Posts: 96
Joined: Sat Mar 29, 2014 9:40 pm
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by N871 » Tue Apr 01, 2014 6:46 am

thank you Steve, very, very small request : )
Is it possible to do the same for the other basic waveforms? (triangular, square,..)
Thanks again for your nice work!

N871
Posts: 96
Joined: Sat Mar 29, 2014 9:40 pm
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by N871 » Tue Apr 01, 2014 7:29 am

This is what I'm trying to do:
I have made some samples which need to be looped. Unfortunately for very complex reasons,
all my recordings need to have the exact same length. Therefor I had to stretch them a bit to
make them all end with a full cycle. Unfortunately the stretching messed up the first and last
wave. So now I have to draw them manually, I can't copy/paste because the length of the "glitch"
is not exactly the same as a cycle. Because some of the samples are very sine-like I get clicks and
pops very easily if the glitch isn't "filled in" correctly.

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: possible to make this plugin? ("auto draw wave")

Post by Robert J. H. » Tue Apr 01, 2014 7:53 am

There are two additional wave forms that can be integrated into Steve's code:
Just replace *sine-table* in the last line with either *tri-table* or *saw-table*.

I've still the impression that your procedure is unnecessarily complicated.
How do you accomplish this audio stretching?

N871
Posts: 96
Joined: Sat Mar 29, 2014 9:40 pm
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by N871 » Tue Apr 01, 2014 11:36 am

The procedure is complicated because I'm trying to make virtual oscillators
out of a series of chromatic samples in the max msp language. The original
oscillators are too complex to mock starting from a digital oscillator. I ended
up using the 2d.wave object should you be familiar with it by any chance.

I used the flex speed stretch in logic X. It did a perfect job except for the fact
that my samples are not longer loopable. Well, most still are, but the sine-like
tones are giving pops.

All oscillators are round off a bit towards the top (filtered) so the higher notes are
the most troublesome.

Each of my recordings exists of exactly 300 cycles, 299 are ok, I just need to fix one :)
Unfortunately there are over 500 recordings...which is why I'm searching for a practical plugin.

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: possible to make this plugin? ("auto draw wave")

Post by steve » Tue Apr 01, 2014 11:45 am

There's probably/hopefully an easier way to do this. Could you post one of the problematic examples for us to have a look at?
Assuming that they are under 1 MB you should be able to upload one or two of them using the "upload attachment" feature below the message composing box.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

N871
Posts: 96
Joined: Sat Mar 29, 2014 9:40 pm
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by N871 » Tue Apr 01, 2014 12:13 pm

I'll upload some samples as soon as I get home. Thanks again for your help :)
This is by far the most enthousiastic forum I participated in so far!

N871
Posts: 96
Joined: Sat Mar 29, 2014 9:40 pm
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by N871 » Tue Apr 01, 2014 2:02 pm

the files are both around 1.5MB..but you can download them here:

http://we.tl/RNICGCPJps
http://we.tl/rujmHAeBPl

the first one is a kind of rectangular wave
the second one is a sine wave.

I have cut them so that the glitch is now in the middle and they can be looped correctly.
thanks again,
Nils

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: possible to make this plugin? ("auto draw wave")

Post by steve » Wed Apr 02, 2014 3:09 pm

It would probably be have been easier if you'd made the samples a bit longer than necessary so that you could have just trimmed the ends to get the right length. However, why not just trim the deformed cycle off, then copy and paste a good one in its place? If you need to tweak the overall length but want to keep the same number of cycles, use the Sliding Time Scale / Pitch Shift effect and enter the same % for each of start/final for Pitch and Tempo.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

N871
Posts: 96
Joined: Sat Mar 29, 2014 9:40 pm
Operating System: Please select

Re: possible to make this plugin? ("auto draw wave")

Post by N871 » Wed Apr 02, 2014 7:30 pm

Hi steve, thanks again for your reply,
Unfortunately your ideas won't work. I can't change the length of the recording, they all
need to have the same length up to the sample to work well in my max msp program. The
size of the glitch is not equal to the length of a cycle. The smallest imperfection results immediately in
clicks/pops. Your sine wave patch works well, I just need to change the parameters for each sample.

Post Reply