Delay with bpm and panning

Share your Audacity/Nyquist plug-ins here, or test drive the latest plug-ins submitted by Audacity users.

After testing a plug-in from this forum, please post feedback for the plug-in author.
Felipe Zanabria
Posts: 41
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Delay with bpm and panning

Post by Felipe Zanabria » Thu Aug 16, 2018 2:33 am

Regards!
I have a delay plugin with bpm, but I do not know how to do with panning.
Delay bpm.ny
(699 Bytes) Downloaded 8 times
There is a function that makes the selection extend, but I do not want it since the music will be heard out of time.
I took the code from this plug-in from the audacity wiki, where it shows an example of plug {in with delay.
After I have the effect with panning I will implement some filters to make it more musical.
From already thank you very much.

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

Re: Delay with bpm and panning

Post by steve » Thu Aug 16, 2018 10:17 am

To do panning with a plug-in, the audio must be in a stereo track.
Stereo tracks are handles as arrays, so you can test if the track is stereo by checking if *track* is an array.

Code: Select all

(if (arrayp *track*)
    (print "Stereo")
    (print "Mono"))
Panning is then achieved by adjusting the proportion of sound in each channel. The first element of a 2 channel stereo sound array is the left channel.

There's an example of delay with panning here: https://wiki.audacityteam.org/wiki/Nyqu ... th_Panning

Please note that it is highly recommended to indent code to aid readability. See here for a good introduction to LISP indentation: http://dept-info.labri.fr/~idurand/ense ... ation.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Felipe Zanabria
Posts: 41
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Re: Delay with bpm and panning

Post by Felipe Zanabria » Thu Aug 16, 2018 5:56 pm

I will always work with stereo tracks, so I do not need to verify.
I have tried to understand the code of this wiki plug-in, but there are many calculations.
What I want to do is sound the sound, then a delay in one channel and then in the other.

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

Re: Delay with bpm and panning

Post by steve » Thu Aug 16, 2018 11:04 pm

Perhaps this will help to get you started:

Code: Select all

(setf delays (vector 0.4 0.8))  ;left delay 0.4s, right delay 0.8s
(setf delay-level 0.6)

(defun stereo-delay (sig delay)
  (sim sig
       (at-abs delay (cue (mult sig delay-level)))))

(if (arrayp *track*)
    (multichan-expand #'stereo-delay *track* delays)
    "Error.\nStereo track required")
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Felipe Zanabria
Posts: 41
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Re: Delay with bpm and panning

Post by Felipe Zanabria » Fri Aug 17, 2018 6:30 am

steve wrote:
Thu Aug 16, 2018 11:04 pm
Perhaps this will help to get you started:

Code: Select all

(setf delays (vector 0.4 0.8))  ;left delay 0.4s, right delay 0.8s
(setf delay-level 0.6)

(defun stereo-delay (sig delay)
  (sim sig
       (at-abs delay (cue (mult sig delay-level)))))

(if (arrayp *track*)
    (multichan-expand #'stereo-delay *track* delays)
    "Error.\nStereo track required")
Hi Steve, I like your code, but it has no function to adjust the number of echoes and the stereo width.
I found the volume of the echoes and the delay time in each channel.

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

Re: Delay with bpm and panning

Post by steve » Fri Aug 17, 2018 8:39 am

If you only want to use Nyquist plug-ins, then there are many free Nyquist plug-ins available here: https://wiki.audacityteam.org/wiki/Down ... t_Plug-ins

If you want to learn how to create and / or modify Nyquist plug-ins, then there are many resources available: viewtopic.php?f=39&t=77214
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Felipe Zanabria
Posts: 41
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Re: Delay with bpm and panning

Post by Felipe Zanabria » Sun Aug 19, 2018 4:31 am

Hello forum people, today I managed to make the delay with panning and bpm.
I was comparing the functions of the delay plugin with panning and a fixed delay plug-in of an example and I have given that by taking out a function I could take out the ball that bounces and pick up a lag.
I have examined the delay that already comes with audacity and I have extracted a function so as not to extend the duration of the selection, and now I am sharing them.
Later maybe add some filter options to expand the musical possibilities.
Let me know if you like, any doubt I answer.
Delay bpm.ny
(1.38 KiB) Downloaded 8 times

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

Re: Delay with bpm and panning

Post by steve » Sun Aug 19, 2018 11:27 am

Have you uploaded the correct version? It does not appear to work. Would you like some help debugging it?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Felipe Zanabria
Posts: 41
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Re: Delay with bpm and panning

Post by Felipe Zanabria » Sun Aug 19, 2018 2:45 pm

Hello Steve, try this.
Delay bpm.ny
(1.34 KiB) Downloaded 9 times
I have everything perfect now, the only thing I can not do is not extend the selection.
If I put many echoes the panning is on one side and increases its amplitude in an uncontrolled way.

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

Re: Delay with bpm and panning

Post by steve » Sun Aug 19, 2018 7:04 pm

Felipe Zanabria wrote:
Sun Aug 19, 2018 2:45 pm
the only thing I can not do is not extend the selection.
You can fix that by changing the last line from:

Code: Select all

(stretch-abs 1 (multichan-expand #'constrain-abs (panbounces s count) (get-duration *sound-srate* )))
to:

Code: Select all

(let ((dur (get-duration 1)))
  (stretch-abs 1
    (multichan-expand #'extract-abs (panbounces s count) dur)))
Question:
What is supposed to happen if there is a sound in the original track that is already panned hard over to one side?
Should it echo in both left and right, or only echo on the side where the original sound is?
If the amount of decay is zero, and the "Pan spread" is greater than zero, should the echoes be all the same volume, or alternate between quiet and loud?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply