[mirtoolbox] Re: Problems with mirkey or mirgetdata(mirkey(...))

Hallo Markus,

Just use [d m] = mirgetdata(mirkey(wav))

you will get the mode (1 = major, 2 = minor) as second output (cf. mirgetdata 
documentation).

Would it be OK like that?

Regards,

Olivier

Markus Eichhoff kirjoitti 27.8.2011 kello 9.59:

> Hello Olivier, hello everybody,
> 
> I am preparing a talk for a conference and have seen the following
> problem: If I calculate mirkey it gives me e.g. "C# maj" or "D min" or
> whatever. But if I extract thet data with "mirgetdata" it only gives me
> one number from 1 to 12, i.e. C=1, C#=2, D=3, D#=4, E, F,...
> 
> But isn't there a second number "0" or "1" necessary for the attribute
> "maj" or "min"? Wouldn't it be better to have a two dimensional vector as
> the outcome, e.g. (1,1) = C maj, or (2,0) = C# min?
> Or does mirkey gets the maj/min information by mirmode and only says: The
> tone is in C or in C#, and with mirmode you also get the second
> information? That's a bit strange... Why not combine both in one function
> with a vector as the outcome?
> 
> Below you see the result of two tones. One is seen as major one as minor,
> but with mirgetdata I only get the "name" of the Chord, but not the
> attribute "maj" or "min" for which I am looking:
> 
> 
>>> wav = miraudio([ordner files(i).name], 'Extract', 0,1,'s');
> Elapsed time is 0.026252 seconds.
>>> mirkey(wav)
> 
> The Key related to file
> C:\Users\Public\Documents\Klassifikationsexperimente\Igor_Chords\0005-C#Dur-I-Cello_C#4-Trumpet_F4-AcousticGuitar_G#4.wav
> is C# maj
> 
>>> mirgetdata(mirkey(wav))
> 
> ans =
> 
>     2
> 
>>> wav = miraudio([ordner files(7).name], 'Extract', 0,1,'s');
> Elapsed time is 0.029262 seconds.
>>> mirkey(wav)
> 
> The Key related to file
> C:\Users\Public\Documents\Klassifikationsexperimente\Igor_Chords\0007-C#Dur-I-Flute_C#5-Piano_F5-Cello_G#5.wav
> is C# min
> 
>>> mirgetdata(mirkey(wav))
> 
> ans =
> 
>     2
> 
> 
> 
> Thank you very much for your help!
> 
> Best regards
> Markus
> 
> 


Other related posts: