Help for simply copy paste a selection.

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
haute
Posts: 16
Joined: Sun Mar 04, 2018 2:11 pm
Operating System: Windows 7

Re: Help for simply copy paste a selection.

Post by haute » Sun Mar 04, 2018 10:56 pm

i change to version 4, and dont work. I test 1, 2 ,3 and 4
A curious thing happens, after trying to use the plugin version (it does not work), if I use the Nyquest version, copy the selection of the track from below to the one above.

haute
Posts: 16
Joined: Sun Mar 04, 2018 2:11 pm
Operating System: Windows 7

Re: Help for simply copy paste a selection.

Post by haute » Sun Mar 04, 2018 11:10 pm

Hi, i solve the problem change header type to Generate, and now work fine.
The use of the plugin is to copy the voices of a central speaker track from one language to another language, respecting the background audio to synchronize with the rest of the channels (L, R, LFE, SL and SR)
Thanks so much for the help

Code: Select all

 ;nyquist plug-in
 ;name "Copy-Paste"
 ;type Generate
 ;version 4
(if (not (boundp '*scratch*))
  (progn
    (setf *scratch* *track*)
    (snd-length *scratch* ny:all)
    "") ;Null string return value
  (progn
    (setf rval *scratch*)
    (setf *scratch* '*unbound*)
    rval))

haute
Posts: 16
Joined: Sun Mar 04, 2018 2:11 pm
Operating System: Windows 7

Re: Help for simply copy paste a selection.

Post by haute » Wed Oct 24, 2018 4:14 pm

hi steve i update audacity to versión 2.3.0 and the pluguin dont work fine.
Sometimes copy the sellection of the track from above to the track below, other times it does the reverse. Other times it does nothing or makes a small displacement.
Would it be possible to tell him to always copy the selection from track 0 to track 1?
Would it be possible to make this plugin using Macros in this new version?
A greeting.

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

Re: Help for simply copy paste a selection.

Post by steve » Wed Oct 24, 2018 6:19 pm

haute wrote:
Wed Oct 24, 2018 4:14 pm
i update audacity to versión 2.3.0 and the pluguin dont work fine.
It works fine for me.
It also works fine for me as a ";type process" plug-in, provided that there is an audio selection when pasting.

I do notice that there is no error checking in this plug-in, so the results may not be what you expect if you don't mentally keep track of whether you car copying or pasting, or if you select multiple tracks, or if you select a stereo track (the plug-in does not support stereo tracks).

Please remind me why you want this as a plug-in. What is the purpose of it? Why not just use "Ctrl + C" to copy and "Ctrl + V" to paste?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

haute
Posts: 16
Joined: Sun Mar 04, 2018 2:11 pm
Operating System: Windows 7

Re: Help for simply copy paste a selection.

Post by haute » Fri Oct 26, 2018 2:27 pm

the base of this plugin is to be able to copy the voices of a track and paste them in the same position in the track below. But this has to be done hundreds of times, that's why CTRL + C and CTRL + V is something tedious.
The plugin fails many times and I do not understand why.
With the new version of audacity I have been able to create something similar using macros, much more stable.

This is the sequence of the macro:

Code: Select all

SelSave:
ShiftUp:
Copy:
ShiftDown:
SelRestore:
Paste:

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

Re: Help for simply copy paste a selection.

Post by steve » Fri Oct 26, 2018 3:17 pm

haute wrote:
Fri Oct 26, 2018 2:27 pm
The plugin fails many times and I do not understand why.
I can think of a couple of reasons:
Wrong number of tracks selected (the plug-in expects exactly 2 audio tracks)
One or more stereo tracks selected.
Insufficient free memory.
haute wrote:
Fri Oct 26, 2018 2:27 pm
to be able to copy the voices of a track and paste them in the same position in the track below
For that specific job, this version should be more reliable as it has some error checking. It also supports stereo tracks, and is probably more efficient:

Code: Select all

;nyquist plug-in
;name "Copy-Paste"
;type process
;version 4

(cond
((/= (length (get '*selection* 'tracks)) 2)
  (setf *scratch* '*unbound*)
  "Clipboard cleared.\nTo copy from one track to another, select 2 tracks.")
((= (get '*track* 'index) 1) 
  (setf *scratch* *track*)
  (multichan-expand #'snd-play *track*)
  "")
((= (get '*track* 'index) 2)
  (if (and (arrayp *scratch*)(soundp *track*))
      (setf rslt (mult 0.5 (sum (aref *scratch* 0)(aref *scratch* 1))))
      (setf rslt *scratch*))
  (setf *scratch* '*unbound*)
  rslt))

haute wrote:
Fri Oct 26, 2018 2:27 pm
With the new version of audacity I have been able to create something similar using macros, much more stable.
Yes, a macro is probably better for this task.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

haute
Posts: 16
Joined: Sun Mar 04, 2018 2:11 pm
Operating System: Windows 7

Re: Help for simply copy paste a selection.

Post by haute » Fri Oct 26, 2018 5:30 pm

Hi, the new pluguin work fine too. It necesary select the 2 tracks (copy-paste de audio) but work fine.
the two solutions are equally valid. Thank you so much.

Post Reply