i'm trying to do postive harmonic's by words and numbers

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
yugioh47
Posts: 334
Joined: Sun Mar 01, 2015 7:52 pm
Operating System: Windows 10

i'm trying to do postive harmonic's by words and numbers

Post by yugioh47 » Sun Mar 01, 2015 8:00 pm

hi there, i've been trying to generate harmonics such as joy, love,light,tranquility for my music. i've having a problem with trying to create these harmonics in the songs. when i try to do batch file. it's say no value returned. i'm trying to generate harmonics for with in the music magnitude with nyquist. i'm trying to learn this. can someone please help me?
Attachments
harmonics.ny
this is a sample i'm trying to do.
(2.81 KiB) Downloaded 69 times

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

Re: i'm trying to do postive harmonic's by words and numbers

Post by steve » Sun Mar 01, 2015 8:06 pm

Perhaps we can advance most quickly if we begin with some working code.
I presume that you copied the "n harmonic oscillator" from another plugin. Is there a link where we can find that plugin, or could you post that plugin here.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

yugioh47
Posts: 334
Joined: Sun Mar 01, 2015 7:52 pm
Operating System: Windows 10

Re: i'm trying to do postive harmonic's by words and numbers

Post by yugioh47 » Sun Mar 01, 2015 9:20 pm

that's how i learn by copying the oscillator. i need some examples of scripts so i can generate the harmonics. someone please help me?

p.s. if someone did work scripts then we need simpler way by nyquist creator for audacity that would be universal plug for any words and harmonic scritps. i will gladely help beta test nyquist script creator for audacity to calculate the script's.

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

Re: i'm trying to do postive harmonic's by words and numbers

Post by steve » Sun Mar 01, 2015 10:31 pm

yugioh47 wrote:that's how i learn by copying the oscillator.
That's fine, but the code that you posted is incomplete and does not work. I think it will be much easier for me to help you if we start with something that does work. That is why I am asking if you can provide the original plugin that you have copied from.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

yugioh47
Posts: 334
Joined: Sun Mar 01, 2015 7:52 pm
Operating System: Windows 10

Re: i'm trying to do postive harmonic's by words and numbers

Post by yugioh47 » Mon Mar 02, 2015 7:57 pm

you see steve this the code that i started with:

Code: Select all

;nyquist plug-in
;version 1
;type process
;name "generate harmonics..."
;action "generate harmonics to the band..."



;control width "Band width in octaves" real "octaves" 1.0 0.1 5.0 
;control gain "Gain" real "db" 0.0 -48.0 48.0
;control q "Resonance (Q)" real "" 10 0.1 100
;control n "Number of Harmonics" int "" 8 1 100
;control mode "even Harmonics Only" int "0=all 1=even" 1 0 1
;control waveform "Waveform" int "0=sin 1=tri 2=saw 3=pulse" 0 0 3
;control factor "Amp sweep depth factor" int "factor" 80 1 300 
;control fundamental "fundamental magnitude" int "1.0=min 2.0=max" 1,0, 0,0, 2,0
;control joy "joy magnitude" int "1.0=min 2.0=max" 1,0, 0,0, 2,0
;control love,light "love,light magnitude" int "1.0=min 2.0=max" 1,0, 0,0, 2,0
;control tranquility "tranquility magnitude" int "1.0=min "2.0=max" 1,0, 0,0, 2,0
;control apply "Apply normalization" int "0=no 1=yes" 0 0 1
;control norm-level "Normalization level" real "linear" 0.95 0.0 1.0
i've got a start on it. just don't know what to do next with this code that i'm trying to build the harmonics that i named.

can you please help me learn this?

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

Re: i'm trying to do postive harmonic's by words and numbers

Post by steve » Mon Mar 02, 2015 8:17 pm

yugioh47 wrote:you see steve this the code that i started with:
OK, but that's just the interface part.
Who wrote this bit:

Code: Select all

;; An n "harmonic" oscillator.
;;
(defun hnosc (pitch dur &key (bw 100)(n 8)(even nil))
  (let (hz ffn j)
    (setq hz (step-to-hz pitch))
    (setq ffn (if odd 
		  #'(lambda (j)(* hz (+ (* j 2) 1)))
		#'(lambda (j)(* hz j))))
    (simrep (i (truncate n))
	    (progn 
	      (setq j (+ i 1)) 
	      (scale (/ 1.0 j)
		     (nseosc (joycall jjn j) dur bw))))))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

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

Re: i'm trying to do postive harmonic's by words and numbers

Post by steve » Mon Mar 02, 2015 8:21 pm

yugioh47 wrote:can you please help me learn this?
I'm happy to try, but it will be a lot easier if we start from something that works.

I presume that you used the "hnosc" oscillator because it has similarities with what you want to do. If we can start with a working version of that, then we can look at modifying it to suit your needs.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

yugioh47
Posts: 334
Joined: Sun Mar 01, 2015 7:52 pm
Operating System: Windows 10

Re: i'm trying to do postive harmonic's by words and numbers

Post by yugioh47 » Mon Mar 02, 2015 11:52 pm

OK, but that's just the interface part.
Who wrote this bit:

Code: Select all

;; An n "harmonic" oscillator.
;;
(defun hnosc (pitch dur &key (bw 100)(n 8)(even nil))
  (let (hz ffn j)
    (setq hz (step-to-hz pitch))
    (setq ffn (if odd 
        #'(lambda (j)(* hz (+ (* j 2) 1)))
      #'(lambda (j)(* hz j))))
    (simrep (i (truncate n))
       (progn 
         (setq j (+ i 1)) 
         (scale (/ 1.0 j)
           (nseosc (joycall jjn j) dur bw))))))
i did steve. i was testing this out for my self.

what i don't know is value for nyquist plugin.

yugioh47
Posts: 334
Joined: Sun Mar 01, 2015 7:52 pm
Operating System: Windows 10

Re: i'm trying to do postive harmonic's by words and numbers

Post by yugioh47 » Tue Mar 03, 2015 12:13 am

what the other part do i've got to do i know it's not oscillator to generate like fundamental magnitude. what i need is to do what? what's the other part i've got to do?

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

Re: i'm trying to do postive harmonic's by words and numbers

Post by steve » Tue Mar 03, 2015 12:43 am

OK, so you are defining a function called hnosc and passing to it parameters for pitch and duration, and an additional three keyword arguments: bw, n and even.
So the way that the function would be called would be something like:

Code: Select all

(hnosc 60 1 bw: 2.0 n: 4 even: t)
where the keyword arguments are optional.

You then define a block of code with let which has three local variables: hz, ffn and j.
hz is the 'pitch' parameter converted from steps to Hz.
then you do something strange :?

Code: Select all

(setq ffn (if odd 
That is not going to work because odd is not defined.
I'm guessing that you are wanting the opposite of the even variable?
If so, you could write that as:

Code: Select all

(setq ffn (if (not even) 
The next line is a bit strange too:

Code: Select all

#'(lambda (j)(* hz (+ (* j 2) 1)))
I'm guessing that what you are trying to do is to set j to hz * (2j + 1)
but then in context you are setting the value of fnn
so I'm not sure exactly what you are trying to do here:

Code: Select all

    (setq ffn (if odd
        #'(lambda (j)(* hz (+ (* j 2) 1)))
      #'(lambda (j)(* hz j))))

So then you have a repeat loop to generate your sound.

Code: Select all

(truncate n)
You don't need to truncate n unless there is a possibility that n is not a whole number.

Code: Select all

(progn
  (setq j (+ i 1))
  (scale (/ 1.0 j)
    (nseosc (joycall jjn j) dur bw)))
so now you are calling the function nseosc, which is not yet defined, so I have no idea what you intend that to do.
and the first argument is joycall, which is also undefined, so I have no idea what you intend that to do.
and you are passing the arguments jjn and j to the function joycall, but jjn is as yet undefined.

Sorry to say that your code does not really make much sense.
Perhaps we should start with you describing what you are trying to do.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply