annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirchromagram/set.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function cc = set(c,varargin)
Daniel@0 2 % SET Set properties for the MIRchromagram object
Daniel@0 3 % and return the updated object
Daniel@0 4
Daniel@0 5 propertyArgIn = varargin;
Daniel@0 6 pl = c.plabel;
Daniel@0 7 wr = c.wrap;
Daniel@0 8 cl = c.chromaclass;
Daniel@0 9 cf = c.chromafreq;
Daniel@0 10 or = c.register;
Daniel@0 11 d = mirdata(c);
Daniel@0 12 d = set(d,'Title',get(c,'Title'),'Abs',get(c,'Abs'),'Ord',get(c,'Ord'));
Daniel@0 13 while length(propertyArgIn) >= 2,
Daniel@0 14 prop = propertyArgIn{1};
Daniel@0 15 val = propertyArgIn{2};
Daniel@0 16 propertyArgIn = propertyArgIn(3:end);
Daniel@0 17 switch prop
Daniel@0 18 case 'Magnitude'
Daniel@0 19 d = set(d,'Data',val);
Daniel@0 20 case 'Chroma'
Daniel@0 21 d = set(d,'Pos',val);
Daniel@0 22 case 'ChromaClass'
Daniel@0 23 cl = val;
Daniel@0 24 case 'ChromaFreq'
Daniel@0 25 cf = val;
Daniel@0 26 case 'Register'
Daniel@0 27 or = val;
Daniel@0 28 case 'PitchLabel'
Daniel@0 29 pl = val;
Daniel@0 30 case 'Wrap'
Daniel@0 31 wr = val;
Daniel@0 32 otherwise
Daniel@0 33 d = set(d,prop,val);
Daniel@0 34 end
Daniel@0 35 end
Daniel@0 36 cc.plabel = pl;
Daniel@0 37 cc.wrap = wr;
Daniel@0 38 cc.chromaclass = cl;
Daniel@0 39 cc.chromafreq = cf;
Daniel@0 40 cc.register = or;
Daniel@0 41 cc = class(cc,'mirchromagram',d);