Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi all I have 2 wav stereo sound recorded [not generated by equation] of Tanpura in different scale[pa,ma,ni,sa] or pitch[a,A#,c,c#,b etc...].
http://en.wikipedia.org/wiki/Tanpura[^]
As per i know it has 3 elementry sound [pa-SA-SA-sa] middle one played twice.

I want to create a sound intermidiate of both.

How can I achive that.

I tried doing
1>fft of the sound expecting to see 3 spike
2>making avarage of the 2 sound fft
3>Converting back by ifft and save it.


but in the first hand not able to get 3 distinct spike.
Is it proper way to try?

I am from software domain [with electronics and communication as my Bachelor subject]
Not much confident about these math part.

I am using Octave.[any free tool is ok for me if Octave is not sufficient]
please help.

Thanks in advance.
Posted
Updated 25-Apr-15 9:21am
v2
Comments
Sergey Alexandrovich Kryukov 25-Apr-15 20:44pm    
Define "intermediate". So far, it sounds like you are trying to convert two sounds in one sound... fully equivalent to original two sounds. :-)
Also, I'm probably completely unfamiliar with that "pa,ma,ni,sa" notation. Is it even related to modern "Western" 12-semiton tempered scale? What is it? Any references?
How well are you familiar with theory of music and sound? (Knowing spectral analysis and Fourier would not be enough)?
—SA
shankha2010 26-Apr-15 4:33am    
Yes you are right.Sorry for messing up the question.

Example: Say I am taking input C and C#

yes you are right C and C# are semitone
As per my calculation
C frequency=262
#C frequency =277

I want to generate 3 more intermediate sound of interval (277-262)/3
262 [C]
262+ 5= 267[C1]
267+ 5= 272[C2]
272+ 5= 277[C#]

Why want to take those sound to interpolate this?
Because those are real sound recorded by someone.A sound generated completely by equation will not have that quality.[may some extra low power frequency caused by human error or intension making it different from real sound.]

Is it understandable now? actually I am from India [south] here the sounds are calculated this way.[or may be every where same.]
Regards,
Shankha
Sergey Alexandrovich Kryukov 26-Apr-15 11:08am    
You are talking about Indian tonal system, which is considered as microtonic in Western culture, which also can be applied to any other microtonic system. Now, you are trying to build equal temperament. By some reason, you think that equal musical intervals (micro intervals) are found be adding fixed number of Hertz to a frequency. But this is absurd. Isn't that obvious that physics of hearing makes equal intervals when frequency is multiplied be a fixed factors? And then, the intermediate frequencies are easy to determine...
—SA
RedDk 26-Apr-15 15:35pm    
Looks like you might be interested in what these guys have to say about music ...
http://oeis.org/

1 solution

You messed up everything. Let's see how equal temperament works.

You are trying to create equal temperament based on having 2 intermediate micro-tones between tones of 12-tone European system. It it also pretty apparent that you use the equal temperament and A440 pitch standard as the base. Please see:
http://en.wikipedia.org/wiki/Equal_temperament[^],
http://en.wikipedia.org/wiki/A440_%28pitch_standard%29[^].

See also the article on microtones we would need to discuss: https://en.wikipedia.org/wiki/Microtonal_music[^].

Now, let's see. The physics of musical hearing and musical cognition is based on the harmonics and hence, frequency ratios between the tones. The fixed ratios close to simplest rational numbers are easy to memorize, are clearly recognized, create strong associations in all musical constructs when perceived by hearing. It doesn't depend on particular culture. This is rooted deeply in physics and physiology. We perceive the sounds of the octave interval (exactly double frequency) as "logically equivalent" and two sounds with frequency ratio close to 4/3 and 3/2 as "harmonic" — perfect quarta and quinta. They are really harmonic.

There are many intonational systems in the world, and modern classical music system is the European 12-tone system. You are trying to calculate the frequencies of the systems with 2 (not 3 as you wrote) intermediate tones in the semitone, so you are trying to describe 36-tone system. There are other systems, notable 24-tone ones (see, for example, https://en.wikipedia.org/wiki/Arab_tone_system[^]), and I even heard of 60-tone (like minutes in hour) one.

You should also understand that the desire to make the musical pieces in different keys "logically equivalent", the desire to make all keys "equavalent" which lead to the equal temperaments forces us into using irrational numbers for frequency ratios, which makes equal temperaments non-harmonic where the harmonic frequencies only approximation of truly harmonic ratios, which are always rational numbers. Please see:
http://en.wikipedia.org/wiki/Rational_number[^],
http://en.wikipedia.org/wiki/Irrational_number[^],
just for example: http://en.wikipedia.org/wiki/Just_intonation[^].

In modern so-called authentic music, people often go back to non-equal temperament tone systems, trying music to sound as more harmonic, albeit in some fixed key. It requires instruments to be re-tuned to each specific piece of music, which is actually done, to one or another degree. European baroque equivalents of modern strings instruments (characteristic example: viola de gamba instead of cello) tend to have frets, but each fret, made of the piece of gut, can be tuned individually, which is actually done.

We well see those irrational numbers soon, but make one note: we need to use floating-point data types for calculation of frequencies, never integer types.

We can easily build the frequencies of any of the tonal system. For 12-tone example, let's see.
A and A(II), A and A in next octave, gives us double frequency. Each semitone gives you fixed ratio S.
A = 440 Hz;
A# = A * S;
B = A * S * S;
...
A(II) = A * (S * S * ... 12 times) = A*2.
Therefore S is the 1/12 power if 2, the root of 12 degree of 2, 21/12, pow(2, 12).
The same calculation will go for your 36-tone system. The interval between microtones will be finer, 21/36.

Again, this is the ratio, not fixed number if Hertz!
I got S = 21/12 = 1.0594630943592953 and your microtone M = 21/36 = 1.0194406437021448.

Let's calculate:
Assuming A = 440,
we go in previous octave with C:
C = A *S*S*S / 2 = 261.6255653005987
C♯ = C * S = 277.18263097687213;
now, micro-intervals:
C1 = C * M = 266.71173469897985
C2 = C1 * M = 271.8967825044437

As you can see, my figures are close to yours, by apparent reasons, but you are using totally wrong idea.

[EDIT]

You did not answer my questions on the notation you've shown in [pa,ma,ni,sa] and [pa-SA-SA-sa] examples. But I found that those are the notes in Carnatic rāgas, which I kinds know how they sound, somewhat similar to European 7/12-note system. But this is a different system, not the same as one you are trying to build based on two intermediate microtones between European semitons. It is based on 7 main notes and 16 varieties. I would need more information to analyze the rāgas, which I don't presently have. There are different flavors of rāga, and so on. I'm not sure the calculations I demonstrated can be applied, but I'm sure you can apply the general principle I tried to explain: musical intervals are defined by the ratio between tones.

Indian music is very interesting to me, I would gladly learn a lot more and would be very grateful if someone gives me interesting and informative links on this diverse topic.

I would also like to encourage Indian people to take more interest in their own culture, no less then I, a total foreigner to India, do. :-)

—SA
 
Share this answer
 
v11
Comments
Frankie-C 26-Apr-15 12:24pm    
+5
Sergey Alexandrovich Kryukov 26-Apr-15 12:25pm    
Thank you.
—SA
shankha2010 28-Apr-15 5:56am    
Absolutely awesome and spellbounding.
I was trying to figure out these all explaination from loong days..

I really have very less knowledge about the wave equation of this tanpura.

I assumes it as below: [added what I learnt from your explaination]
A*Sin(w1*T1)+A*Sin(w2*T2)+A*Sin(w2*T3)+A*Sin(w3*T4)
Where
w1 is frequency of PA [A * (S )^5]
w2 is frequency of A [SA]
w3 is frequency of A(II) [SA`]
T1,T2,T3,T4 are consicutive time interval

Please see the sample sound:
http://www.soundsnap.com/tags/tanpura
labled as "TANPUR 1 1 C"
[the waveform is consist of 3 distinct single freq. wave what I was telling [pa-SA-SA-sa] ]
I am trying to help some musical guy who have profound knowledge on music [he is a non technical guy but understands these better than me.]
let me go back to the guy and to resolve the mess.

for now What I can tell is,
Assume a 2D matrix:
I have total 48 sound files C,C♯,D,E♭,E,F,F♯,G,G♯,A,B♭,B [total 12]
for each 12 type above i have [PA,MA,NI,SA]
so 12*4=48 wav files recorded in a studio environment with perfection.

no what have to do is:

INPUT: C-PA.wav and C#-PA.wav
OUTPUT: creating C1-Pa.wav,C2-Pa.wav

So what I thought was,from the above equation I'll take T1 time interval [say from 0th milisec to 2000milisec] from both the input and do fft and get 2 in between freq and do ifft back.
As for each of those interval it behaves as mono tone [single freq] so I thought I can get that. :(


I dont wan't to "Accept Solution" I want more from you Sir :)
Below is one of the simple app I created for testing,
https://play.google.com/store/apps/details?id=com.eswar.EswarMeditation

which is having:
e_panchama_single_t.wav [means E-PA]
Sergey Alexandrovich Kryukov 28-Apr-15 9:21am    
All right, I see, you want to give me quite a work. :-)
Thank you for the references.

All right, two things. I would need some really descriptive definition of the tone systems of rāgas; at least what are the frequency intervals, or on what principles they are built. Are they built on the fixed key or there is way to transpose it? Where are harmonic intervals, are they precisely harmonic (rational ratio) or approximate. I'm not sure your approach based on European 12 tones is applicable. I need something certain.

Also, there are things where just the frequencies are not really applicable. From your samples, I can hear something which is called "drone loops", highly modulated sound. By the way, I would be interested to see the physical techniques of sound generation used on the instrument, but it does not sound to be something so trivial. Let me give you a simple example where the musical effect is not described with the "do re mi fa sol" notation. Play C and C on two different strings at the same time. Same C may give unpleasant effect; usually they are in the same octaves. This happens very often. One C tone "beats" with the 2nd harmonic of second C tone. This is the effect when the two frequencies almost match, but not perfectly (which is always the case, just a bit harder finger press on one or both strings shifts the frequency ratio a bit; it's hardly audible, unless you perform vibrato, or... close to the beating effect).
Please see https://en.wikipedia.org/wiki/Beat_%28acoustics%29.
As you can see, you can consider simplified "slow approximation": the identical waves interfere with some phase, but then phase shift changes with time, ranging from 100% (same phase) or 100% destructive (opposite phases) interference.

Now, what you write is not a wave equation. You don't have time and phase; this is not a function equation at all. The free parameter should be time, to get a function depending on time not some constant. If you want to go with sine wave, here is it:

а(t) = A1*sin(f1t + φ1) + A2*sin(f2t + φ2) +...
where An are amplitudes, fn are frequencies, and φn are phases. Phases are important: if you have two waves with the same A and f, and opposite phases, the resulting wave will be zero!
Strictly speaking, there is also a constant added to the equation, but it does not make any difference in perceived or measured sound.

Even that does not describe the simplest clear sound (already highly simplified, without timbre) realistically, because, in string instrument, you need to describe natural dаmping. In general case, it's much better to write equations in complex numbers.

а(t) = A * e−ω*t + φ (+members from other components)
or
а(t) = A * e−i*ω*t + φ (it just changes the meaning of ω)
If ω is a complex number, it describes both frequency and damping. If ω would be purely real (imaginary part is null), in A * e−i*ω*t + φ it would describe frequency, no damping, and damping would be described with some imaginary part. See also: https://en.wikipedia.org/wiki/Damping.

Further consideration depends on the goal of your calculations. What effects do you want to model or figure out from them?

—SA
Maciej Los 8-May-15 14:34pm    
CaDG x5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900