praat_David_init.cpp 365 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439
  1. /* praat_David_init.cpp
  2. *
  3. * Copyright (C) 1993-2018 David Weenink, 2015 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*
  19. djmw 20030701 Added Strings_setString.
  20. djmw 20031020 Changed Matrix_solveEquation.
  21. djmw 20031023 Added Spectra_multiply, Spectrum_conjugate and modified interface for CCA_TableOfReal_scores.
  22. djmw 20031030 Added TableOfReal_appendColumns.
  23. djmw 20031107 Added TablesOfReal_to_GSVD.
  24. djmw 20040303 Latest modification
  25. djmw 20040305 Added hints for PCA.
  26. djmw 20040323 Added hint for Discriminant.
  27. djmw 20040324 Added PCA_TableOfReal_getFractionVariance.
  28. djmw 20040331 Modified Eigen_drawEigenvalues interface.
  29. djmw 20040406 Extensive checks for creation of Sounds.
  30. djmw 20040414 Forms texts.
  31. djmw 20040523 Discriminant_TableOfReal_to_ClassificationTable: give new object a name.
  32. djmw 20040623 Added ClassificationTable_to_Strings_maximumProbability.
  33. djmw 20040704 BarkFilter... in Thing_recognizeClassesByName.
  34. djmw 20041020 MelderFile -> structMelderFile.
  35. djmw 20041105 TableOfReal_createFromVanNieropData_25females.
  36. djmw 20041108 FormantFilter_drawSpectrum bug correted (wrong field name).
  37. djmw 20050308 Find path (slopes), Find path (band)... and others.
  38. djmw 20050404 TableOfReal_appendColumns -> TableOfReal_appendColumnsMany
  39. djmw 20050406 Procrustus -> Prorustes
  40. djmw 20050407 MelFilter_drawFilterFunctions error in field names crashed praat
  41. djmw 20050706 Eigen_getSumOfEigenvalues
  42. djmw 20051012 Robust LPC analysis test
  43. djmw 20051116 TableOfReal_drawScatterPlot horizontal and vertical axes indices should be positive numbers
  44. djmw SVD extract lef/right singular vectors
  45. djmw 20060111 TextGrid: Extend time moved from depth 1 to depth 2.
  46. djmw 20060308 Thing_recognizeClassesByName: StringsIndex, CCA
  47. djmw 20070206 Sound_changeGender: pitch range factor should be >= 0
  48. djmw 20070304 Latest modification.
  49. djmw 20070903 Melder_new<1...>
  50. djmw 20071011 REQUIRE requires U"".
  51. djmw 20071202 Melder_warning<n>
  52. djmw 20080521 Confusion_drawAsnumbers
  53. djmw 20090109 KlattGrid formulas for formant
  54. djmw 20090708 KlattTable <-> Table
  55. djmw 20090822 Thing_recognizeClassesByName: added classCepstrum, classIndex, classKlattTable
  56. djmw 20090914 Excitation to Excitations crashed because of nullptr reference
  57. djmw 20090927 TableOfReal_drawRow(s)asHistogram
  58. djmw 20091023 Sound_draw_selectedIntervals
  59. djmw 20091230 Covariance_TableOfReal_mahalanobis
  60. djmw 20100212 Standardize on Window length
  61. djmw 20100511 Categories_getNumberOfCategories
  62. djmw 20120813 Latest modification.
  63. */
  64. #include "NUMcomplex.h"
  65. #include "NUMmachar.h"
  66. #include "ActivationList.h"
  67. #include "Categories.h"
  68. #include "CategoriesEditor.h"
  69. #include "ClassificationTable.h"
  70. #include "Collection_extensions.h"
  71. #include "ComplexSpectrogram.h"
  72. #include "Confusion.h"
  73. #include "Discriminant.h"
  74. #include "EditDistanceTable.h"
  75. #include "Editor.h"
  76. #include "EditDistanceTable.h"
  77. #include "Eigen_and_Matrix.h"
  78. #include "Eigen_and_Procrustes.h"
  79. #include "Eigen_and_SSCP.h"
  80. #include "Eigen_and_TableOfReal.h"
  81. #include "Excitations.h"
  82. #include "espeakdata_FileInMemory.h"
  83. #include "FileInMemoryManager.h"
  84. #include "FilterBank.h"
  85. #include "Formula.h"
  86. #include "FormantGridEditor.h"
  87. #include "DataModeler.h"
  88. #include "FormantGrid_extensions.h"
  89. #include "Intensity_extensions.h"
  90. #include "IntensityTierEditor.h"
  91. #include "Matrix_Categories.h"
  92. #include "Matrix_extensions.h"
  93. #include "LongSound_extensions.h"
  94. #include "KlattGridEditors.h"
  95. #include "KlattTable.h"
  96. #include "Ltas_extensions.h"
  97. #include "Minimizers.h"
  98. #include "PatternList.h"
  99. #include "PCA.h"
  100. #include "PitchTierEditor.h"
  101. #include "Polygon_extensions.h"
  102. #include "Polynomial.h"
  103. #include "Sound_extensions.h"
  104. #include "Sounds_to_DTW.h"
  105. #include "Spectrum_extensions.h"
  106. #include "Spectrogram.h"
  107. #include "SpeechSynthesizer.h"
  108. #include "SpeechSynthesizer_and_TextGrid.h"
  109. #include "SSCP.h"
  110. #include "Strings_extensions.h"
  111. #include "SVD.h"
  112. #include "Table_extensions.h"
  113. #include "TableOfReal_and_Permutation.h"
  114. #include "TextGrid_extensions.h"
  115. #include "Categories_and_Strings.h"
  116. #include "CCA_and_Correlation.h"
  117. #include "Cepstrum_and_Spectrum.h"
  118. #include "CCs_to_DTW.h"
  119. #include "Discriminant_PatternList_Categories.h"
  120. #include "DTW_and_TextGrid.h"
  121. #include "Permutation_and_Index.h"
  122. #include "Pitch_extensions.h"
  123. #include "Sound_and_Spectrogram_extensions.h"
  124. #include "Sound_to_Pitch2.h"
  125. #include "Sound_to_SPINET.h"
  126. #include "TableOfReal_and_SVD.h"
  127. #include "TextGrid_and_DurationTier.h"
  128. #include "TextGrid_and_PitchTier.h"
  129. #include "VowelEditor.h"
  130. #include "praat_TimeFrameSampled.h"
  131. #include "praat_Matrix.h"
  132. #include "praat_TableOfReal.h"
  133. #include "praat_uvafon.h"
  134. #undef iam
  135. #define iam iam_LOOP
  136. static const conststring32 QUERY_BUTTON = U"Query -";
  137. static const conststring32 DRAW_BUTTON = U"Draw -";
  138. static const conststring32 MODIFY_BUTTON = U"Modify -";
  139. static const conststring32 EXTRACT_BUTTON = U"Extract -";
  140. void praat_TableOfReal_init2 (ClassInfo klas);
  141. void praat_SSCP_as_TableOfReal_init (ClassInfo klas);
  142. void praat_CC_init (ClassInfo klas);
  143. void praat_BandFilterSpectrogram_query_init (ClassInfo klas);
  144. void praat_EditDistanceTable_as_TableOfReal_init (ClassInfo klas);
  145. #define DTW_constraints_addCommonFields(matchStart,matchEnd,slopeConstraint) \
  146. LABEL (U"Boundary conditions") \
  147. BOOLEAN (matchStart, U"Match begin positions", false) \
  148. BOOLEAN (matchEnd, U"Match end positions", false) \
  149. RADIO (slopeConstraint, U"Slope constraint", 1) \
  150. RADIOBUTTON (U"no restriction") \
  151. RADIOBUTTON (U"1/3 < slope < 3") \
  152. RADIOBUTTON (U"1/2 < slope < 2") \
  153. RADIOBUTTON (U"2/3 < slope < 3/2")
  154. #undef INCLUDE_DTW_SLOPES
  155. #define FIND_ONE_AND_GENERIC(klas1,klas2) \
  156. klas1 me = nullptr; klas2 you = nullptr; \
  157. LOOP { if (CLASS == class##klas1) me = (klas1) OBJECT; \
  158. else if (Thing_isSubclass (CLASS, class##klas2)) { you = (klas2) OBJECT; } } \
  159. Melder_assert (me && you);
  160. #define CONVERT_ONE_AND_GENERIC(klas1,klas2) FIND_ONE_AND_GENERIC(klas1,klas2)
  161. #define CONVERT_ONE_AND_GENERIC_END(...) praat_new (result.move(), __VA_ARGS__); END
  162. /********************** Activation *******************************************/
  163. FORM (MODIFY_ActivationList_formula, U"ActivationList: Formula", nullptr) {
  164. LABEL (U"for col := 1 to ncol do { self [row, col] := `formula' ; x := x + dx } y := y + dy }}")
  165. TEXTFIELD (formula, U"Formula:", U"self")
  166. OK
  167. DO
  168. MODIFY_EACH (ActivationList)
  169. Matrix_formula (me, formula, interpreter, nullptr);
  170. MODIFY_EACH_END
  171. }
  172. DIRECT (NEW_ActivationList_to_Matrix) {
  173. CONVERT_EACH (ActivationList)
  174. autoMatrix result = ActivationList_to_Matrix (me);
  175. CONVERT_EACH_END (my name.get())
  176. }
  177. DIRECT (NEW_ActivationList_to_PatternList) {
  178. CONVERT_EACH (ActivationList)
  179. autoPatternList result = ActivationList_to_PatternList (me);
  180. CONVERT_EACH_END (my name.get())
  181. }
  182. /********************** BandFilterSpectrogram *******************************************/
  183. FORM (GRAPHICS_BandFilterSpectrogram_drawFrequencyScale, U"", U"") {
  184. REAL (fromFrequency, U"left Horizontal frequency range (Hz)", U"0.0")
  185. REAL (toFrequency, U"right Horizontal frequency range (Hz)", U"0.0")
  186. REAL (yFromFrequency, U"left Vertical frequency range (mel)", U"0.0")
  187. REAL (yToFrequency, U"right Vertical frequency range (mel)", U"0.0")
  188. BOOLEAN (garnish, U"Garnish", true)
  189. OK
  190. DO
  191. GRAPHICS_EACH (BandFilterSpectrogram)
  192. BandFilterSpectrogram_drawFrequencyScale (me, GRAPHICS, fromFrequency, toFrequency, yFromFrequency, yToFrequency, garnish);
  193. GRAPHICS_EACH_END
  194. }
  195. /********************** BarkFilter *******************************************/
  196. DIRECT (HELP_BarkFilter_help) {
  197. HELP (U"BarkFilter")
  198. }
  199. DIRECT (HELP_BarkSpectrogram_help) {
  200. HELP (U"BarkSpectrogram")
  201. }
  202. FORM (GRAPHICS_BarkFilter_drawSpectrum, U"BarkFilter: Draw spectrum (slice)", U"FilterBank: Draw spectrum (slice)...") {
  203. REAL (time, U"Time (s)", U"0.1")
  204. REAL (fromFrequency, U"left Frequency range (Bark)", U"0.0")
  205. REAL (toFrequency, U"right Frequency range (Bark)", U"0.0")
  206. REAL (fromAmplitude, U"left Amplitude range (dB)", U"0.0")
  207. REAL (toAmplitude, U"right Amplitude range (dB)", U"0.0")
  208. BOOLEAN (garnish, U"Garnish", true)
  209. OK
  210. DO
  211. GRAPHICS_EACH (BarkFilter)
  212. FilterBank_drawTimeSlice (me, GRAPHICS, time, fromFrequency, toFrequency, fromAmplitude, toAmplitude, U"Barks", garnish);
  213. GRAPHICS_EACH_END
  214. }
  215. FORM (GRAPHICS_BarkFilter_drawSekeyHansonFilterFunctions, U"BarkFilter: Draw filter functions", U"FilterBank: Draw filter functions...") {
  216. INTEGER (fromFilter, U"left Filter range", U"0")
  217. INTEGER (toFilter, U"right Filter range", U"0")
  218. RADIO (frequencyScale, U"Frequency scale", 1)
  219. RADIOBUTTON (U"Hertz")
  220. RADIOBUTTON (U"Bark")
  221. RADIOBUTTON (U"mel")
  222. REAL (fromFrequency, U"left Frequency range", U"0.0")
  223. REAL (toFrequency, U"right Frequency range", U"0.0")
  224. BOOLEAN (amplitudeScale_dB, U"Amplitude scale in dB", true)
  225. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  226. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  227. BOOLEAN (garnish, U"Garnish", true)
  228. OK
  229. DO
  230. GRAPHICS_EACH (BarkFilter)
  231. BarkFilter_drawSekeyHansonFilterFunctions (me, GRAPHICS, frequencyScale, fromFilter, toFilter, fromFrequency, toFrequency, amplitudeScale_dB, fromAmplitude, toAmplitude, garnish);
  232. GRAPHICS_EACH_END
  233. }
  234. FORM (GRAPHICS_BarkSpectrogram_drawSekeyHansonAuditoryFilters, U"BarkSpectrogram: Draw Sekey-Hanson auditory filters", U"BarkSpectrogram: Draw Sekey-Hanson auditory filters...") {
  235. INTEGER (fromFilter, U"left Filter range", U"0")
  236. INTEGER (toFilter, U"right Filter range", U"0")
  237. RADIO (frequencyScale, U"Frequency scale", 2)
  238. RADIOBUTTON (U"Hertz")
  239. RADIOBUTTON (U"Bark")
  240. REAL (fromFrequency, U"left Frequency range", U"0.0")
  241. REAL (toFrequency, U"right Frequency range", U"0.0")
  242. BOOLEAN (amplitudeScale_dB, U"Amplitude scale in dB", true)
  243. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  244. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  245. BOOLEAN (garnish, U"Garnish", true)
  246. OK
  247. DO
  248. GRAPHICS_EACH (BarkSpectrogram)
  249. bool xIsHertz = (frequencyScale == 1);
  250. BarkSpectrogram_drawSekeyHansonFilterFunctions (me, GRAPHICS, xIsHertz, fromFilter, toFilter, fromFrequency, toFrequency, amplitudeScale_dB, fromAmplitude, toAmplitude, garnish);
  251. GRAPHICS_EACH_END
  252. }
  253. FORM (GRAPHICS_BarkFilter_paint, U"FilterBank: Paint", nullptr) {
  254. praat_TimeFunction_RANGE(fromTime,toTime)
  255. REAL (fromFrequency, U"left Frequency range (bark)", U"0.0")
  256. REAL (toFrequency, U"right Frequency range (bark)", U"0.0")
  257. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  258. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  259. BOOLEAN (garnish, U"Garnish", false)
  260. OK
  261. DO
  262. GRAPHICS_EACH (BarkFilter)
  263. FilterBank_paint ((FilterBank) me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude, garnish);
  264. GRAPHICS_EACH_END
  265. }
  266. DIRECT (NEW_BarkFilter_to_BarkSpectrogram) {
  267. CONVERT_EACH (BarkFilter)
  268. autoBarkSpectrogram result = BarkFilter_to_BarkSpectrogram (me);
  269. CONVERT_EACH_END (my name.get())
  270. }
  271. DIRECT (NEW_MelFilter_to_MelSpectrogram) {
  272. CONVERT_EACH (MelFilter)
  273. autoMelSpectrogram result = MelFilter_to_MelSpectrogram (me);
  274. CONVERT_EACH_END (my name.get())
  275. }
  276. DIRECT (NEW_FormantFilter_to_Spectrogram) {
  277. CONVERT_EACH (FormantFilter);
  278. autoSpectrogram result = FormantFilter_to_Spectrogram (me);
  279. CONVERT_EACH_END (my name.get())
  280. }
  281. /********************** Categories ****************************************/
  282. FORM (MODIFY_Categories_appendCategory, U"Categories: Append 1 category", U"Categories: Append 1 category...") {
  283. SENTENCE (category, U"Category", U"")
  284. OK
  285. DO
  286. MODIFY_EACH (Categories)
  287. OrderedOfString_append (me, category);
  288. MODIFY_EACH_END
  289. }
  290. DIRECT (WINDOW_Categories_edit) {
  291. if (theCurrentPraatApplication -> batch) {
  292. Melder_throw (U"Cannot edit a Categories from batch.");
  293. } else {
  294. LOOP {
  295. iam (Categories);
  296. autoCategoriesEditor editor = CategoriesEditor_create (my name.get(), me);
  297. praat_installEditor (editor.get(), IOBJECT);
  298. editor.releaseToUser();
  299. }
  300. }
  301. END }
  302. DIRECT (INTEGER_Categories_getNumberOfCategories) {
  303. INTEGER_ONE (Categories)
  304. integer result = my size;
  305. INTEGER_ONE_END (U" categories")
  306. }
  307. DIRECT (INTEGER_Categories_getNumberOfDifferences) {
  308. NUMBER_COUPLE (Categories)
  309. integer result = OrderedOfString_getNumberOfDifferences (me, you);
  310. NUMBER_COUPLE_END (U" differences")
  311. }
  312. DIRECT (REAL_Categories_getFractionDifferent) {
  313. NUMBER_COUPLE (Categories)
  314. double result = OrderedOfString_getFractionDifferent (me, you);
  315. NUMBER_COUPLE_END (U" (fraction different)")
  316. }
  317. DIRECT (NEW_Categories_selectUniqueItems) {
  318. CONVERT_EACH (Categories)
  319. autoCategories result = Categories_selectUniqueItems (me);
  320. CONVERT_EACH_END (my name.get(), U"_uniq")
  321. }
  322. DIRECT (NEW_Categories_to_Confusion) {
  323. CONVERT_COUPLE (Categories)
  324. autoConfusion result = Categories_to_Confusion (me, you);
  325. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  326. }
  327. DIRECT (NEW_Categories_to_Strings) {
  328. CONVERT_EACH (Categories)
  329. autoStrings result = Categories_to_Strings (me);
  330. CONVERT_EACH_END (my name.get())
  331. }
  332. DIRECT (NEW1_Categories_join) {
  333. CONVERT_COUPLE (Categories)
  334. autoStringList result = OrderedOfString_joinItems (me, you);
  335. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  336. }
  337. DIRECT (NEW_Categories_permuteItems) {
  338. CONVERT_EACH (Collection)
  339. autoCollection result = Collection_permuteItems (me);
  340. CONVERT_EACH_END (my name.get(), U"_perm")
  341. }
  342. /***************** CC ****************************************/
  343. FORM (INTEGER_CC_getNumberOfCoefficients, U"Get number of coefficients", nullptr) {
  344. NATURAL (frameNumber, U"Frame number", U"1")
  345. OK
  346. DO
  347. INTEGER_ONE (CC)
  348. integer result = CC_getNumberOfCoefficients (me, frameNumber);
  349. INTEGER_ONE_END (U" (number of coefficients)")
  350. }
  351. FORM (REAL_CC_getValue, U"CC: Get value", U"CC: Get value...") {
  352. REAL (time, U"Time (s)", U"0.1")
  353. NATURAL (index, U"Index", U"1")
  354. OK
  355. DO
  356. NUMBER_ONE (CC)
  357. double result = CC_getValue (me, time, index);
  358. NUMBER_ONE_END (U" value")
  359. }
  360. FORM (REAL_CC_getValueInFrame, U"CC: Get value in frame", U"CC: Get value in frame...") {
  361. NATURAL (frameNumber, U"Frame number", U"1")
  362. NATURAL (index, U"Index", U"1")
  363. OK
  364. DO
  365. NUMBER_ONE (CC)
  366. double result = CC_getValueInFrame (me, frameNumber, index);
  367. NUMBER_ONE_END (U" value")
  368. }
  369. FORM (REAL_CC_getC0ValueInFrame, U"CC: Get c0 value in frame", U"CC: Get c0 value in frame...") {
  370. NATURAL (frameNumber, U"Frame number", U"1")
  371. OK
  372. DO
  373. NUMBER_ONE (CC)
  374. double result = CC_getC0ValueInFrame (me, frameNumber);
  375. NUMBER_ONE_END (U" value")
  376. }
  377. FORM (GRAPHICS_CC_paint, U"CC: Paint", U"CC: Paint...") {
  378. praat_TimeFunction_RANGE (fromTime, toTime)
  379. INTEGER (fromCoefficient, U"From coefficient", U"0")
  380. INTEGER (toCoefficient, U"To coefficient", U"0")
  381. REAL (minimum, U"Minimum", U"0.0")
  382. REAL (maximum, U"Maximum", U"0.0")
  383. BOOLEAN (garnish, U"Garnish", true)
  384. OK
  385. DO
  386. GRAPHICS_EACH (CC)
  387. CC_paint (me, GRAPHICS, fromTime, toTime, fromCoefficient, toCoefficient, minimum, maximum, garnish);
  388. GRAPHICS_EACH_END
  389. }
  390. FORM (GRAPHICS_CC_drawC0, U"CC: Draw c0", U"CC: Draw c0...") {
  391. praat_TimeFunction_RANGE(fromTime,toTime)
  392. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  393. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  394. BOOLEAN (garnish, U"Garnish", true)
  395. OK
  396. DO
  397. GRAPHICS_EACH (CC)
  398. CC_drawC0 (me, GRAPHICS, fromTime, toTime,fromAmplitude, toAmplitude, garnish);
  399. GRAPHICS_EACH_END
  400. }
  401. FORM (NEW1_CCs_to_DTW, U"CC: To DTW", U"CC: To DTW...") {
  402. LABEL (U"Distance between cepstral coefficients")
  403. REAL (cepstralWeight, U"Cepstral weight", U"1.0")
  404. REAL (logEnergyWeight, U"Log energy weight", U"0.0")
  405. REAL (regressionWeight, U"Regression weight", U"0.0")
  406. REAL (regressionLogEnergyWeight, U"Regression log energy weight", U"0.0")
  407. REAL (regressionWindowLength, U"Regression window length (s)", U"0.056")
  408. DTW_constraints_addCommonFields (matchStart, matchEnd, slopeConstraint)
  409. OK
  410. DO
  411. CONVERT_COUPLE (CC)
  412. autoDTW result = CCs_to_DTW (me, you, cepstralWeight, logEnergyWeight, regressionWeight, regressionLogEnergyWeight, regressionWindowLength);
  413. DTW_findPath (result.get(), matchStart, matchEnd, slopeConstraint);
  414. CONVERT_COUPLE_END (my name.get(), U"_", your name.get());
  415. }
  416. DIRECT (NEW_CC_to_Matrix) {
  417. CONVERT_EACH (CC)
  418. autoMatrix result = CC_to_Matrix (me);
  419. CONVERT_EACH_END (my name.get())
  420. }
  421. /******************* class CCA ********************************/
  422. DIRECT (HELP_CCA_help) {
  423. HELP (U"CCA")
  424. }
  425. FORM (GRAPHICS_CCA_drawEigenvector, U"CCA: Draw eigenvector", U"Eigen: Draw eigenvector...") {
  426. OPTIONMENU (xOrY, U"X or Y", 1)
  427. OPTION (U"y")
  428. OPTION (U"x")
  429. INTEGER (eigenVectorNumber, U"Eigenvector number", U"1")
  430. LABEL (U"Multiply by eigenvalue?")
  431. BOOLEAN (useComponentLoadings, U"Component loadings", false)
  432. LABEL (U"Select part of the eigenvector:")
  433. INTEGER (fromElement, U"left Element range", U"0")
  434. INTEGER (toElement, U"right Element range", U"0")
  435. REAL (fromAmplitude, U"left Amplitude range", U"-1.0")
  436. REAL (toAmplitude, U"right Amplitude range", U"1.0")
  437. POSITIVE (markSize_mm, U"Mark size (mm)", U"1.0")
  438. SENTENCE (mark_string, U"Mark string (+xo.)", U"+")
  439. BOOLEAN (connectPoints, U"Connect points", true)
  440. BOOLEAN (garnish, U"Garnish", true)
  441. OK
  442. DO
  443. GRAPHICS_EACH (CCA)
  444. CCA_drawEigenvector (me, GRAPHICS, xOrY, eigenVectorNumber, fromElement, toElement, fromAmplitude, toAmplitude, useComponentLoadings, markSize_mm, mark_string, connectPoints, garnish);
  445. GRAPHICS_EACH_END
  446. }
  447. DIRECT (INTEGER_CCA_getNumberOfCorrelations) {
  448. INTEGER_ONE (CCA)
  449. integer result = my numberOfCoefficients;
  450. INTEGER_ONE_END (U"")
  451. }
  452. FORM (REAL_CCA_getCorrelation, U"CCA: Get canonical correlation coefficient", U"CCA: Get canonical correlation coefficient") {
  453. NATURAL (coefficientNuber, U"Coefficient number", U"1")
  454. OK
  455. DO
  456. NUMBER_ONE (CCA)
  457. double result = CCA_getCorrelationCoefficient (me, coefficientNuber);
  458. NUMBER_ONE_END (U"")
  459. }
  460. FORM (REAL_CCA_getEigenvectorElement, U"CCA: Get eigenvector element", U"Eigen: Get eigenvector element...") {
  461. OPTIONMENU (xOrY, U"X or Y", 1)
  462. OPTION (U"y")
  463. OPTION (U"x")
  464. NATURAL (eigenvectorNumber, U"Eigenvector number", U"1")
  465. NATURAL (elementNumber, U"Element number", U"1")
  466. OK
  467. DO
  468. NUMBER_ONE (CCA)
  469. double result = CCA_getEigenvectorElement (me, xOrY, eigenvectorNumber, elementNumber);
  470. NUMBER_ONE_END (U"")
  471. }
  472. FORM (REAL_CCA_getZeroCorrelationProbability, U"CCA: Get zero correlation probability", U"CCA: Get zero correlation probability...") {
  473. NATURAL (coefficientNumber, U"Coefficient number", U"1")
  474. OK
  475. DO
  476. NUMBER_ONE (CCA)
  477. double result, chisq, df;
  478. CCA_getZeroCorrelationProbability (me, coefficientNumber, & result, & chisq, & df);
  479. NUMBER_ONE_END (U" (= probability for chisq = ", chisq, U" and ndf = ", df, U")");
  480. }
  481. DIRECT (NEW1_CCA_Correlation_to_TableOfReal_loadings) {
  482. CONVERT_TWO (CCA, Correlation)
  483. autoTableOfReal result = CCA_Correlation_factorLoadings (me, you);
  484. CONVERT_TWO_END (my name.get(), U"_loadings")
  485. }
  486. FORM (REAL_CCA_Correlation_getVarianceFraction, U"CCA & Correlation: Get variance fraction", U"CCA & Correlation: Get variance fraction...") {
  487. LABEL (U"Get the fraction of variance from the data in set...")
  488. OPTIONMENU (xOrY, U"X or Y", 1)
  489. OPTION (U"y")
  490. OPTION (U"x")
  491. LABEL (U"extracted by...")
  492. NATURAL (fromCanonicalVariate, U"left Canonical variate range", U"1")
  493. NATURAL (toCanonicalVariate, U"right Canonical variate range", U"1")
  494. OK
  495. DO
  496. NUMBER_TWO (CCA, Correlation)
  497. double result = CCA_Correlation_getVarianceFraction (me, you, xOrY, fromCanonicalVariate, toCanonicalVariate);
  498. NUMBER_TWO_END (U" (fraction variance from ", (xOrY == 1 ? U"y" : U"x"), U", extracted by canonical variates ", fromCanonicalVariate, U" to ", toCanonicalVariate, U")")
  499. }
  500. FORM (REAL_CCA_Correlation_getRedundancy_sl, U"CCA & Correlation: Get Stewart-Love redundancy", U"CCA & Correlation: Get redundancy (sl)...") {
  501. LABEL (U"Get the redundancy of the data in set...")
  502. OPTIONMENU (xOrY, U"X or Y", 1)
  503. OPTION (U"y")
  504. OPTION (U"x")
  505. LABEL (U"extracted by...")
  506. NATURAL (fromCanonicalVariate, U"left Canonical variate range", U"1")
  507. NATURAL (toCanonicalVariate, U"right Canonical variate range", U"1")
  508. LABEL (U"...given the availability of the data in the other set.")
  509. OK
  510. DO
  511. NUMBER_TWO (CCA, Correlation)
  512. double result = CCA_Correlation_getRedundancy_sl (me, you, xOrY, fromCanonicalVariate, toCanonicalVariate);
  513. NUMBER_TWO_END (U" (redundancy from ", (xOrY == 1 ? U"y" : U"x"), U" extracted by canonical variates ", fromCanonicalVariate, U" to ", toCanonicalVariate, U")")
  514. }
  515. DIRECT (NEW_CCA_TableOfReal_to_TableOfReal_loadings) {
  516. CONVERT_TWO (CCA, TableOfReal)
  517. autoTableOfReal result = CCA_TableOfReal_factorLoadings (me, you);
  518. CONVERT_TWO_END (my name.get(), U"_loadings")
  519. }
  520. FORM (NEW_CCA_TableOfReal_to_TableOfReal_scores, U"CCA & TableOfReal: To TableOfReal (scores)", U"CCA & TableOfReal: To TableOfReal (scores)...") {
  521. INTEGER (numberOfCanonicalVariates, U"Number of canonical correlations", U"0 (= all)")
  522. OK
  523. DO
  524. CONVERT_TWO (CCA, TableOfReal)
  525. autoTableOfReal result = CCA_TableOfReal_scores (me, you, numberOfCanonicalVariates);
  526. CONVERT_TWO_END (my name.get(), U"_scores");
  527. }
  528. FORM (NEW1_CCA_TableOfReal_predict, U"CCA & TableOfReal: Predict", U"CCA & TableOfReal: Predict...") {
  529. LABEL (U"The data set from which to predict starts at...")
  530. INTEGER (columnNumber, U"Column number", U"1")
  531. OK
  532. DO
  533. CONVERT_TWO (CCA, TableOfReal)
  534. autoTableOfReal result = CCA_TableOfReal_predict (me, you, columnNumber);
  535. CONVERT_TWO_END (your name.get(), U"_", my name.get())
  536. }
  537. FORM (NEW_CCA_extractEigen, U"CCA: Exxtract Eigen", nullptr) {
  538. OPTIONMENU (choice, U"variablesType", 1)
  539. OPTION (U"Dependent")
  540. OPTION (U"Independent")
  541. OK
  542. DO
  543. CONVERT_EACH (CCA)
  544. autoEigen result = choice == 1 ? Data_copy (my y.get()) : Data_copy (my x.get());
  545. CONVERT_EACH_END (my name.get(), ( choice == 1 ? U"_y" : U"_x" ))
  546. }
  547. /***************** ChebyshevSeries ****************************************/
  548. DIRECT (HELP_ChebyshevSeries_help) {
  549. HELP (U"ChebyshevSeries")
  550. }
  551. FORM (NEW1_ChebyshevSeries_create, U"Create ChebyshevSeries", U"Create ChebyshevSeries...") {
  552. WORD (name, U"Name", U"cs")
  553. LABEL (U"Domain")
  554. REAL (xmin, U"Xmin", U"-1")
  555. REAL (xmax, U"Xmax", U"1")
  556. LABEL (U"ChebyshevSeries(x) = c[1] T[0](x) + c[2] T[1](x) + ... c[n+1] T[n](x)")
  557. LABEL (U"T[k] is a Chebyshev polynomial of degree k")
  558. SENTENCE (coefficients_string, U"Coefficients (c[k])", U"0 0 1.0")
  559. OK
  560. DO
  561. Melder_require (xmin < xmax, U"Xmin should be smaller than Xmax.");
  562. CREATE_ONE
  563. autoChebyshevSeries result = ChebyshevSeries_createFromString (xmin, xmax, coefficients_string);
  564. CREATE_ONE_END (name)
  565. }
  566. DIRECT (NEW_ChebyshevSeries_to_Polynomial) {
  567. CONVERT_EACH (ChebyshevSeries)
  568. autoPolynomial result = ChebyshevSeries_to_Polynomial (me);
  569. CONVERT_EACH_END (my name.get());
  570. }
  571. /***************** ClassificationTable ****************************************/
  572. DIRECT (HELP_ClassificationTable_help) {
  573. HELP (U"ClassificationTable")
  574. }
  575. FORM (INTEGER_ClassificationTable_getClassIndexAtMaximumInRow, U"ClassificationTable: Get class index at maximum in row", nullptr) {
  576. NATURAL (rowNumber, U"Row number", U"1")
  577. OK
  578. DO
  579. INTEGER_ONE (ClassificationTable)
  580. integer result = TableOfReal_getColumnIndexAtMaximumInRow (me, rowNumber);
  581. INTEGER_ONE_END (U" (class index at maximum in row)")
  582. }
  583. FORM (INTEGER_ClassificationTable_getClassLabelAtMaximumInRow, U"ClassificationTable: Get class label at maximum in row", nullptr) {
  584. NATURAL (rowNumber, U"Row number", U"1")
  585. OK
  586. DO
  587. STRING_ONE (ClassificationTable)
  588. conststring32 result = TableOfReal_getColumnLabelAtMaximumInRow (me, rowNumber);
  589. STRING_ONE_END
  590. }
  591. // deprecated 2014
  592. DIRECT (NEW_ClassificationTable_to_Confusion_old) {
  593. CONVERT_EACH (ClassificationTable)
  594. autoConfusion result = ClassificationTable_to_Confusion (me, false);
  595. CONVERT_EACH_END (my name.get())
  596. }
  597. FORM (NEW_ClassificationTable_to_Confusion, U"ClassificationTable: To Confusion", U"ClassificationTable: To Confusion...") {
  598. BOOLEAN (onlyClassLabels, U"Only class labels", true)
  599. OK
  600. DO
  601. CONVERT_EACH (ClassificationTable)
  602. autoConfusion result = ClassificationTable_to_Confusion (me, onlyClassLabels);
  603. CONVERT_EACH_END (my name.get())
  604. }
  605. DIRECT (NEW_ClassificationTable_to_Correlation_columns) {
  606. CONVERT_EACH (ClassificationTable)
  607. autoCorrelation result = ClassificationTable_to_Correlation_columns (me);
  608. CONVERT_EACH_END (my name.get(), U"_col")
  609. }
  610. DIRECT (NEW_ClassificationTable_to_Strings_maximumProbability) {
  611. CONVERT_EACH (ClassificationTable)
  612. autoStrings result = ClassificationTable_to_Strings_maximumProbability (me);
  613. CONVERT_EACH_END (my name.get())
  614. }
  615. /********************** Confusion *******************************************/
  616. DIRECT (HELP_Confusion_help) {
  617. HELP (U"Confusion")
  618. }
  619. FORM (NEW1_Confusion_createSimple, U"Create simple Confusion", U"Create simple Confusion...") {
  620. WORD (name, U"Name", U"simple")
  621. SENTENCE (labels, U"Labels", U"u i a")
  622. OK
  623. DO
  624. CREATE_ONE
  625. autoConfusion result = Confusion_createSimple (labels);
  626. CREATE_ONE_END (name)
  627. }
  628. FORM (MODIFY_Confusion_increase, U"Confusion: Increase", U"Confusion: Increase...") {
  629. WORD (stimulus, U"Stimulus", U"u")
  630. WORD (response, U"Response", U"i")
  631. OK
  632. DO
  633. MODIFY_EACH (Confusion)
  634. Confusion_increase (me, stimulus, response);
  635. MODIFY_EACH_END
  636. }
  637. FORM (REAL_Confusion_getValue_labels, U"Confusion: Get value", nullptr) {
  638. WORD (stimulus, U"Stimulus", U"u")
  639. WORD (response, U"Response", U"i")
  640. OK
  641. DO
  642. NUMBER_ONE (Confusion)
  643. double result = Confusion_getValue (me, stimulus, response);
  644. NUMBER_ONE_END (U" ([\"", stimulus, U"\", \"", response, U"\"])")
  645. }
  646. FORM (REAL_Confusion_getResponseSum, U"Confusion: Get response sum", U"Confusion: Get response sum...") {
  647. WORD (response, U"Response", U"u")
  648. OK
  649. DO
  650. NUMBER_ONE (TableOfReal)
  651. double result = TableOfReal_getColumnSumByLabel (me, response);
  652. NUMBER_ONE_END (U" (response sum)")
  653. }
  654. FORM (REAL_Confusion_getStimulusSum, U"Confusion: Get stimulus sum", U"Confusion: Get stimulus sum...") {
  655. WORD (stimulus, U"Stimulus", U"u")
  656. OK
  657. DO
  658. NUMBER_ONE (TableOfReal)
  659. double result = TableOfReal_getRowSumByLabel (me, stimulus);
  660. NUMBER_ONE_END (U" (stimulus sum)")
  661. }
  662. DIRECT (NEW_Confusion_to_TableOfReal_marginals) {
  663. CONVERT_EACH (Confusion)
  664. autoTableOfReal result = Confusion_to_TableOfReal_marginals (me);
  665. CONVERT_EACH_END (my name.get())
  666. }
  667. DIRECT (NEW1_Confusion_difference) {
  668. CONVERT_COUPLE (Confusion)
  669. autoMatrix result = Confusion_difference (me, you);
  670. CONVERT_COUPLE_END (U"diffs")
  671. }
  672. FORM (NEW_Confusion_condense, U"Confusion: Condense", U"Confusion: Condense...") {
  673. SENTENCE (search_string, U"Search", U"^(u|i)$")
  674. SENTENCE (replace_string, U"Replace", U"high")
  675. INTEGER (replaceLimit, U"Replace limit", U"0 (= unlimited)")
  676. RADIOx (matchType, U"Search and replace are", 2, 0)
  677. RADIOBUTTON (U"Literals")
  678. RADIOBUTTON (U"Regular Expressions")
  679. OK
  680. DO
  681. CONVERT_EACH (Confusion)
  682. autoConfusion result = Confusion_condense (me, search_string, replace_string, replaceLimit, matchType == 2);
  683. CONVERT_EACH_END (my name.get(), U"_cnd")
  684. }
  685. FORM (NEW_Confusion_group, U"Confusion: Group stimuli & responses", U"Confusion: Group...") {
  686. SENTENCE (labels, U"Stimuli & Responses", U"u i")
  687. SENTENCE (newLabel, U"New label", U"high")
  688. INTEGER (newPosition, U"New label position", U"0 (= at start)")
  689. OK
  690. DO
  691. CONVERT_EACH (Confusion)
  692. autoConfusion result = Confusion_group (me, labels, newLabel, newPosition);
  693. CONVERT_EACH_END (my name.get(), U"_sr", newLabel)
  694. }
  695. FORM (NEW_Confusion_groupStimuli, U"Confusion: Group stimuli", U"Confusion: Group stimuli...") {
  696. SENTENCE (stimuli_string, U"Stimuli", U"u i")
  697. SENTENCE (newLabel, U"New label", U"high")
  698. INTEGER (newPosition, U"New label position", U"0")
  699. OK
  700. DO
  701. CONVERT_EACH (Confusion)
  702. autoConfusion result = Confusion_groupStimuli (me,stimuli_string, newLabel, newPosition);
  703. CONVERT_EACH_END (my name.get(), U"_s", newLabel);
  704. }
  705. FORM (NEW_Confusion_groupResponses, U"Confusion: Group responses", U"Confusion: Group responses...") {
  706. SENTENCE (responses_string, U"Responses", U"a i")
  707. SENTENCE (newLabel, U"New label", U"front")
  708. INTEGER (newPosition, U"New label position", U"0")
  709. OK
  710. DO
  711. CONVERT_EACH (Confusion)
  712. autoConfusion result = Confusion_groupResponses (me, responses_string, newLabel, newPosition);
  713. CONVERT_EACH_END (my name.get(), U"_s", newLabel);
  714. }
  715. FORM (GRAPHICS_Confusion_drawAsNumbers, U"Confusion: Draw as numbers", nullptr) {
  716. BOOLEAN (drawMarginals, U"Draw marginals", true)
  717. RADIO (format, U"Format", 3)
  718. RADIOBUTTON (U"decimal")
  719. RADIOBUTTON (U"exponential")
  720. RADIOBUTTON (U"free")
  721. RADIOBUTTON (U"rational")
  722. NATURAL (precision, U"Precision", U"5")
  723. OK
  724. DO
  725. GRAPHICS_EACH (Confusion)
  726. Confusion_drawAsNumbers (me, GRAPHICS, drawMarginals, format, precision);
  727. GRAPHICS_EACH_END
  728. }
  729. DIRECT (REAL_Confusion_getFractionCorrect) {
  730. NUMBER_ONE (Confusion)
  731. double result;
  732. Confusion_getFractionCorrect (me, & result, nullptr);
  733. NUMBER_ONE_END (U" (fraction correct)")
  734. }
  735. DIRECT (MODIFY_Confusion_ClassificationTable_increaseConfusionCount) {
  736. MODIFY_FIRST_OF_TWO (Confusion, ClassificationTable)
  737. Confusion_ClassificationTable_increase (me, you);
  738. MODIFY_FIRST_OF_TWO_END
  739. }
  740. /******************* Confusion & Matrix *************************************/
  741. FORM (GRAPHICS_Confusion_Matrix_draw, U"Confusion & Matrix: Draw confusions with arrows", nullptr) {
  742. INTEGER (categoryPosition, U"Category position", U"0 (= all)")
  743. REAL (lowerLevel, U"Lower level (%)", U"0")
  744. REAL (xmin, U"left Horizontal range", U"0.0")
  745. REAL (xmax, U"right Horizontal range", U"0.0")
  746. REAL (ymin, U"left Vertical range", U"0.0")
  747. REAL (ymax, U"right Vertical range", U"0.0")
  748. BOOLEAN (garnish, U"Garnish", true)
  749. OK
  750. DO
  751. Melder_require (categoryPosition >= 0, U"Your category position should be at least 0.");
  752. GRAPHICS_TWO (Confusion, Matrix)
  753. Confusion_Matrix_draw (me, you, GRAPHICS, categoryPosition, lowerLevel, xmin, xmax, ymin, ymax, garnish);
  754. GRAPHICS_TWO_END
  755. }
  756. /********************** ComplexSpectrogram *******************************************/
  757. DIRECT (HELP_ComplexSpectrogram_help) {
  758. HELP (U"ComplexSpectrogram_help")
  759. }
  760. FORM (NEW_ComplexSpectrogram_to_Sound, U"ComplexSpectrogram: To Sound", nullptr) {
  761. POSITIVE (durationFactor, U"Duration factor", U"1.0")
  762. OK
  763. DO
  764. CONVERT_EACH (ComplexSpectrogram)
  765. autoSound result = ComplexSpectrogram_to_Sound (me, durationFactor);
  766. CONVERT_EACH_END (my name.get())
  767. }
  768. DIRECT (NEW_ComplexSpectrogram_downto_Spectrogram) {
  769. CONVERT_EACH (ComplexSpectrogram)
  770. autoSpectrogram result = ComplexSpectrogram_to_Spectrogram (me);
  771. CONVERT_EACH_END (my name.get())
  772. }
  773. FORM (NEW_ComplexSpectrogram_to_Spectrum_slice, U"ComplexSpectrogram: To Spectrum (slice)", nullptr) {
  774. REAL (time, U"Time (s)", U"0.0")
  775. OK
  776. DO
  777. CONVERT_EACH (ComplexSpectrogram)
  778. autoSpectrum result = ComplexSpectrogram_to_Spectrum (me, time);
  779. CONVERT_EACH_END (my name.get())
  780. }
  781. /********************** Correlation *******************************************/
  782. FORM (NEW1_Correlation_createSimple, U"Create simple Correlation", U"Create simple Correlation...") {
  783. WORD (name, U"Name", U"correlation")
  784. SENTENCE (correlations_string, U"Correlations", U"1.0 0.5 1.0")
  785. SENTENCE (centroid_string, U"Centroid", U"0.0 0.0")
  786. NATURAL (numberOfObservations, U"Number of observations", U"100")
  787. OK
  788. DO
  789. CREATE_ONE
  790. autoCorrelation result = Correlation_createSimple (correlations_string, centroid_string, numberOfObservations);
  791. CREATE_ONE_END (name)
  792. }
  793. DIRECT (HELP_Correlation_help) {
  794. HELP (U"Correlation")
  795. }
  796. FORM (NEW_Correlation_confidenceIntervals, U"Correlation: Confidence intervals...", U"Correlation: Confidence intervals...") {
  797. POSITIVE (confidenceLevel, U"Confidence level (0-1)", U"0.95")
  798. INTEGER (numberOfTests, U"Number of tests (Bonferroni correction)", U"0")
  799. RADIO (approximation, U"Approximation", 1)
  800. RADIOBUTTON (U"Ruben")
  801. RADIOBUTTON (U"Fisher")
  802. OK
  803. DO
  804. CONVERT_EACH (Correlation)
  805. autoTableOfReal result = Correlation_confidenceIntervals (me, confidenceLevel, numberOfTests, approximation);
  806. CONVERT_EACH_END (my name.get(), U"_conf_intervals")
  807. }
  808. FORM (REAL_Correlation_getDiagonality_bartlett, U"Correlation: Get diagonality (bartlett)", U"SSCP: Get diagonality (bartlett)...") {
  809. NATURAL (numberOfConstraints, U"Number of constraints", U"1")
  810. OK
  811. DO
  812. NUMBER_ONE (Correlation)
  813. double chisq, result, df;
  814. Correlation_testDiagonality_bartlett (me, numberOfConstraints, & chisq, & result, & df);
  815. NUMBER_ONE_END (U" (= probability, based on chisq = ", chisq, U" and ndf = ", df, U")")
  816. }
  817. DIRECT (NEW_Correlation_to_PCA) {
  818. CONVERT_EACH (Correlation)
  819. autoPCA result = SSCP_to_PCA (me);
  820. CONVERT_EACH_END (my name.get())
  821. }
  822. /********************** Covariance *******************************************/
  823. DIRECT (HELP_Covariance_help) {
  824. HELP (U"Covariance")
  825. }
  826. FORM (NEW1_Covariance_createSimple, U"Create simple Covariance", U"Create simple Covariance...") {
  827. WORD (name, U"Name", U"c")
  828. SENTENCE (covariances_string, U"Covariances", U"1.0 0.0 1.0")
  829. SENTENCE (centroid_string, U"Centroid", U"0.0 0.0")
  830. NATURAL (numberOfObservations, U"Number of observations", U"100")
  831. OK
  832. DO
  833. CREATE_ONE
  834. autoCovariance result = Covariance_createSimple (covariances_string, centroid_string, numberOfObservations);
  835. CREATE_ONE_END (name)
  836. }
  837. FORM (REAL_Covariance_getProbabilityAtPosition, U"Covariance: Get probability at position", nullptr) {
  838. SENTENCE (position_string, U"Position", U"10.0 20.0")
  839. OK
  840. DO
  841. NUMBER_ONE (Covariance)
  842. double result = Covariance_getProbabilityAtPosition_string (me, position_string);
  843. NUMBER_ONE_END (U" (= probability at position ", position_string, U")")
  844. }
  845. FORM (REAL_Covariance_getSignificanceOfOneMean, U"Covariance: Get significance of one mean", U"Covariance: Get significance of one mean...") {
  846. LABEL (U"Get probability that the estimated mean for")
  847. NATURAL (index, U"Index", U"1")
  848. LABEL (U"(or an estimated mean even further away)")
  849. LABEL (U"could arise if the true mean were")
  850. REAL (value, U"Value", U"0.0")
  851. OK
  852. DO
  853. NUMBER_ONE (Covariance)
  854. double result, t, ndf;
  855. Covariance_getSignificanceOfOneMean (me, index, value, & result, & t, & ndf);
  856. NUMBER_ONE_END (U" (= probability, based on t = ", t, U" and ndf = ", ndf)
  857. }
  858. FORM (REAL_Covariance_getSignificanceOfMeansDifference, U"Covariance: Get significance of means difference", U"Covariance: Get significance of means difference...") {
  859. LABEL (U"Get probability that the estimated difference between the means for")
  860. NATURAL (index1, U"Index1", U"1")
  861. NATURAL (index2, U"Index2", U"2")
  862. LABEL (U"could arise if the true mean were")
  863. REAL (value, U"Value", U"0.0")
  864. LABEL (U"Assume the means are ")
  865. BOOLEAN (paired, U"Paired", true)
  866. LABEL (U"and have")
  867. BOOLEAN (equalVariances, U"Equal variances", true)
  868. OK
  869. DO
  870. NUMBER_ONE (Covariance)
  871. double result, t, ndf;
  872. Covariance_getSignificanceOfMeansDifference (me, index1, index2, value, paired, equalVariances, & result, & t, & ndf);
  873. NUMBER_ONE_END (U" (= probability, based on t = ", t, U"and ndf = ", ndf, U")")
  874. }
  875. FORM (REAL_Covariance_getSignificanceOfOneVariance, U"Covariance: Get significance of one variance", U"Covariance: Get significance of one variance...") {
  876. LABEL (U"Get the probability that the estimated variance for")
  877. NATURAL (index, U"Index", U"1")
  878. LABEL (U"(or an even larger estimated variance)")
  879. LABEL (U"could arise if the true variance were")
  880. REAL (value, U"Value", U"0.0")
  881. OK
  882. DO
  883. NUMBER_ONE (Covariance)
  884. double result, chisq, ndf;
  885. Covariance_getSignificanceOfOneVariance (me, index, value, & result, & chisq, & ndf);
  886. NUMBER_ONE_END (U" (= probability, based on chisq = ", chisq, U" and ndf = ", ndf, U")")
  887. }
  888. FORM (REAL_Covariance_getSignificanceOfVariancesRatio, U"Covariance: Get significance of variances ratio", nullptr) {
  889. LABEL (U"Get the probability that the estimated variance ratio observed for")
  890. NATURAL (index1, U"Index1", U"1")
  891. NATURAL (index2, U"Index2", U"2")
  892. LABEL (U"(or an estimated ratio even further away)")
  893. LABEL (U"could arise if the true ratio were")
  894. REAL (value, U"Value", U"1.0")
  895. OK
  896. DO
  897. NUMBER_ONE (Covariance)
  898. double result, f, df;
  899. Covariance_getSignificanceOfVariancesRatio (me, index1, index2, value, & result, & f , & df);
  900. NUMBER_ONE_END (U" (= probability, based on F = ", f, U" and ndf1 = ", df, U" and ndf2 = ", df, U")")
  901. }
  902. FORM (REAL_Covariance_getFractionVariance, U"Covariance: Get fraction variance", U"Covariance: Get fraction variance...") {
  903. NATURAL (fromDimension, U"From dimension", U"1")
  904. NATURAL (toDimension, U"To dimension", U"1")
  905. OK
  906. DO
  907. NUMBER_ONE (Covariance)
  908. double result = SSCP_getFractionVariation (me, fromDimension, toDimension);
  909. NUMBER_ONE_END (U"")
  910. }
  911. FORM (INFO_Covariances_reportMultivariateMeanDifference, U"Covariances: Report multivariate mean difference", U"Covariances: Report multivariate mean difference...") {
  912. LABEL (U"Get probability that the estimated multivariate means difference could arise ")
  913. LABEL (U"if the actual means were equal.")
  914. LABEL (U"")
  915. LABEL (U"Assume for both means we have")
  916. BOOLEAN (covariancesAreEqual, U"Equal covariances", true)
  917. OK
  918. DO
  919. INFO_COUPLE (Covariance)
  920. double prob, fisher, df1, df2, difference;
  921. MelderInfo_open ();
  922. difference = Covariances_getMultivariateCentroidDifference (me, you, covariancesAreEqual, & prob, & fisher, & df1, & df2);
  923. MelderInfo_writeLine (U"Under the assumption that the two covariances are", (covariancesAreEqual ? U" " : U" not "), U"equal:");
  924. MelderInfo_writeLine (U"Difference between multivariate means = ", difference);
  925. MelderInfo_writeLine (U"Fisher's F = ", fisher);
  926. MelderInfo_writeLine (U"Significance from zero = ", prob);
  927. MelderInfo_writeLine (U"Degrees of freedom = ", df1, U", ", df2);
  928. MelderInfo_writeLine (U"(Number of observations = ", me -> numberOfObservations, U", ", you -> numberOfObservations);
  929. MelderInfo_writeLine (U"Dimension of covariance matrices = ", me -> numberOfRows, U")");
  930. MelderInfo_close ();
  931. INFO_COUPLE_END
  932. }
  933. FORM (NEW_Covariance_to_TableOfReal_randomSampling, U"Covariance: To TableOfReal (random sampling)", U"Covariance: To TableOfReal (random sampling)...") {
  934. INTEGER (numberOfDataPoints, U"Number of data points", U"0")
  935. OK
  936. DO
  937. CONVERT_EACH (Covariance)
  938. autoTableOfReal result = Covariance_to_TableOfReal_randomSampling (me, numberOfDataPoints);
  939. CONVERT_EACH_END (my name.get())
  940. }
  941. DIRECT (INFO_Covariances_reportEquality) {
  942. autoCovarianceList covariances = CovarianceList_create ();
  943. LOOP {
  944. iam (Covariance);
  945. covariances -> addItem_ref (me);
  946. }
  947. MelderInfo_open ();
  948. double p, chisq, df;
  949. Covariances_equality (covariances.get(), 1, & p, & chisq, & df);
  950. MelderInfo_writeLine (U"Difference between covariance matrices:");
  951. MelderInfo_writeLine (U"Significance of difference (bartlett) = ", p);
  952. MelderInfo_writeLine (U"Chi-squared (bartlett) = ", chisq);
  953. MelderInfo_writeLine (U"Degrees of freedom (bartlett) = ", df);
  954. Covariances_equality (covariances.get(), 2, &p, &chisq, &df);
  955. MelderInfo_writeLine (U"Significance of difference (wald) = ", p);
  956. MelderInfo_writeLine (U"Chi-squared (wald) = ", chisq);
  957. MelderInfo_writeLine (U"Degrees of freedom (wald) = ", df);
  958. MelderInfo_close ();
  959. END }
  960. DIRECT (NEW_Covariance_to_Correlation) {
  961. CONVERT_EACH (Covariance)
  962. autoCorrelation result = SSCP_to_Correlation (me);
  963. CONVERT_EACH_END (my name.get())
  964. }
  965. DIRECT (NEW_Covariance_to_PCA) {
  966. CONVERT_EACH (Covariance)
  967. autoPCA result = SSCP_to_PCA (me);
  968. CONVERT_EACH_END (my name.get())
  969. }
  970. DIRECT (NEW1_Covariances_pool) {
  971. CONVERT_TYPED_LIST (Covariance, CovarianceList)
  972. autoCovariance result = CovarianceList_to_Covariance_pool (list.get());
  973. CONVERT_TYPED_LIST_END (U"pool")
  974. }
  975. FORM (NEW1_Covariance_TableOfReal_mahalanobis, U"Covariance & TableOfReal: To TableOfReal (mahalanobis)", U"Covariance & TableOfReal: To TableOfReal (mahalanobis)...") {
  976. BOOLEAN (centroidFromTable, U"Centroid from table", false)
  977. OK
  978. DO
  979. CONVERT_TWO (Covariance, TableOfReal)
  980. autoTableOfReal result = Covariance_TableOfReal_mahalanobis (me, you, centroidFromTable);
  981. CONVERT_TWO_END (U"mahalanobis")
  982. }
  983. /********************** Discriminant **********************************/
  984. DIRECT (HELP_Discriminant_help) {
  985. HELP (U"Discriminant")
  986. }
  987. DIRECT (MODIFY_Discriminant_setGroupLabels) {
  988. MODIFY_FIRST_OF_TWO (Discriminant, Strings)
  989. Discriminant_setGroupLabels (me, you);
  990. MODIFY_FIRST_OF_TWO_END
  991. }
  992. FORM (NEW1_Discriminant_PatternList_to_Categories, U"Discriminant & PatternList: To Categories", U"Discriminant & PatternList: To Categories...") {
  993. BOOLEAN (poolCovariances, U"Pool covariance matrices", true)
  994. BOOLEAN (useAPrioriProbabilities, U"Use apriori probabilities", true)
  995. OK
  996. DO
  997. CONVERT_TWO (Discriminant, PatternList)
  998. autoCategories result = Discriminant_PatternList_to_Categories (me, you, poolCovariances, useAPrioriProbabilities);
  999. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  1000. }
  1001. FORM (NEW1_Discriminant_TableOfReal_to_Configuration, U"Discriminant & TableOfReal: To Configuration", U"Discriminant & TableOfReal: To Configuration...") {
  1002. INTEGER (numberOfDimensions, U"Number of dimensions", U"0")
  1003. OK
  1004. DO
  1005. Melder_require (numberOfDimensions >= 0, U"The number of dimensions should be at least zero.");
  1006. CONVERT_TWO (Discriminant, TableOfReal)
  1007. autoConfiguration result = Discriminant_TableOfReal_to_Configuration (me, you, numberOfDimensions);
  1008. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  1009. }
  1010. DIRECT (hint_Discriminant_TableOfReal_to_ClassificationTable) {
  1011. Melder_information (U"You can use the Discriminant as a classifier by \nselecting a Discriminant and a TableOfReal object together.");
  1012. END }
  1013. FORM (NEW1_Discriminant_TableOfReal_to_ClassificationTable, U"Discriminant & TableOfReal: To ClassificationTable", U"Discriminant & TableOfReal: To ClassificationTable...") {
  1014. BOOLEAN (poolCovariances, U"Pool covariance matrices", true)
  1015. BOOLEAN (useAPrioriProbabilities, U"Use apriori probabilities", true)
  1016. OK
  1017. DO
  1018. CONVERT_TWO (Discriminant, TableOfReal)
  1019. autoClassificationTable result = Discriminant_TableOfReal_to_ClassificationTable (me, you, poolCovariances, useAPrioriProbabilities);
  1020. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  1021. }
  1022. FORM (NEW1_Discriminant_TableOfReal_mahalanobis, U"Discriminant & TableOfReal: To TableOfReal (mahalanobis)", U"Discriminant & TableOfReal: To TableOfReal (mahalanobis)...") {
  1023. SENTENCE (groupLabel, U"Group label", U"")
  1024. BOOLEAN (poolCovariances, U"Pool covariance matrices", false)
  1025. OK
  1026. DO
  1027. CONVERT_TWO (Discriminant, TableOfReal)
  1028. integer group = Discriminant_groupLabelToIndex (me, groupLabel);
  1029. Melder_require (group > 0, U"Your group label \"", groupLabel, U"\" does not exist.");
  1030. autoTableOfReal result = Discriminant_TableOfReal_mahalanobis (me, you, group, poolCovariances);
  1031. CONVERT_TWO_END (U"mahalanobis")
  1032. }
  1033. DIRECT (INTEGER_Discriminant_getNumberOfEigenvalues) {
  1034. INTEGER_ONE (Discriminant)
  1035. integer result = my eigen -> numberOfEigenvalues;
  1036. INTEGER_ONE_END (U" (number of eigenvalues)")
  1037. }
  1038. DIRECT (INTEGER_Discriminant_getNumberOfEigenvectors) {
  1039. INTEGER_ONE (Discriminant)
  1040. integer result = my eigen -> numberOfEigenvalues;
  1041. INTEGER_ONE_END (U" (number of eigenvectors)")
  1042. }
  1043. DIRECT (INTEGER_Discriminant_getEigenvectorDimension) {
  1044. INTEGER_ONE (Discriminant)
  1045. integer result = my eigen -> dimension;
  1046. INTEGER_ONE_END (U" (dimension)")
  1047. }
  1048. FORM (REAL_Discriminant_getEigenvalue, U"Discriminant: Get eigenvalue", U"Eigen: Get eigenvalue...") {
  1049. NATURAL (eigenvalueNumber, U"Eigenvalue number", U"1")
  1050. OK
  1051. DO
  1052. NUMBER_ONE (Discriminant)
  1053. Melder_require (eigenvalueNumber <= my eigen -> numberOfEigenvalues,
  1054. U"Eigenvalue number should be smaller than ", my eigen -> numberOfEigenvalues + 1);
  1055. double result = my eigen -> eigenvalues[eigenvalueNumber];
  1056. NUMBER_ONE_END (U" (eigenvalue [)", eigenvalueNumber, U"])")
  1057. }
  1058. FORM (REAL_Discriminant_getSumOfEigenvalues, U"Discriminant:Get sum of eigenvalues", U"Eigen: Get sum of eigenvalues...") {
  1059. INTEGER (fromEigenvalue, U"left Eigenvalue range", U"0")
  1060. INTEGER (toEigenvalue, U"right Eigenvalue range", U"0")
  1061. OK
  1062. DO
  1063. NUMBER_ONE (Discriminant)
  1064. double result = Eigen_getSumOfEigenvalues (my eigen.get(), fromEigenvalue, toEigenvalue);
  1065. NUMBER_ONE_END (U"")
  1066. }
  1067. FORM (REAL_Discriminant_getEigenvectorElement, U"Discriminant: Get eigenvector element", U"Eigen: Get eigenvector element...") {
  1068. NATURAL (eigenvectorNumber, U"Eigenvector number", U"1")
  1069. NATURAL (elementNumber, U"Element number", U"1")
  1070. OK
  1071. DO
  1072. NUMBER_ONE (Discriminant)
  1073. double result = Eigen_getEigenvectorElement (my eigen.get(), eigenvectorNumber, elementNumber);
  1074. NUMBER_ONE_END (U"")
  1075. }
  1076. FORM (REAL_Discriminant_getWilksLambda, U"Discriminant: Get Wilks' lambda", U"Discriminant: Get Wilks' lambda...") {
  1077. LABEL (U"Product (i=from..numberOfEigenvalues, 1 / (1 + eigenvalue[i]))")
  1078. NATURAL (from, U"From", U"1") //TODO better name
  1079. OK
  1080. DO
  1081. NUMBER_ONE (Discriminant)
  1082. double result = Discriminant_getWilksLambda (me, from);
  1083. NUMBER_ONE_END (U" (wilks lambda)")
  1084. }
  1085. FORM (REAL_Discriminant_getCumulativeContributionOfComponents, U"Discriminant: Get cumulative contribution of components", U"Eigen: Get cumulative contribution of components...") {
  1086. NATURAL (fromComponent, U"From component", U"1")
  1087. NATURAL (toComponent, U"To component", U"1")
  1088. OK
  1089. DO
  1090. NUMBER_ONE (Discriminant)
  1091. double result = Eigen_getCumulativeContributionOfComponents (my eigen.get(), fromComponent, toComponent);
  1092. NUMBER_ONE_END (U" (cumulative contribution)")
  1093. }
  1094. FORM (REAL_Discriminant_getPartialDiscriminationProbability, U"Discriminant: Get partial discrimination probability", U"Discriminant: Get partial discrimination probability...") {
  1095. INTEGER (numberOfDimensions, U"Number of dimensions", U"1")
  1096. OK
  1097. DO
  1098. Melder_require (numberOfDimensions >= 0, U"The number of dimensions should be at least zero.");
  1099. NUMBER_ONE (Discriminant)
  1100. double result, chisq, df;
  1101. Discriminant_getPartialDiscriminationProbability (me, numberOfDimensions, & result, & chisq, & df);
  1102. NUMBER_ONE_END (U" (= probability, based on chisq = ", chisq, U" and ndf = ", df, U")");
  1103. }
  1104. DIRECT (REAL_Discriminant_getHomegeneityOfCovariances_box) {
  1105. NUMBER_ONE (Discriminant)
  1106. double chisq, result, ndf;
  1107. SSCPList_getHomegeneityOfCovariances_box (my groups.get(), & result, & chisq, & ndf);
  1108. NUMBER_ONE_END (U" (= probability, based on chisq = ", chisq, U" and ndf = ", ndf, U")")
  1109. }
  1110. DIRECT (INFO_Discriminant_reportEqualityOfCovarianceMatrices) {
  1111. MelderInfo_open ();
  1112. LOOP {
  1113. iam (Discriminant);
  1114. structCovarianceList list;
  1115. for (integer i = 1; i <= my groups->size; i ++) {
  1116. SSCP sscp = my groups->at [i];
  1117. autoCovariance covariance = SSCP_to_Covariance (sscp, 1); // FIXME numberOfConstraints shouldn't be 1, should it?
  1118. list. addItem_move (covariance.move());
  1119. }
  1120. double chisq, prob, df;
  1121. Covariances_equality (& list, 2, & prob, & chisq, & df);
  1122. MelderInfo_writeLine (U"Wald test for equality of covariance matrices:");
  1123. MelderInfo_writeLine (U"Chi squared: ", chisq);
  1124. MelderInfo_writeLine (U"Significance: ", prob);
  1125. MelderInfo_writeLine (U"Degrees of freedom: ", df);
  1126. MelderInfo_writeLine (U"Number of matrices: ", list.size);
  1127. }
  1128. MelderInfo_close ();
  1129. END }
  1130. FORM (REAL_Discriminant_getSigmaEllipseArea, U"Discriminant: Get concentration ellipse area", U"Discriminant: Get concentration ellipse area...") {
  1131. SENTENCE (groupLabel, U"Group label", U"")
  1132. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  1133. BOOLEAN (discriminatPlane, U"Discriminant plane", true)
  1134. INTEGER (xDimension, U"X-dimension", U"1")
  1135. INTEGER (yDimension, U"Y-dimension", U"2")
  1136. OK
  1137. DO
  1138. NUMBER_ONE (Discriminant)
  1139. integer group = Discriminant_groupLabelToIndex (me, groupLabel);
  1140. Melder_require (group > 0, U"The group label \"", groupLabel, U"\" does not exist.");
  1141. double result = Discriminant_getConcentrationEllipseArea (me, group, numberOfSigmas, false, discriminatPlane, xDimension, yDimension);
  1142. NUMBER_ONE_END (U" (concentration ellipse area)")
  1143. }
  1144. FORM (REAL_Discriminant_getConfidenceEllipseArea, U"Discriminant: Get confidence ellipse area", U"Discriminant: Get confidence ellipse area...") {
  1145. SENTENCE (groupLabel, U"Group label", U"")
  1146. POSITIVE (confidenceLevel, U"Confidence level (0-1)", U"0.95")
  1147. BOOLEAN (discriminatPlane, U"Discriminant plane", true)
  1148. INTEGER (xDimension, U"X-dimension", U"1")
  1149. INTEGER (yDimension, U"Y-dimension", U"2")
  1150. OK
  1151. DO
  1152. NUMBER_ONE (Discriminant)
  1153. integer group = Discriminant_groupLabelToIndex (me, groupLabel);
  1154. Melder_require (group > 0, U"The group label \"", groupLabel, U"\" does not exist.");
  1155. double result = Discriminant_getConcentrationEllipseArea (me, group, confidenceLevel, true, discriminatPlane, xDimension, yDimension);
  1156. NUMBER_ONE_END (U" (confidence ellipse area)")
  1157. }
  1158. FORM (REAL_Discriminant_getLnDeterminant_group, U"Discriminant: Get determinant (group)", U"Discriminant: Get determinant (group)...")
  1159. SENTENCE (groupLabel, U"Group label", U"") {
  1160. OK
  1161. DO
  1162. NUMBER_ONE (Discriminant)
  1163. integer group = Discriminant_groupLabelToIndex (me, groupLabel);
  1164. Melder_require (group > 0, U"The group label \"", groupLabel, U"\" does not exist.");
  1165. double result = Discriminant_getLnDeterminant_group (me, group);
  1166. NUMBER_ONE_END (U" (ln(determinant) group")
  1167. }
  1168. DIRECT (REAL_Discriminant_getLnDeterminant_total) {
  1169. NUMBER_ONE (Discriminant)
  1170. double result = Discriminant_getLnDeterminant_total (me);
  1171. NUMBER_ONE_END (U" (ln(determinant) total")
  1172. }
  1173. FORM (MODIFY_Discriminant_invertEigenvector, U"Discriminant: Invert eigenvector", nullptr) {
  1174. NATURAL (eigenvectorNumber, U"Eigenvector number", U"1")
  1175. OK
  1176. DO
  1177. MODIFY_EACH (Discriminant)
  1178. Eigen_invertEigenvector (my eigen.get(), eigenvectorNumber);
  1179. MODIFY_EACH_END
  1180. }
  1181. FORM (GRAPHICS_Discriminant_drawEigenvalues, U"Discriminant: Draw eigenvalues", U"Eigen: Draw eigenvalues...") {
  1182. INTEGER (fromEigenvalue, U"left Eigenvalue range", U"0")
  1183. INTEGER (toEigenvalue, U"right Eigenvalue range", U"0")
  1184. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  1185. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  1186. BOOLEAN (showFractions, U"Fraction of eigenvalues summed", false)
  1187. BOOLEAN (showCumulativeValues, U"Cumulative", false)
  1188. POSITIVE (markSize_mm, U"Mark size (mm)", U"1.0")
  1189. SENTENCE (mark_string, U"Mark string (+xo.)", U"+")
  1190. BOOLEAN (garnish, U"Garnish", true)
  1191. OK
  1192. DO
  1193. GRAPHICS_EACH (Discriminant)
  1194. Eigen_drawEigenvalues (my eigen.get(), GRAPHICS, fromEigenvalue, toEigenvalue, fromAmplitude, toAmplitude, showFractions, showCumulativeValues, markSize_mm, mark_string, garnish);
  1195. GRAPHICS_EACH_END
  1196. }
  1197. FORM (GRAPHICS_Discriminant_drawEigenvector, U"Discriminant: Draw eigenvector", U"Eigen: Draw eigenvector...") {
  1198. INTEGER (eigenvectorNumber, U"Eigenvector number", U"1")
  1199. BOOLEAN (componentLoadings, U"Component loadings", false)
  1200. INTEGER (fromElement, U"left Element range", U"0")
  1201. INTEGER (toElement, U"right Element range", U"0")
  1202. REAL (fromAmplitude, U"left Amplitude range", U"-1.0")
  1203. REAL (toAmplitude, U"right Amplitude range", U"1.0")
  1204. POSITIVE (markSize_mm, U"Mark size (mm)", U"1.0")
  1205. SENTENCE (mark_string, U"Mark string (+xo.)", U"+")
  1206. BOOLEAN (connectPoints, U"Connect points", true)
  1207. BOOLEAN (garnish, U"Garnish", true)
  1208. OK
  1209. DO
  1210. GRAPHICS_EACH (Discriminant)
  1211. Eigen_drawEigenvector (my eigen.get(), GRAPHICS, eigenvectorNumber, fromElement, toElement, fromAmplitude, toAmplitude, componentLoadings, markSize_mm, mark_string, connectPoints, nullptr, garnish);
  1212. GRAPHICS_EACH_END
  1213. }
  1214. FORM (GRAPHICS_Discriminant_drawSigmaEllipses, U"Discriminant: Draw sigma ellipses", U"Discriminant: Draw sigma ellipses...") {
  1215. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  1216. BOOLEAN (discriminantPlane, U"Discriminant plane", true)
  1217. INTEGER (xDimension, U"X-dimension", U"1")
  1218. INTEGER (yDimension, U"Y-dimension", U"2")
  1219. REAL (xmin, U"left Horizontal range", U"0.0")
  1220. REAL (xmax, U"right Horizontal range", U"0.0")
  1221. REAL (ymin, U"left Vertical range", U"0.0")
  1222. REAL (ymax, U"right Vertical range", U"0.0")
  1223. INTEGER (labelSize, U"Label size", U"12")
  1224. BOOLEAN (garnish, U"Garnish", true)
  1225. OK
  1226. DO
  1227. GRAPHICS_EACH (Discriminant)
  1228. Discriminant_drawConcentrationEllipses (me, GRAPHICS, numberOfSigmas, false, nullptr, discriminantPlane, xDimension, yDimension,xmin, xmax, ymin, ymax, labelSize, garnish);
  1229. GRAPHICS_EACH_END
  1230. }
  1231. FORM (GRAPHICS_Discriminant_drawOneSigmaEllipse, U"Discriminant: Draw one sigma ellipse", U"Discriminant: Draw one sigma ellipse...") {
  1232. SENTENCE (label, U"Label", U"")
  1233. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  1234. BOOLEAN (discriminatPlane, U"Discriminant plane", true)
  1235. INTEGER (xDimension, U"X-dimension", U"1")
  1236. INTEGER (yDimension, U"Y-dimension", U"2")
  1237. REAL (xmin, U"left Horizontal range", U"0.0")
  1238. REAL (xmax, U"right Horizontal range", U"0.0")
  1239. REAL (ymin, U"left Vertical range", U"0.0")
  1240. REAL (ymax, U"right Vertical range", U"0.0")
  1241. INTEGER (labelSize, U"Label size", U"12")
  1242. BOOLEAN (garnish, U"Garnish", true)
  1243. OK
  1244. DO
  1245. GRAPHICS_EACH (Discriminant)
  1246. Discriminant_drawConcentrationEllipses (me, GRAPHICS, numberOfSigmas, false, label, discriminatPlane, xDimension, yDimension, xmin, xmax, ymin, ymax, labelSize, garnish);
  1247. GRAPHICS_EACH_END
  1248. }
  1249. FORM (GRAPHICS_Discriminant_drawConfidenceEllipses, U"Discriminant: Draw confidence ellipses", nullptr) {
  1250. POSITIVE (confidenceLevel, U"Confidence level (0-1)", U"0.95")
  1251. BOOLEAN (discriminatPlane, U"Discriminant plane", true)
  1252. INTEGER (xDimension, U"X-dimension", U"1")
  1253. INTEGER (yDimension, U"Y-dimension", U"2")
  1254. REAL (xmin, U"left Horizontal range", U"0.0")
  1255. REAL (xmax, U"right Horizontal range", U"0.0")
  1256. REAL (ymin, U"left Vertical range", U"0.0")
  1257. REAL (ymax, U"right Vertical range", U"0.0")
  1258. INTEGER (labelSize, U"Label size", U"12")
  1259. BOOLEAN (garnish, U"Garnish", true)
  1260. OK
  1261. DO
  1262. GRAPHICS_EACH (Discriminant)
  1263. Discriminant_drawConcentrationEllipses (me, GRAPHICS, confidenceLevel, true, nullptr, discriminatPlane, xDimension, yDimension, xmin, xmax, ymin, ymax, labelSize, garnish);
  1264. GRAPHICS_EACH_END
  1265. }
  1266. FORM (GRAPHICS_Discriminant_drawOneConfidenceEllipse, U"Discriminant: Draw one confidence ellipse", nullptr) {
  1267. SENTENCE (label, U"Label", U"")
  1268. POSITIVE (confidenceLevel, U"Confidence level (0-1)", U"0.95")
  1269. BOOLEAN (discriminatPlane, U"Discriminant plane", true)
  1270. INTEGER (xDimension, U"X-dimension", U"1")
  1271. INTEGER (yDimension, U"Y-dimension", U"2")
  1272. REAL (xmin, U"left Horizontal range", U"0.0")
  1273. REAL (xmax, U"right Horizontal range", U"0.0")
  1274. REAL (ymin, U"left Vertical range", U"0.0")
  1275. REAL (ymax, U"right Vertical range", U"0.0")
  1276. INTEGER (labelSize, U"Label size", U"12")
  1277. BOOLEAN (garnish, U"Garnish", true)
  1278. OK
  1279. DO
  1280. GRAPHICS_EACH (Discriminant)
  1281. Discriminant_drawConcentrationEllipses (me, GRAPHICS, confidenceLevel, true, label, discriminatPlane, xDimension, yDimension, xmin, xmax, ymin, ymax, labelSize, garnish);
  1282. GRAPHICS_EACH_END
  1283. }
  1284. DIRECT (NEW_Discriminant_extractBetweenGroupsSSCP) {
  1285. CONVERT_EACH (Discriminant)
  1286. autoSSCP result = Discriminant_extractBetweenGroupsSSCP (me);
  1287. CONVERT_EACH_END (my name.get(), U"_between")
  1288. }
  1289. DIRECT (NEW_Discriminant_extractGroupCentroids) {
  1290. CONVERT_EACH (Discriminant)
  1291. autoTableOfReal result = Discriminant_extractGroupCentroids (me);
  1292. CONVERT_EACH_END (my name.get(), U"_centroids")
  1293. }
  1294. DIRECT (NEW_Discriminant_extractGroupStandardDeviations) {
  1295. CONVERT_EACH (Discriminant)
  1296. autoTableOfReal result = Discriminant_extractGroupStandardDeviations (me);
  1297. CONVERT_EACH_END (U"group_stddevs")
  1298. }
  1299. DIRECT (NEW_Discriminant_extractGroupLabels) {
  1300. CONVERT_EACH (Discriminant)
  1301. autoStrings result = Discriminant_extractGroupLabels (me);
  1302. CONVERT_EACH_END (U"group_labels")
  1303. }
  1304. DIRECT (NEW_Discriminant_extractEigen) {
  1305. CONVERT_EACH (Discriminant)
  1306. autoEigen result = Data_copy (my eigen.get());
  1307. CONVERT_EACH_END (my name.get())
  1308. }
  1309. DIRECT (NEW_Discriminant_extractPooledWithinGroupsSSCP) {
  1310. CONVERT_EACH (Discriminant)
  1311. autoSSCP result = Discriminant_extractPooledWithinGroupsSSCP (me);
  1312. CONVERT_EACH_END (U"pooled_within")
  1313. }
  1314. FORM (NEW_Discriminant_extractWithinGroupSSCP, U"Discriminant: Extract within-group SSCP", U"Discriminant: Extract within-group SSCP...") {
  1315. NATURAL (groupIndex, U"Group index", U"1")
  1316. OK
  1317. DO
  1318. CONVERT_EACH (Discriminant)
  1319. autoSSCP result = Discriminant_extractWithinGroupSSCP (me, groupIndex);
  1320. CONVERT_EACH_END (my name.get(), U"_g", groupIndex)
  1321. }
  1322. DIRECT (INTEGER_Discriminant_getNumberOfFunctions) {
  1323. INTEGER_ONE (Discriminant)
  1324. integer result = Discriminant_getNumberOfFunctions (me);
  1325. INTEGER_ONE_END (U"")
  1326. }
  1327. DIRECT (INTEGER_Discriminant_getDimensionOfFunctions) {
  1328. INTEGER_ONE (Discriminant)
  1329. integer result = Eigen_getDimensionOfComponents (my eigen.get());
  1330. INTEGER_ONE_END (U"")
  1331. }
  1332. DIRECT (INTEGER_Discriminant_getNumberOfGroups) {
  1333. INTEGER_ONE (Discriminant)
  1334. integer result = Discriminant_getNumberOfGroups (me);
  1335. INTEGER_ONE_END (U"")
  1336. }
  1337. FORM (INTEGER_Discriminant_getNumberOfObservations, U"Discriminant: Get number of observations", U"Discriminant: Get number of observations...") {
  1338. INTEGER (group, U"Group", U"0 (= total)")
  1339. OK
  1340. DO
  1341. INTEGER_ONE (Discriminant)
  1342. integer result = Discriminant_getNumberOfObservations (me, group);
  1343. INTEGER_ONE_END (U"")
  1344. }
  1345. /********************** DTW *******************************************/
  1346. FORM (MODIFY_DTW_Polygon_findPathInside, U"DTW & Polygon: Find path inside", nullptr) {
  1347. RADIO (slopeConstraint, U"Slope constraint", 1)
  1348. RADIOBUTTON (U"no restriction")
  1349. RADIOBUTTON (U"1/3 < slope < 3")
  1350. RADIOBUTTON (U"1/2 < slope < 2")
  1351. RADIOBUTTON (U"2/3 < slope < 3/2")
  1352. OK
  1353. DO
  1354. MODIFY_FIRST_OF_TWO (DTW, Polygon)
  1355. DTW_Polygon_findPathInside (me, you, slopeConstraint, 0);
  1356. MODIFY_FIRST_OF_TWO_END
  1357. }
  1358. FORM (NEW1_DTW_Polygon_to_Matrix_cumulativeDistances, U"DTW & Polygon: To Matrix (cum. distances)", nullptr) {
  1359. RADIO (slopeConstraint, U"Slope constraint", 1)
  1360. RADIOBUTTON (U"no restriction")
  1361. RADIOBUTTON (U"1/3 < slope < 3")
  1362. RADIOBUTTON (U"1/2 < slope < 2")
  1363. RADIOBUTTON (U"2/3 < slope < 3/2")
  1364. OK
  1365. DO
  1366. CONVERT_TWO (DTW, Polygon)
  1367. autoMatrix result = DTW_Polygon_to_Matrix_cumulativeDistances (me, you, slopeConstraint);
  1368. CONVERT_TWO_END (my name.get(), U"_", slopeConstraint);
  1369. }
  1370. FORM (GRAPHICS_DTW_Sounds_draw, U"DTW & Sounds: Draw", U"DTW & Sounds: Draw...") {
  1371. REAL (xmin, U"left Horizontal range", U"0.0")
  1372. REAL (xmax, U"right Horizontal range", U"0.0")
  1373. REAL (ymin, U"left Vertical range", U"0.0")
  1374. REAL (ymax, U"right Vertical range", U"0.0")
  1375. BOOLEAN (garnish, U"Garnish", true)
  1376. OK
  1377. DO
  1378. GRAPHICS_COUPLE_AND_ONE (Sound, DTW)
  1379. DTW_Sounds_draw (him, you, me, GRAPHICS, xmin, xmax, ymin, ymax, garnish);
  1380. GRAPHICS_COUPLE_AND_ONE_END
  1381. }
  1382. FORM (GRAPHICS_DTW_Sounds_drawWarp_x, U"DTW & Sounds: Draw warp (x)", U"DTW & Sounds: Draw warp (x)...") {
  1383. REAL (xmin, U"left Horizontal range", U"0.0")
  1384. REAL (xmax, U"right Horizontal range", U"0.0")
  1385. REAL (ymin, U"left Vertical range", U"0.0")
  1386. REAL (ymax, U"right Vertical range", U"0.0")
  1387. REAL (time, U"Time (s)", U"0.1")
  1388. BOOLEAN (garnish, U"Garnish", true)
  1389. OK
  1390. DO
  1391. GRAPHICS_COUPLE_AND_ONE (Sound, DTW)
  1392. DTW_Sounds_drawWarpX (him, you, me, GRAPHICS, xmin, xmax, ymin, ymax, time, garnish);
  1393. GRAPHICS_COUPLE_AND_ONE_END
  1394. }
  1395. DIRECT (HELP_DTW_help) {
  1396. HELP (U"DTW")
  1397. }
  1398. FORM (GRAPHICS_DTW_drawPath, U"DTW: Draw path", nullptr) {
  1399. REAL (xmin, U"left Horizontal range", U"0.0")
  1400. REAL (xmax, U"right Horizontal range", U"0.0")
  1401. REAL (ymin, U"left Vertical range", U"0.0")
  1402. REAL (ymax, U"right Vertical range", U"0.0")
  1403. BOOLEAN (garnish, U"Garnish", false);
  1404. OK
  1405. DO
  1406. GRAPHICS_EACH (DTW)
  1407. DTW_drawPath (me, GRAPHICS, xmin, xmax, ymin, ymax, garnish);
  1408. GRAPHICS_EACH_END
  1409. }
  1410. FORM (GRAPHICS_DTW_drawDistancesAlongPath, U"DTW: Draw distances along path", nullptr) {
  1411. REAL (xmin, U"left Horizontal range", U"0.0")
  1412. REAL (xmax, U"right Horizontal range", U"0.0")
  1413. REAL (ymin, U"left Vertical range", U"0.0")
  1414. REAL (ymax, U"right Vertical range", U"0.0")
  1415. BOOLEAN (garnish, U"Garnish", false);
  1416. OK
  1417. DO
  1418. GRAPHICS_EACH (DTW)
  1419. DTW_drawDistancesAlongPath (me, GRAPHICS, xmin, xmax, ymin, ymax, garnish);
  1420. GRAPHICS_EACH_END
  1421. }
  1422. FORM (GRAPHICS_DTW_paintDistances, U"DTW: Paint distances", nullptr) {
  1423. REAL (xmin, U"left Horizontal range", U"0.0")
  1424. REAL (xmax, U"right Horizontal range", U"0.0")
  1425. REAL (ymin, U"left Vertical range", U"0.0")
  1426. REAL (ymax, U"right Vertical range", U"0.0")
  1427. REAL (minimum, U"Minimum", U"0.0")
  1428. REAL (maximum, U"Maximum", U"0.0")
  1429. BOOLEAN (garnish, U"Garnish", false);
  1430. OK
  1431. DO
  1432. GRAPHICS_EACH (DTW)
  1433. DTW_paintDistances (me, GRAPHICS, xmin, xmax, ymin, ymax, minimum, maximum, garnish);
  1434. GRAPHICS_EACH_END
  1435. }
  1436. FORM (GRAPHICS_DTW_drawWarp_x, U"DTW: Draw warp (x)", U"DTW: Draw warp (x)...") {
  1437. REAL (xmin, U"left Horizontal range", U"0.0")
  1438. REAL (xmax, U"right Horizontal range", U"0.0")
  1439. REAL (ymin, U"left Vertical range", U"0.0")
  1440. REAL (ymax, U"right Vertical range", U"0.0")
  1441. REAL (time, U"Time (s)", U"0.1")
  1442. BOOLEAN (garnish, U"Garnish", false);
  1443. OK
  1444. DO
  1445. GRAPHICS_EACH (DTW)
  1446. DTW_drawWarpX (me, GRAPHICS, xmin, xmax, ymin, ymax, time, garnish);
  1447. GRAPHICS_EACH_END
  1448. }
  1449. FORM (GRAPHICS_DTW_drawWarp_y, U"DTW: Draw warp (y)", U"DTW: Draw warp (y)...") {
  1450. REAL (xmin, U"left Horizontal range", U"0.0")
  1451. REAL (xmax, U"right Horizontal range", U"0.0")
  1452. REAL (ymin, U"left Vertical range", U"0.0")
  1453. REAL (ymax, U"right Vertical range", U"0.0")
  1454. REAL (time, U"Time (s)", U"0.1")
  1455. BOOLEAN (garnish, U"Garnish", false);
  1456. OK
  1457. DO
  1458. GRAPHICS_EACH (DTW)
  1459. DTW_drawWarpY (me, GRAPHICS, xmin, xmax, ymin, ymax, time, garnish);
  1460. GRAPHICS_EACH_END
  1461. }
  1462. DIRECT (REAL_DTW_getStartTime_x) {
  1463. NUMBER_ONE (DTW)
  1464. double result = my xmin;
  1465. NUMBER_ONE_END (U" s (= start time along x)")
  1466. }
  1467. DIRECT (REAL_DTW_getEndTime_x) {
  1468. NUMBER_ONE (DTW)
  1469. double result = my xmax;
  1470. NUMBER_ONE_END (U" s (= end time along x)");
  1471. }
  1472. DIRECT (REAL_DTW_getTotalDuration_x) {
  1473. NUMBER_ONE (DTW)
  1474. double result = my xmax - my xmin;
  1475. NUMBER_ONE_END (U" s (= total duration along x)");
  1476. }
  1477. DIRECT (REAL_DTW_getStartTime_y) {
  1478. NUMBER_ONE (DTW)
  1479. double result = my ymin;
  1480. NUMBER_ONE_END (U" s (= start time along y)");
  1481. }
  1482. DIRECT (REAL_DTW_getEndTime_y) {
  1483. NUMBER_ONE (DTW)
  1484. double result = my ymax;
  1485. NUMBER_ONE_END (U" s (= end time along y)");
  1486. }
  1487. DIRECT (REAL_DTW_getTotalDuration_y) {
  1488. NUMBER_ONE (DTW)
  1489. double result = my ymax - my ymin;
  1490. NUMBER_ONE_END (U" s (= total duration along y)")
  1491. }
  1492. DIRECT (INTEGER_DTW_getNumberOfFrames_x) {
  1493. INTEGER_ONE (DTW)
  1494. integer result = my nx;
  1495. INTEGER_ONE_END (U" (= number of frames along x)")
  1496. }
  1497. DIRECT (REAL_DTW_getTimeStep_x) {
  1498. NUMBER_ONE (DTW)
  1499. double result = my dx;
  1500. NUMBER_ONE_END (U" s (= time step along x)")
  1501. }
  1502. FORM (REAL_DTW_getTimeFromFrameNumber_x, U"DTW: Get time from frame number (x)", nullptr) {
  1503. NATURAL (frameNumber, U"Frame number (x)", U"1")
  1504. OK
  1505. DO
  1506. NUMBER_ONE (DTW)
  1507. double result = Matrix_columnToX (me, frameNumber);
  1508. NUMBER_ONE_END (U" s (= y time at x frame ", frameNumber, U")")
  1509. }
  1510. FORM (INTEGER_DTW_getFrameNumberFromTime_x, U"DTW: Get frame number from time (x)", nullptr) {
  1511. REAL (xTime, U"Time along x (s)", U"0.1")
  1512. OK
  1513. DO
  1514. INTEGER_ONE (DTW)
  1515. Melder_require (xTime >= my xmin && xTime <= my xmax, U"Time outside x domain.");
  1516. integer result = Melder_iround (Matrix_xToColumn (me, xTime));
  1517. INTEGER_ONE_END (U" (= x frame at y time ", xTime, U")")
  1518. }
  1519. DIRECT (INTEGER_DTW_getNumberOfFrames_y) {
  1520. INTEGER_ONE (DTW)
  1521. integer result = my ny;
  1522. INTEGER_ONE_END (U" (= number of frames along y)")
  1523. }
  1524. DIRECT (REAL_DTW_getTimeStep_y) {
  1525. NUMBER_ONE (DTW)
  1526. double result = my dy;
  1527. NUMBER_ONE_END (U" s (= time step along y)")
  1528. }
  1529. FORM (REAL_DTW_getTimeFromFrameNumber_y, U"DTW: Get time from frame number (y)", nullptr) {
  1530. NATURAL (frameNumber, U"Frame number (y)", U"1")
  1531. OK
  1532. DO
  1533. NUMBER_ONE (DTW)
  1534. double result = Matrix_rowToY (me, frameNumber);
  1535. NUMBER_ONE_END (U" s (= x time at y frame ", frameNumber, U")")
  1536. }
  1537. FORM (INTEGER_DTW_getFrameNumberFromTime_y, U"DTW: Get frame number from time (y)", nullptr) {
  1538. REAL (yTime, U"Time along y (s)", U"0.1")
  1539. OK
  1540. DO
  1541. INTEGER_ONE (DTW)
  1542. Melder_require (yTime >= my ymin && yTime <= my ymax, U"Time outside y domain.");
  1543. integer result = Melder_iround (Matrix_yToRow (me, yTime));
  1544. INTEGER_ONE_END (U" (= y frame at x time ", yTime, U")")
  1545. }
  1546. FORM (REAL_DTW_getPathY, U"DTW: Get time along path", U"DTW: Get time along path...") {
  1547. REAL (xTime, U"Time (s)", U"0.0")
  1548. OK
  1549. DO
  1550. NUMBER_ONE (DTW)
  1551. double result = DTW_getYTimeFromXTime (me, xTime);
  1552. NUMBER_ONE_END (U"")
  1553. }
  1554. FORM (REAL_DTW_getYTimeFromXTime, U"DTW: Get y time from x time", U"DTW: Get y time from x time...") {
  1555. REAL (xTime, U"Time at x (s)", U"0.0")
  1556. OK
  1557. DO
  1558. NUMBER_ONE (DTW)
  1559. double result = DTW_getYTimeFromXTime (me, xTime);
  1560. NUMBER_ONE_END (U" s (= y time at x time ", xTime, U")")
  1561. }
  1562. FORM (REAL_DTW_getXTimeFromYTime, U"DTW: Get x time from y time", U"DTW: Get x time from y time...") {
  1563. REAL (yTime, U"Time at y (s)", U"0.0")
  1564. OK
  1565. DO
  1566. NUMBER_ONE (DTW)
  1567. double result = DTW_getXTimeFromYTime (me, yTime);
  1568. NUMBER_ONE_END (U" s (= x time at y time ", yTime, U")")
  1569. }
  1570. FORM (INTEGER_DTW_getMaximumConsecutiveSteps, U"DTW: Get maximum consecutive steps", U"DTW: Get maximum consecutive steps...") {
  1571. OPTIONMENU (direction, U"Direction", 1)
  1572. OPTION (U"X")
  1573. OPTION (U"Y")
  1574. OPTION (U"Diagonaal")
  1575. OK
  1576. DO
  1577. int direction_code [] = { DTW_START, DTW_X, DTW_Y, DTW_XANDY };
  1578. conststring32 direction_string [] = { U"", U"x", U"y", U"diagonal" };
  1579. INTEGER_ONE (DTW)
  1580. integer result = DTW_getMaximumConsecutiveSteps (me, direction_code [direction]);
  1581. INTEGER_ONE_END (U" (= maximum number of consecutive steps in ", direction_string [direction], U" direction)")
  1582. }
  1583. DIRECT (REAL_DTW_getDistance_weighted) {
  1584. NUMBER_ONE (DTW)
  1585. double result = my weightedDistance;
  1586. NUMBER_ONE_END (U" (weighted distance)")
  1587. }
  1588. FORM (REAL_DTW_getDistanceValue, U"DTW: Get distance value", nullptr) {
  1589. REAL (xTime, U"Time at x (s)", U"0.1")
  1590. REAL (yTime, U"Time at y (s)", U"0.1")
  1591. OK
  1592. DO
  1593. NUMBER_ONE (DTW)
  1594. double result = undefined;
  1595. if ((xTime >= my xmin && xTime <= my xmax) && (yTime >= my ymin && yTime <= my ymax)) {
  1596. integer irow = Matrix_yToNearestRow (me, yTime);
  1597. integer icol = Matrix_xToNearestColumn (me, xTime);
  1598. result = my z[irow][icol];
  1599. }
  1600. NUMBER_ONE_END (U" (= distance at (", xTime, U", ", yTime, U"))")
  1601. }
  1602. DIRECT (REAL_DTW_getMinimumDistance) {
  1603. NUMBER_ONE (DTW)
  1604. double result, maximum;
  1605. Matrix_getWindowExtrema (me, 0, 0, 0, 0, & result, & maximum);
  1606. NUMBER_ONE_END (U" (minimum)")
  1607. }
  1608. DIRECT (REAL_DTW_getMaximumDistance) {
  1609. NUMBER_ONE (DTW)
  1610. double minimum, result;
  1611. Matrix_getWindowExtrema (me, 0, 0, 0, 0, & minimum, & result);
  1612. NUMBER_ONE_END (U" (maximum)")
  1613. }
  1614. FORM (MODIFY_DTW_formula_distances, U"DTW: Formula (distances)", nullptr) {
  1615. LABEL (U"y := y1; for row := 1 to nrow do { x := x1; "
  1616. "for col := 1 to ncol do { self [row, col] := `formula' ; x := x + dx } y := y + dy }")
  1617. TEXTFIELD (formula, U"Formula:", U"self")
  1618. OK
  1619. DO
  1620. LOOP {
  1621. iam (DTW);
  1622. autoMatrix cp = DTW_to_Matrix_distances (me);
  1623. try {
  1624. Matrix_formula (me, formula, interpreter, 0);
  1625. double minimum, maximum;
  1626. Matrix_getWindowExtrema (me, 0, 0, 0, 0, & minimum, & maximum);
  1627. if (minimum < 0) {
  1628. DTW_Matrix_replace (me, cp.get()); // restore original
  1629. Melder_throw (U"Execution of the formula has made some distance(s) negative which is not allowed.");
  1630. }
  1631. praat_dataChanged (me);
  1632. } catch (MelderError) {
  1633. praat_dataChanged (me);
  1634. throw;
  1635. }
  1636. }
  1637. END }
  1638. FORM (MODIFY_DTW_setDistanceValue, U"DTW: Set distance value", nullptr) {
  1639. REAL (xTime, U"Time at x (s)", U"0.1")
  1640. REAL (yTime, U"Time at y (s)", U"0.1")
  1641. REAL (newDistance, U"New value", U"0.0")
  1642. OK
  1643. DO
  1644. if (newDistance < 0) {
  1645. Melder_throw (U"Distances cannot be negative.");
  1646. }
  1647. MODIFY_EACH (DTW)
  1648. if (xTime < my xmin || xTime > my xmax) {
  1649. Melder_throw (U"Time at x outside domain.");
  1650. }
  1651. if (yTime < my ymin || yTime > my ymax) {
  1652. Melder_throw (U"Time at y outside domain.");
  1653. }
  1654. integer irow = Matrix_yToNearestRow (me, yTime);
  1655. integer icol = Matrix_xToNearestColumn (me, xTime);
  1656. my z[irow][icol] = newDistance;
  1657. MODIFY_EACH_END
  1658. }
  1659. FORM (MODIFY_DTW_findPath, U"DTW: Find path", nullptr) {
  1660. DTW_constraints_addCommonFields(matchStart,matchEnd,slopeConstraint)
  1661. OK
  1662. DO
  1663. MODIFY_EACH (DTW)
  1664. DTW_findPath (me, matchStart, matchEnd, slopeConstraint);
  1665. MODIFY_EACH_END
  1666. }
  1667. FORM (MODIFY_DTW_findPath_bandAndSlope, U"DTW: find path (band & slope)", nullptr) {
  1668. REAL (sakoeChibaBand, U"Sakoe-Chiba band (s)", U"0.05")
  1669. RADIO (slopeConstraint, U"Slope constraint", 1)
  1670. RADIOBUTTON (U"no restriction")
  1671. RADIOBUTTON (U"1/3 < slope < 3")
  1672. RADIOBUTTON (U"1/2 < slope < 2")
  1673. RADIOBUTTON (U"2/3 < slope < 3/2")
  1674. OK
  1675. DO
  1676. MODIFY_EACH (DTW)
  1677. DTW_findPath_bandAndSlope (me, sakoeChibaBand, slopeConstraint, nullptr);
  1678. MODIFY_EACH_END
  1679. }
  1680. FORM (NEW_DTW_to_Matrix_cumulativeDistances, U"DTW: To Matrix", nullptr) {
  1681. REAL (sakoeChibaBand, U"Sakoe-Chiba band (s)", U"0.05")
  1682. RADIO (slopeConstraint, U"Slope constraint", 1)
  1683. RADIOBUTTON (U"no restriction")
  1684. RADIOBUTTON (U"1/3 < slope < 3")
  1685. RADIOBUTTON (U"1/2 < slope < 2")
  1686. RADIOBUTTON (U"2/3 < slope < 3/2")
  1687. OK
  1688. DO
  1689. CONVERT_EACH (DTW)
  1690. autoMatrix result = DTW_to_Matrix_cumulativeDistances (me, sakoeChibaBand, slopeConstraint);
  1691. CONVERT_EACH_END (my name.get(), U"_cd")
  1692. }
  1693. FORM (NEW_DTW_to_Polygon, U"DTW: To Polygon...", nullptr) {
  1694. REAL (sakoeChibaBand, U"Sakoe-Chiba band (s)", U"0.1")
  1695. RADIO (slopeConstraint, U"Slope constraint", 1)
  1696. RADIOBUTTON (U"no restriction")
  1697. RADIOBUTTON (U"1/3 < slope < 3")
  1698. RADIOBUTTON (U"1/2 < slope < 2")
  1699. RADIOBUTTON (U"2/3 < slope < 3/2")
  1700. OK
  1701. DO
  1702. CONVERT_EACH (DTW)
  1703. autoPolygon result = DTW_to_Polygon (me, sakoeChibaBand, slopeConstraint);
  1704. CONVERT_EACH_END (my name.get())
  1705. }
  1706. DIRECT (NEW_DTW_to_Matrix_distances) {
  1707. CONVERT_EACH (DTW)
  1708. autoMatrix result = DTW_to_Matrix_distances (me);
  1709. CONVERT_EACH_END (my name.get())
  1710. }
  1711. DIRECT (NEW_DTW_swapAxes) {
  1712. CONVERT_EACH (DTW)
  1713. autoDTW result = DTW_swapAxes (me);
  1714. CONVERT_EACH_END (my name.get(), U"_axesSwapped")
  1715. }
  1716. DIRECT (MODIFY_DTW_Matrix_replace) {
  1717. MODIFY_FIRST_OF_TWO (DTW, Matrix)
  1718. DTW_Matrix_replace (me, you);
  1719. MODIFY_FIRST_OF_TWO_END
  1720. }
  1721. DIRECT (NEW1_DTW_TextGrid_to_TextGrid) {
  1722. CONVERT_TWO (DTW, TextGrid)
  1723. autoTextGrid result = DTW_TextGrid_to_TextGrid (me, you, 0);
  1724. CONVERT_TWO_END (your name.get(), U"_", my name.get())
  1725. }
  1726. DIRECT (NEW1_DTW_IntervalTier_to_Table) {
  1727. CONVERT_TWO (DTW, IntervalTier)
  1728. autoTable result = DTW_IntervalTier_to_Table (me, you, 1.0/44100);
  1729. CONVERT_TWO_END (my name.get())
  1730. }
  1731. /******************** EditDistanceTable & EditCostsTable ********************************************/
  1732. DIRECT (HELP_EditDistanceTable_help) {
  1733. HELP (U"EditDistanceTable")
  1734. }
  1735. DIRECT (NEW_EditDistanceTable_to_TableOfReal_directions) {
  1736. CONVERT_EACH (EditDistanceTable)
  1737. autoTableOfReal result = EditDistanceTable_to_TableOfReal_directions (me);
  1738. CONVERT_EACH_END (my name.get());
  1739. }
  1740. DIRECT (MODIFY_EditDistanceTable_setEditCosts) {
  1741. MODIFY_FIRST_OF_TWO (EditDistanceTable, EditCostsTable)
  1742. EditDistanceTable_setEditCosts (me, you);
  1743. MODIFY_FIRST_OF_TWO_END
  1744. }
  1745. FORM (MODIFY_EditDistanceTable_setDefaultCosts, U"", nullptr) {
  1746. REAL (insertionCosts, U"Insertion costs", U"1.0")
  1747. REAL (deletionCosts, U"Deletion costs", U"1.0")
  1748. REAL (substitutionCosts, U"Substitution costs", U"2.0")
  1749. OK
  1750. DO
  1751. if (insertionCosts < 0) {
  1752. Melder_throw (U"Insertion costs cannot be negative.");
  1753. }
  1754. if (deletionCosts < 0) {
  1755. Melder_throw (U"Deletion costs cannot be negative.");
  1756. }
  1757. if (substitutionCosts < 0) {
  1758. Melder_throw (U"Substitution costs cannot be negative.");
  1759. }
  1760. MODIFY_EACH (EditDistanceTable)
  1761. EditDistanceTable_setDefaultCosts (me, insertionCosts, deletionCosts, substitutionCosts);
  1762. MODIFY_EACH_END
  1763. }
  1764. FORM (GRAPHICS_EditDistanceTable_draw, U"EditDistanceTable_draw", nullptr) {
  1765. RADIO (format, U"Format", 3)
  1766. RADIOBUTTON (U"decimal")
  1767. RADIOBUTTON (U"exponential")
  1768. RADIOBUTTON (U"free")
  1769. RADIOBUTTON (U"rational")
  1770. NATURAL (precision, U"Precision", U"1")
  1771. REAL (angle, U"Rotate source labels by (degrees)", U"0.0")
  1772. OK
  1773. DO
  1774. GRAPHICS_EACH (EditDistanceTable)
  1775. EditDistanceTable_draw (me, GRAPHICS, format, precision, angle);
  1776. GRAPHICS_EACH_END
  1777. }
  1778. DIRECT (GRAPHICS_EditDistanceTable_drawEditOperations) {
  1779. GRAPHICS_EACH (EditDistanceTable)
  1780. EditDistanceTable_drawEditOperations (me, GRAPHICS);
  1781. GRAPHICS_EACH_END
  1782. }
  1783. DIRECT (HELP_EditCostsTable_help) {
  1784. HELP (U"EditCostsTable")
  1785. }
  1786. FORM (INTEGER_EditCostsTable_getTargetIndex, U"EditCostsTable: Get target index", nullptr) {
  1787. SENTENCE (target, U"Target", U"")
  1788. OK
  1789. DO
  1790. INTEGER_ONE (EditCostsTable)
  1791. integer result = EditCostsTable_getTargetIndex (me, target);
  1792. INTEGER_ONE_END (U" (target index)")
  1793. }
  1794. FORM (INTEGER_EditCostsTable_getSourceIndex, U"EditCostsTable: Get source index", nullptr) {
  1795. SENTENCE (source, U"Source", U"")
  1796. OK
  1797. DO
  1798. INTEGER_ONE (EditCostsTable)
  1799. integer result = EditCostsTable_getSourceIndex (me, source);
  1800. INTEGER_ONE_END (U" (source index)")
  1801. }
  1802. FORM (REAL_EditCostsTable_getInsertionCosts, U"EditCostsTable: Get insertion cost", nullptr) {
  1803. SENTENCE (target, U"Target", U"")
  1804. OK
  1805. DO
  1806. NUMBER_ONE (EditCostsTable)
  1807. double result = EditCostsTable_getInsertionCost (me, target);
  1808. NUMBER_ONE_END (U" (insertion cost)")
  1809. }
  1810. FORM (REAL_EditCostsTable_getDeletionCost, U"EditCostsTable: Get deletion cost", nullptr) {
  1811. SENTENCE (source, U"Source", U"")
  1812. OK
  1813. DO
  1814. NUMBER_ONE (EditCostsTable)
  1815. double result = EditCostsTable_getDeletionCost (me, source);
  1816. NUMBER_ONE_END (U" (deletion cost)")
  1817. }
  1818. FORM (REAL_EditCostsTable_getSubstitutionCost, U"EditCostsTable: Get substitution cost", nullptr) {
  1819. SENTENCE (target, U"Target", U"")
  1820. SENTENCE (source, U"Source", U"")
  1821. OK
  1822. DO
  1823. NUMBER_ONE (EditCostsTable)
  1824. double result = EditCostsTable_getSubstitutionCost (me, target, source);
  1825. NUMBER_ONE_END (U" (substitution cost)")
  1826. }
  1827. FORM (REAL_EditCostsTable_getCosts_others, U"EditCostsTable: Get cost (others)", nullptr) {
  1828. RADIO (costTypes, U"Others cost type", 1)
  1829. RADIOBUTTON (U"Insertion")
  1830. RADIOBUTTON (U"Deletion")
  1831. RADIOBUTTON (U"Equality")
  1832. RADIOBUTTON (U"Inequality")
  1833. OK
  1834. DO
  1835. NUMBER_ONE (EditCostsTable)
  1836. double result = EditCostsTable_getOthersCost (me,costTypes);
  1837. NUMBER_ONE_END (U" (cost)")
  1838. }
  1839. FORM (MODIFY_EditCostsTable_setTargetSymbol_index, U"EditCostsTable: Set target symbol (index)", nullptr) {
  1840. NATURAL (index, U"Index", U"1")
  1841. SENTENCE (target, U"Target", U"a")
  1842. OK
  1843. DO
  1844. MODIFY_EACH (EditCostsTable)
  1845. TableOfReal_setRowLabel (me, index, target);
  1846. MODIFY_EACH_END
  1847. }
  1848. FORM (MODIFY_EditCostsTable_setSourceSymbol_index, U"EditCostsTable: Set source symbol (index)", nullptr) {
  1849. NATURAL (index, U"Index", U"1")
  1850. SENTENCE (source, U"Source", U"a")
  1851. OK
  1852. DO
  1853. MODIFY_EACH (EditCostsTable)
  1854. TableOfReal_setColumnLabel (me, index, source);
  1855. MODIFY_EACH_END
  1856. }
  1857. FORM (MODIFY_EditCostsTable_setInsertionCosts, U"EditCostsTable: Set insertion costs", nullptr) {
  1858. SENTENCE (targets, U"Targets", U"")
  1859. REAL (cost, U"Cost", U"2.0")
  1860. OK
  1861. DO
  1862. MODIFY_EACH (EditCostsTable)
  1863. EditCostsTable_setInsertionCosts (me, targets, cost);
  1864. MODIFY_EACH_END
  1865. }
  1866. FORM (MODIFY_EditCostsTable_setDeletionCosts, U"EditCostsTable: Set deletion costs", nullptr) {
  1867. SENTENCE (sources, U"Sources", U"")
  1868. REAL (cost, U"Cost", U"2.0")
  1869. OK
  1870. DO
  1871. MODIFY_EACH (EditCostsTable)
  1872. EditCostsTable_setDeletionCosts (me, sources, cost);
  1873. MODIFY_EACH_END
  1874. }
  1875. FORM (MODIFY_EditCostsTable_setSubstitutionCosts, U"EditCostsTable: Set substitution costs", nullptr) {
  1876. SENTENCE (targets, U"Targets", U"a i u")
  1877. SENTENCE (sources, U"Sources", U"a i u")
  1878. REAL (cost, U"Cost", U"2.0")
  1879. OK
  1880. DO
  1881. MODIFY_EACH (EditCostsTable)
  1882. EditCostsTable_setSubstitutionCosts (me, targets, sources, cost);
  1883. MODIFY_EACH_END
  1884. }
  1885. FORM (MODIFY_EditCostsTable_setCosts_others, U"EditCostsTable: Set costs (others)", nullptr) {
  1886. LABEL (U"Others costs")
  1887. REAL (insertionCosts, U"Insertion", U"1.0")
  1888. REAL (deletionCosts, U"Deletion", U"1.0")
  1889. LABEL (U"Substitution costs")
  1890. REAL (equalityCosts, U"Equality", U"0.0")
  1891. REAL (inequalityCosts, U"Inequality", U"2.0")
  1892. OK
  1893. DO
  1894. MODIFY_EACH (EditCostsTable)
  1895. EditCostsTable_setOthersCosts (me, insertionCosts, deletionCosts, equalityCosts, inequalityCosts);
  1896. MODIFY_EACH_END
  1897. }
  1898. DIRECT (NEW_EditCostsTable_to_TableOfReal) {
  1899. CONVERT_EACH (EditCostsTable)
  1900. autoTableOfReal result = EditCostsTable_to_TableOfReal (me);
  1901. CONVERT_EACH_END (my name.get());
  1902. }
  1903. FORM (NEW_EditCostsTable_createEmpty, U"Create empty EditCostsTable", U"Create empty EditCostsTable...") {
  1904. SENTENCE (name, U"Name", U"editCosts")
  1905. INTEGER (numberOfTargetSymbols, U"Number of target symbols", U"0")
  1906. INTEGER (numberOfSourceSymbols, U"Number of source symbols", U"0")
  1907. OK
  1908. DO
  1909. CREATE_ONE
  1910. numberOfTargetSymbols = numberOfTargetSymbols < 0 ? 0 : numberOfTargetSymbols;
  1911. numberOfSourceSymbols = numberOfSourceSymbols < 0 ? 0 : numberOfSourceSymbols;
  1912. autoEditCostsTable result = EditCostsTable_create (numberOfTargetSymbols, numberOfSourceSymbols);
  1913. CREATE_ONE_END (name)
  1914. }
  1915. /******************** Eigen ********************************************/
  1916. DIRECT (HELP_Eigen_help) {
  1917. HELP (U"Eigen")
  1918. }
  1919. DIRECT (GRAPHICS_Eigen_drawEigenvalues_scree) {
  1920. Melder_warning (U"The command \"Draw eigenvalues (scree)...\" has been "
  1921. "removed.\n To get a scree plot use \"Draw eigenvalues...\" with the "
  1922. "arguments\n 'Fraction of eigenvalues summed' and 'Cumulative' unchecked.");
  1923. END
  1924. }
  1925. FORM (GRAPHICS_Eigen_drawEigenvalues, U"Eigen: Draw eigenvalues", U"Eigen: Draw eigenvalues...") {
  1926. INTEGER (fromEigenvalue, U"left Eigenvalue range", U"0")
  1927. INTEGER (toEigenvalue, U"right Eigenvalue range", U"0")
  1928. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  1929. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  1930. BOOLEAN (fractionSummed, U"Fraction of eigenvalues summed", false)
  1931. BOOLEAN (cumulative, U"Cumulative", false)
  1932. POSITIVE (markSize_mm, U"Mark size (mm)", U"1.0")
  1933. SENTENCE (mark_string, U"Mark string (+xo.)", U"+")
  1934. BOOLEAN (garnish, U"Garnish", true)
  1935. OK
  1936. DO
  1937. GRAPHICS_EACH (Eigen)
  1938. Eigen_drawEigenvalues (me, GRAPHICS, fromEigenvalue, toEigenvalue, fromAmplitude, toAmplitude, fractionSummed, cumulative, markSize_mm, mark_string, garnish);
  1939. GRAPHICS_EACH_END
  1940. }
  1941. FORM (GRAPHICS_Eigen_drawEigenvector, U"Eigen: Draw eigenvector", U"Eigen: Draw eigenvector...") {
  1942. INTEGER (eigenvectorNumber, U"Eigenvector number", U"1")
  1943. BOOLEAN (loadings, U"Component loadings", false)
  1944. INTEGER (fromElement, U"left Element range", U"0")
  1945. INTEGER (toElement, U"right Element range", U"0")
  1946. REAL (fromAmplitude, U"left Amplitude range", U"-1.0")
  1947. REAL (toAmplitude, U"right Amplitude range", U"1.0")
  1948. POSITIVE (markSize_mm, U"Mark size (mm)", U"1.0")
  1949. SENTENCE (mark_string, U"Mark string (+xo.)", U"+")
  1950. BOOLEAN (connectPoints, U"Connect points", true)
  1951. BOOLEAN (garnish, U"Garnish", true)
  1952. OK
  1953. DO
  1954. GRAPHICS_EACH (Eigen)
  1955. Eigen_drawEigenvector (me, GRAPHICS, eigenvectorNumber, fromElement, toElement, fromAmplitude, toAmplitude, loadings, markSize_mm, mark_string, connectPoints, nullptr, garnish);
  1956. GRAPHICS_EACH_END
  1957. }
  1958. DIRECT (INTEGER_Eigen_getNumberOfEigenvalues) {
  1959. INTEGER_ONE (Eigen)
  1960. integer result = my numberOfEigenvalues;
  1961. INTEGER_ONE_END (U" (number of eigenvalues)")
  1962. }
  1963. DIRECT (INTEGER_Eigen_getNumberOfEigenvectors) {
  1964. INTEGER_ONE (Eigen)
  1965. integer result = my numberOfEigenvalues;
  1966. INTEGER_ONE_END (U" (number of eigenvectors)")
  1967. }
  1968. DIRECT (INTEGER_Eigen_getEigenvectorDimension) {
  1969. INTEGER_ONE (Eigen)
  1970. integer result = my dimension;
  1971. INTEGER_ONE_END (U" (dimension)")
  1972. }
  1973. FORM (REAL_Eigen_getEigenvalue, U"Eigen: Get eigenvalue", U"Eigen: Get eigenvalue...") {
  1974. NATURAL (eigenvalueNumber, U"Eigenvalue number", U"1")
  1975. OK
  1976. DO
  1977. NUMBER_ONE (Eigen)
  1978. double result = undefined;
  1979. if (eigenvalueNumber > 0 && eigenvalueNumber <= my numberOfEigenvalues) {
  1980. result = my eigenvalues [eigenvalueNumber];
  1981. }
  1982. NUMBER_ONE_END (U" (eigenvalue [", eigenvalueNumber, U"])")
  1983. }
  1984. FORM (REAL_Eigen_getSumOfEigenvalues, U"Eigen:Get sum of eigenvalues", U"Eigen: Get sum of eigenvalues...") {
  1985. INTEGER (fromEigenvalue, U"left Eigenvalue range", U"0")
  1986. INTEGER (toEigenvalue, U"right Eigenvalue range", U"0")
  1987. OK
  1988. DO
  1989. NUMBER_ONE (Eigen)
  1990. double result = Eigen_getSumOfEigenvalues (me, fromEigenvalue, toEigenvalue);
  1991. NUMBER_ONE_END (U" (sum of eigenvalues [", fromEigenvalue, U"..", toEigenvalue, U"])")
  1992. }
  1993. FORM (REAL_Eigen_getEigenvectorElement, U"Eigen: Get eigenvector element", U"Eigen: Get eigenvector element...") {
  1994. NATURAL (eigenvectorNumber, U"Eigenvector number", U"1")
  1995. NATURAL (elementNumber, U"Element number", U"1")
  1996. OK
  1997. DO
  1998. NUMBER_ONE (Eigen)
  1999. double result = Eigen_getEigenvectorElement (me, eigenvectorNumber, elementNumber);
  2000. NUMBER_ONE_END (U" (eigenvector [", eigenvectorNumber, U"] element [", elementNumber, U"])")
  2001. }
  2002. FORM (MODIFY_Eigen_invertEigenvector, U"Eigen: Invert eigenvector", nullptr) {
  2003. NATURAL (eigenvectorNumber, U"Eigenvector number", U"1")
  2004. OK
  2005. DO
  2006. MODIFY_EACH (Eigen)
  2007. Eigen_invertEigenvector (me, eigenvectorNumber);
  2008. MODIFY_EACH_END
  2009. }
  2010. DIRECT (MODIFY_Eigens_alignEigenvectors) {
  2011. FIND_LIST (Eigen)
  2012. Eigens_alignEigenvectors (& list);
  2013. END
  2014. }
  2015. FORM (NEW1_Eigen_Matrix_projectColumns, U"Eigen & Matrix: Project columns", U"Eigen & Matrix: Project...") {
  2016. INTEGER (numberOfDimensions, U"Number of dimensions", U"0")
  2017. OK
  2018. DO
  2019. CONVERT_TWO (Eigen, Matrix)
  2020. autoMatrix result = Eigen_Matrix_to_Matrix_projectColumns (me, you, numberOfDimensions);
  2021. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  2022. }
  2023. DIRECT (NEW1_Eigen_SSCP_project) {
  2024. CONVERT_TWO (Eigen, SSCP)
  2025. autoSSCP result = Eigen_SSCP_project (me, you);
  2026. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  2027. }
  2028. DIRECT (NEW1_Eigen_Covariance_project) {
  2029. CONVERT_TWO (Eigen, Covariance)
  2030. autoCovariance result = Eigen_Covariance_project (me, you);
  2031. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  2032. }
  2033. /******************** Index ********************************************/
  2034. DIRECT (HELP_Index_help) {
  2035. HELP (U"Index")
  2036. }
  2037. DIRECT (INTEGER_Index_getNumberOfClasses) {
  2038. INTEGER_ONE (Index)
  2039. integer result = my classes -> size;
  2040. INTEGER_ONE_END (U" (number of classes)")
  2041. }
  2042. FORM (INFO_StringsIndex_getClassLabelFromClassIndex, U"StringsIndex: Get class label", U"StringsIndex: Get class label...") {
  2043. NATURAL (index, U"Class index", U"1")
  2044. OK
  2045. DO
  2046. STRING_ONE (StringsIndex)
  2047. const char32* result = StringsIndex_getClassLabelFromClassIndex (me, index);
  2048. STRING_ONE_END
  2049. }
  2050. FORM (INFO_StringsIndex_getItemLabelFromItemIndex, U"StringsIndex: Get item label", nullptr) {
  2051. NATURAL (itemIndex, U"Item index", U"1")
  2052. OK
  2053. DO
  2054. STRING_ONE (StringsIndex)
  2055. conststring32 result = StringsIndex_getItemLabelFromItemIndex (me, itemIndex);
  2056. STRING_ONE_END
  2057. }
  2058. FORM (INTEGER_StringsIndex_getClassIndexFromItemIndex, U"StringsIndex: Get item index", nullptr) {
  2059. NATURAL (itemIndex, U"Item index", U"1")
  2060. OK
  2061. DO
  2062. INTEGER_ONE (Index)
  2063. integer result = Index_getClassIndexFromItemIndex (me, itemIndex);
  2064. INTEGER_ONE_END (U" (class index)")
  2065. }
  2066. FORM (INTEGER_Index_getIndex, U"Index: Get item index", nullptr) {
  2067. NATURAL (itemIndex, U"Item index", U"1")
  2068. OK
  2069. DO
  2070. INTEGER_ONE (Index)
  2071. integer result = Index_getClassIndexFromItemIndex (me, itemIndex);
  2072. INTEGER_ONE_END (U" (class index)")
  2073. }
  2074. FORM (INTEGER_StringsIndex_getClassIndex, U"StringsIndex: Get class index from calss label", nullptr) {
  2075. WORD (klasLabel, U"Class label", U"label")
  2076. OK
  2077. DO
  2078. INTEGER_ONE (StringsIndex)
  2079. integer result = StringsIndex_getClassIndexFromClassLabel (me, klasLabel);
  2080. INTEGER_ONE_END (U" (class index)")
  2081. }
  2082. FORM (NEW_Index_extractPart, U"Index: Extract part", U"Index: Extract part...") {
  2083. INTEGER (fromItem, U"left Item range", U"0")
  2084. INTEGER (toItem, U"right Item range", U"0")
  2085. OK
  2086. DO
  2087. CONVERT_EACH (Index);
  2088. autoIndex result = Index_extractPart (me, fromItem, toItem);
  2089. CONVERT_EACH_END (my name.get(), U"_part")
  2090. }
  2091. FORM (NEW_Index_to_Permutation, U"Index: To Permutation", U"Index: To Permutation...") {
  2092. BOOLEAN (permuteWithinClasses, U"Permute within classes", true)
  2093. OK
  2094. DO
  2095. CONVERT_EACH (Index);
  2096. autoPermutation result = Index_to_Permutation_permuteRandomly (me, permuteWithinClasses);
  2097. CONVERT_EACH_END (my name.get())
  2098. }
  2099. DIRECT (NEW_StringsIndex_to_Strings) {
  2100. CONVERT_EACH (StringsIndex)
  2101. autoStrings result = StringsIndex_to_Strings (me);
  2102. CONVERT_EACH_END (my name.get())
  2103. }
  2104. /******************** Excitation ********************************************/
  2105. DIRECT (NEW1_Excitations_to_ExcitationList) {
  2106. CONVERT_LIST (Excitation)
  2107. autoExcitationList result = Excitations_to_ExcitationList (& list);
  2108. CONVERT_LIST_END (U"appended")
  2109. }
  2110. /******************** ExcitationList ********************************************/
  2111. FORM (MODIFY_ExcitationList_formula, U"ExcitationList: Formula", nullptr) {
  2112. LABEL (U"for all objects in ExcitationList do { for col := 1 to ncol do { self [col] := `formula' ; x := x + dx } }")
  2113. TEXTFIELD (formula, U"Formula:", U"self")
  2114. OK
  2115. DO
  2116. MODIFY_EACH (ExcitationList)
  2117. for (integer j = 1; j <= my size; j ++) {
  2118. Matrix_formula (my at [j], formula, interpreter, nullptr);
  2119. }
  2120. MODIFY_EACH_END
  2121. }
  2122. DIRECT (MODIFY_ExcitationList_addItem) {
  2123. MODIFY_FIRST_OF_ONE_AND_LIST (ExcitationList, Excitation)
  2124. ExcitationList_addItems (me, & list);
  2125. MODIFY_FIRST_OF_ONE_AND_LIST_END
  2126. }
  2127. FORM (NEW_ExcitationList_extractItem, U"ExcitationList: Extract item", nullptr) {
  2128. NATURAL (itemIndex, U"Item index", U"1")
  2129. OK
  2130. DO
  2131. CONVERT_EACH (ExcitationList)
  2132. autoExcitation result = ExcitationList_extractItem (me, itemIndex);
  2133. CONVERT_EACH_END (my name.get(), U"_", itemIndex)
  2134. }
  2135. DIRECT (NEW1_ExcitationList_append) {
  2136. CONVERT_COUPLE (ExcitationList)
  2137. autoExcitationList result = Data_copy (me);
  2138. result -> merge (you);
  2139. CONVERT_COUPLE_END (U"appended")
  2140. }
  2141. FORM (NEW_ExcitationList_to_PatternList, U"Excitations: To PatternList", nullptr) {
  2142. NATURAL (join, U"Join", U"1")
  2143. OK
  2144. DO
  2145. CONVERT_EACH (ExcitationList)
  2146. autoPatternList result = ExcitationList_to_PatternList (me, join);
  2147. CONVERT_EACH_END (my name.get())
  2148. }
  2149. DIRECT (NEW_ExcitationList_to_TableOfReal) {
  2150. CONVERT_EACH (ExcitationList)
  2151. autoTableOfReal result = ExcitationList_to_TableOfReal (me);
  2152. CONVERT_EACH_END (my name.get())
  2153. }
  2154. /************************* FileInMemory ***********************************/
  2155. FORM_READ (READ1_FileInMemory_create, U"Create file in memory", nullptr, true) {
  2156. autoFileInMemory me = FileInMemory_create (file);
  2157. praat_new (me.move(), MelderFile_name (file));
  2158. END }
  2159. FORM (MODIFY_FileInMemory_setId, U"FileInMemory: Set id", nullptr) {
  2160. SENTENCE (newId, U"New id", U"New id")
  2161. OK
  2162. DO
  2163. MODIFY_EACH (FileInMemory)
  2164. FileInMemory_setId (me, newId);
  2165. MODIFY_EACH_END
  2166. }
  2167. FORM (INFO_FileInMemory_showAsCode, U"FileInMemory: Show as code", nullptr) {
  2168. WORD (name, U"Name", U"example")
  2169. INTEGER (numberOfByterPerLine, U"Number of bytes per line", U"20")
  2170. OK
  2171. DO
  2172. INFO_ONE (FileInMemory)
  2173. MelderInfo_open ();
  2174. FileInMemory_showAsCode (me, name, numberOfByterPerLine);
  2175. MelderInfo_close ();
  2176. INFO_ONE_END
  2177. }
  2178. /************************* FileInMemorySet ***********************************/
  2179. DIRECT (INFO_FileInMemorySet_getNumberOfFiles) {
  2180. NUMBER_ONE (FileInMemorySet)
  2181. integer result = my size;
  2182. NUMBER_ONE_END (U" (number of files)")
  2183. }
  2184. FORM (INFO_FileInMemorySet_hasDirectory, U"FileInMemorySet: Has directory?", nullptr) {
  2185. WORD (name, U"Name", U"aav")
  2186. OK
  2187. DO
  2188. NUMBER_ONE (FileInMemorySet)
  2189. bool result = FileInMemorySet_hasDirectory (me, name);
  2190. NUMBER_ONE_END (U" (has directory?)")
  2191. }
  2192. /************************* FileInMemoryManager ***********************************/
  2193. DIRECT (NEW1_FileInMemoryManager_create) {
  2194. CREATE_ONE
  2195. autoFileInMemoryManager result = Data_copy (espeak_ng_FileInMemoryManager.get());
  2196. CREATE_ONE_END (U"filesInMemory")
  2197. }
  2198. DIRECT (INFO_FileInMemoryManager_getNumberOfFiles) {
  2199. NUMBER_ONE (FileInMemoryManager)
  2200. integer result = my files -> size;
  2201. NUMBER_ONE_END (U" (number of files)")
  2202. }
  2203. DIRECT (INFO_FileInMemoryManager_getNumberOfOpenFiles) {
  2204. NUMBER_ONE (FileInMemoryManager)
  2205. integer result = my openFiles -> size;
  2206. NUMBER_ONE_END (U" (number of open files)")
  2207. }
  2208. FORM (INFO_FileInMemoryManager_hasDirectory, U"FileInMemoryManager: Has directory?", nullptr) {
  2209. WORD (name, U"Name", U"aav")
  2210. OK
  2211. DO
  2212. NUMBER_ONE (FileInMemoryManager)
  2213. bool result = FileInMemoryManager_hasDirectory (me, name);
  2214. NUMBER_ONE_END (U" (has directory?)")
  2215. }
  2216. FORM (NEW1_FileInMemoryManager_extractFiles, U"FileInMemoryManager: Extract files", nullptr) {
  2217. LABEL (U"Extract all files where the file name ")
  2218. OPTIONMENU_ENUM (kMelder_string, which, U"...", kMelder_string::CONTAINS)
  2219. SENTENCE (criterion, U"...the text", U"/voices/")
  2220. OK
  2221. DO
  2222. CONVERT_EACH (FileInMemoryManager)
  2223. autoFileInMemorySet result = FileInMemoryManager_extractFiles (me, which, criterion);
  2224. CONVERT_EACH_END (my name.get())
  2225. }
  2226. FORM (NEW1_FileInMemoryManager_downto_Table, U"FileInMemoryManager: Down to Table", nullptr) {
  2227. BOOLEAN (openFilesOnly, U"Open files only?", false)
  2228. OK
  2229. DO
  2230. CONVERT_EACH (FileInMemoryManager)
  2231. autoTable result = FileInMemoryManager_downto_Table (me, openFilesOnly);
  2232. CONVERT_EACH_END (my name.get())
  2233. }
  2234. FORM (NEW_FileInMemorySet_createFromDirectoryContents, U"Create files in memory from directory contents", nullptr) {
  2235. SENTENCE (name, U"Name", U"list")
  2236. TEXTFIELD (directory, U"Directory:", U"/home/david/projects/espeak-ng/espeak-ng-data/voices/!v")
  2237. WORD (fileGlobber, U"Only files that match pattern", U"*")
  2238. OK
  2239. DO
  2240. CREATE_ONE
  2241. autoFileInMemorySet result = FileInMemorySet_createFromDirectoryContents (directory, fileGlobber);
  2242. CREATE_ONE_END (name)
  2243. }
  2244. FORM (NEW1_FileInMemorySet_extractFiles, U"FileInMemorySet: Extract files", nullptr) {
  2245. LABEL (U"Extract all files where the file name ")
  2246. OPTIONMENU_ENUM (kMelder_string, which, U"...", kMelder_string::CONTAINS)
  2247. SENTENCE (criterion, U"...the text", U"/voices/")
  2248. OK
  2249. DO
  2250. CONVERT_EACH (FileInMemorySet)
  2251. autoFileInMemorySet result = FileInMemorySet_extractFiles (me, which, criterion);
  2252. CONVERT_EACH_END (my name.get())
  2253. }
  2254. FORM (INFO_FileInMemorySet_showAsCode, U"FileInMemorySet: Show as code", nullptr) {
  2255. WORD (name, U"Name", U"example")
  2256. INTEGER (numberOfBytesPerLine, U"Number of bytes per line", U"20")
  2257. OK
  2258. DO
  2259. INFO_ONE (FileInMemorySet)
  2260. MelderInfo_open ();
  2261. FileInMemorySet_showAsCode (me, name, numberOfBytesPerLine);
  2262. MelderInfo_close ();
  2263. INFO_ONE_END
  2264. }
  2265. FORM (INFO_FileInMemorySet_showOneFileAsCode, U"FileInMemorySet: Show one file as code", nullptr) {
  2266. NATURAL (index, U"Index", U"1")
  2267. WORD (name, U"Name", U"example")
  2268. INTEGER (numberOfBytesPerLine, U"Number of bytes per line", U"20")
  2269. OK
  2270. DO
  2271. INFO_ONE (FileInMemorySet)
  2272. MelderInfo_open ();
  2273. FileInMemorySet_showOneFileAsCode (me, index, name, numberOfBytesPerLine);
  2274. MelderInfo_close ();
  2275. INFO_ONE_END
  2276. }
  2277. DIRECT (NEW1_FilesInMemory_to_FileInMemorySet) {
  2278. CONVERT_LIST (FileInMemory)
  2279. autoFileInMemorySet result = FilesInMemory_to_FileInMemorySet (list);
  2280. CONVERT_LIST_END (U"merged");
  2281. }
  2282. DIRECT (MODIFY_FileInMemorySet_addItemsToSet) {
  2283. MODIFY_FIRST_OF_TWO (FileInMemorySet, FileInMemory)
  2284. autoFileInMemory him = Data_copy (you);
  2285. my addItem_move (him.move());
  2286. MODIFY_FIRST_OF_TWO_END
  2287. }
  2288. DIRECT (NEW1_FileInMemorySets_merge) {
  2289. CONVERT_LIST (FileInMemorySet)
  2290. autoFileInMemorySet result = FileInMemorySets_merge (list);
  2291. CONVERT_LIST_END (U"merge");
  2292. }
  2293. DIRECT (NEW_FileInMemorySet_to_Strings_id) {
  2294. CONVERT_EACH (FileInMemorySet)
  2295. autoStrings result = FileInMemorySet_to_Strings_id (me);
  2296. CONVERT_EACH_END (my name.get());
  2297. }
  2298. /************************* FilterBank ***********************************/
  2299. FORM (GRAPHICS_FilterBank_drawFilters, U"FilterBank: Draw filters", nullptr) {
  2300. praat_TimeFunction_RANGE(fromTime,toTime)
  2301. REAL (fromFrequency, U"left Frequency range", U"0.0")
  2302. REAL (toFrequency, U"right Frequency range", U"0.0")
  2303. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  2304. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  2305. OK
  2306. DO
  2307. GRAPHICS_EACH (Matrix)
  2308. Matrix_drawRows (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude);
  2309. GRAPHICS_EACH_END
  2310. }
  2311. FORM (GRAPHICS_FilterBank_drawOneContour, U"FilterBank: Draw one contour", nullptr) {
  2312. praat_TimeFunction_RANGE(fromTime,toTime)
  2313. REAL (fromFrequency, U"left Frequency range", U"0.0")
  2314. REAL (toFrequency, U"right Frequency range", U"0.0")
  2315. REAL (height, U"Height (dB)", U"40.0")
  2316. OK
  2317. DO
  2318. GRAPHICS_EACH (Matrix)
  2319. Matrix_drawOneContour (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, height);
  2320. GRAPHICS_EACH_END
  2321. }
  2322. FORM (GRAPHICS_FilterBank_drawContours, U"FilterBank: Draw contours", nullptr) {
  2323. praat_TimeFunction_RANGE(fromTime,toTime)
  2324. REAL (fromFrequency, U"left Frequency range", U"0.0")
  2325. REAL (toFrequency, U"right Frequency range", U"0.0")
  2326. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  2327. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  2328. OK
  2329. DO
  2330. GRAPHICS_EACH (Matrix)
  2331. Matrix_drawContours (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude);
  2332. GRAPHICS_EACH_END
  2333. }
  2334. FORM (GRAPHICS_FilterBank_drawFrequencyScales, U"FilterBank: Draw frequency scales", U"FilterBank: Draw frequency scales...") {
  2335. RADIO (xFrequencyScale, U"Horizontal frequency scale", 1)
  2336. RADIOBUTTON (U"Hertz")
  2337. RADIOBUTTON (U"Bark")
  2338. RADIOBUTTON (U"mel")
  2339. REAL (xFromFrequency, U"left Horizontal frequency range", U"0.0")
  2340. REAL (xToFrequency, U"right Horizontal frequency range", U"0.0")
  2341. RADIO (yFrequencyScale, U"Vertical frequency scale", 1)
  2342. RADIOBUTTON (U"Hertz")
  2343. RADIOBUTTON (U"Bark")
  2344. RADIOBUTTON (U"mel")
  2345. REAL (yFromFrequency, U"left Vertical frequency range", U"0.0")
  2346. REAL (yToFrequency, U"right Vertical frequency range", U"0.0")
  2347. BOOLEAN (garnish, U"Garnish", true)
  2348. OK
  2349. DO
  2350. GRAPHICS_EACH (FilterBank)
  2351. FilterBank_drawFrequencyScales (me, GRAPHICS, xFrequencyScale, xFromFrequency, xToFrequency, yFrequencyScale, yFromFrequency, yToFrequency, garnish);
  2352. GRAPHICS_EACH_END
  2353. }
  2354. FORM (GRAPHICS_MelSpectrogram_paintImage, U"MelSpectrogram: Paint image", U"MelSpectrogram: Paint image...") {
  2355. praat_TimeFunction_RANGE(fromTime,toTime)
  2356. REAL (fromFrequency, U"left Frequency range (mel)", U"0.0")
  2357. REAL (toFrequency, U"right Frequency range (mel)", U"0.0")
  2358. REAL (fromAmplitude, U"left Amplitude range (dB)", U"0.0")
  2359. REAL (toAmplitude, U"right Amplitude range (dB)", U"0.0")
  2360. BOOLEAN (garnish, U"Garnish", true)
  2361. OK
  2362. DO
  2363. GRAPHICS_EACH (BandFilterSpectrogram)
  2364. BandFilterSpectrogram_paintImage (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude, garnish);
  2365. GRAPHICS_EACH_END
  2366. }
  2367. FORM (GRAPHICS_BarkSpectrogram_paintImage, U"BarkSpectrogram: Paint image", U"BarkSpectrogram: Paint image...") {
  2368. praat_TimeFunction_RANGE(fromTime,toTime)
  2369. REAL (fromFrequency, U"left Frequency range (bark)", U"0.0")
  2370. REAL (toFrequency, U"right Frequency range (bark)", U"0.0")
  2371. REAL (fromAmplitude, U"left Amplitude range (dB)", U"0.0")
  2372. REAL (toAmplitude, U"right Amplitude range (dB)", U"0.0")
  2373. BOOLEAN (garnish, U"Garnish", true)
  2374. OK
  2375. DO
  2376. GRAPHICS_EACH (BandFilterSpectrogram)
  2377. BandFilterSpectrogram_paintImage (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude, garnish);
  2378. GRAPHICS_EACH_END
  2379. }
  2380. FORM (GRAPHICS_FilterBank_paintImage, U"FilterBank: Paint image", nullptr) {
  2381. praat_TimeFunction_RANGE(fromTime,toTime)
  2382. REAL (fromFrequency, U"left Frequency range", U"0.0")
  2383. REAL (toFrequency, U"right Frequency range", U"0.0")
  2384. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  2385. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  2386. OK
  2387. DO
  2388. GRAPHICS_EACH (Matrix)
  2389. Matrix_paintImage (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude);
  2390. GRAPHICS_EACH_END
  2391. }
  2392. FORM (GRAPHICS_FilterBank_paintContours, U"FilterBank: Paint contours", nullptr) {
  2393. praat_TimeFunction_RANGE(fromTime,toTime)
  2394. REAL (fromFrequency, U"left Frequency range", U"0.0")
  2395. REAL (toFrequency, U"right Frequency range", U"0.0")
  2396. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  2397. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  2398. OK
  2399. DO
  2400. GRAPHICS_EACH (Matrix)
  2401. Matrix_paintContours (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude);
  2402. GRAPHICS_EACH_END
  2403. }
  2404. FORM (GRAPHICS_FilterBank_paintCells, U"FilterBank: Paint cells", nullptr) {
  2405. praat_TimeFunction_RANGE(fromTime,toTime)
  2406. REAL (fromFrequency, U"left Frequency range", U"0.0")
  2407. REAL (toFrequency, U"right Frequency range", U"0.0")
  2408. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  2409. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  2410. OK
  2411. DO
  2412. GRAPHICS_EACH (Matrix)
  2413. Matrix_paintCells (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude);
  2414. GRAPHICS_EACH_END
  2415. }
  2416. FORM (GRAPHICS_FilterBank_paintSurface, U"FilterBank: Paint surface", nullptr) {
  2417. praat_TimeFunction_RANGE(fromTime,toTime)
  2418. REAL (fromFrequency, U"left Frequency range", U"0.0")
  2419. REAL (toFrequency, U"right Frequency range", U"0.0")
  2420. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  2421. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  2422. OK
  2423. DO
  2424. GRAPHICS_EACH (Matrix)
  2425. Matrix_paintSurface (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude,30, 45);
  2426. GRAPHICS_EACH_END
  2427. }
  2428. FORM (REAL_FilterBank_getFrequencyInHertz, U"FilterBank: Get frequency in Hertz", U"FilterBank: Get frequency in Hertz...") {
  2429. REAL (frequency, U"Frequency", U"10.0")
  2430. RADIO (frequencyUnit, U"Unit", 2)
  2431. RADIOBUTTON (U"Hertz")
  2432. RADIOBUTTON (U"Bark")
  2433. RADIOBUTTON (U"mel")
  2434. OK
  2435. DO
  2436. NUMBER_ONE (FilterBank)
  2437. double result = FilterBank_getFrequencyInHertz (me, frequency, frequencyUnit);
  2438. NUMBER_ONE_END (U" hertz")
  2439. }
  2440. FORM (REAL_FilterBank_getFrequencyInBark, U"FilterBank: Get frequency in Bark", U"FilterBank: Get frequency in Bark...") {
  2441. REAL (frequency, U"Frequency", U"93.17")
  2442. RADIO (frequencyUnit, U"Unit", 1)
  2443. RADIOBUTTON (U"Hertz")
  2444. RADIOBUTTON (U"Bark")
  2445. RADIOBUTTON (U"mel")
  2446. OK
  2447. DO
  2448. NUMBER_ONE (FilterBank)
  2449. double result = FilterBank_getFrequencyInBark (me, frequency, frequencyUnit);
  2450. NUMBER_ONE_END (U" bark")
  2451. }
  2452. FORM (REAL_FilterBank_getFrequencyInMel, U"FilterBank: Get frequency in mel", U"FilterBank: Get frequency in mel...") {
  2453. REAL (frequency, U"Frequency", U"1000.0")
  2454. RADIO (frequencyUnit, U"Unit", 1)
  2455. RADIOBUTTON (U"Hertz")
  2456. RADIOBUTTON (U"Bark")
  2457. RADIOBUTTON (U"mel")
  2458. OK
  2459. DO
  2460. NUMBER_ONE (FilterBank)
  2461. double result = FilterBank_getFrequencyInMel (me, frequency, frequencyUnit);
  2462. NUMBER_ONE_END (U" mel")
  2463. }
  2464. FORM (MODIFY_FilterBank_equalizeIntensities, U"FilterBank: Equalize intensities", nullptr) {
  2465. REAL (intensity_dB, U"Intensity (dB)", U"80.0")
  2466. OK
  2467. DO
  2468. MODIFY_EACH (FilterBank)
  2469. FilterBank_equalizeIntensities (me, intensity_dB);
  2470. MODIFY_EACH_END
  2471. }
  2472. FORM (MODIFY_BandFilterSpectrogram_equalizeIntensities, U"BandFilterSpectrogram: Equalize intensities", nullptr) {
  2473. REAL (intensity_dB, U"Intensity (dB)", U"80.0")
  2474. OK
  2475. DO
  2476. MODIFY_EACH (BandFilterSpectrogram)
  2477. BandFilterSpectrogram_equalizeIntensities (me, intensity_dB);
  2478. MODIFY_EACH_END
  2479. }
  2480. DIRECT (NEW_FilterBank_to_Matrix) {
  2481. CONVERT_EACH (FilterBank)
  2482. autoMatrix result = FilterBank_to_Matrix (me);
  2483. CONVERT_EACH_END (my name.get())
  2484. }
  2485. FORM (NEW_BandFilterSpectrogram_to_Matrix, U"BandFilterSpectrogram: To Matrix", nullptr) {
  2486. BOOLEAN (convertToDB, U"Convert to dB values", 1)
  2487. OK
  2488. DO
  2489. CONVERT_EACH (BandFilterSpectrogram)
  2490. autoMatrix result = BandFilterSpectrogram_to_Matrix (me, convertToDB);
  2491. CONVERT_EACH_END (my name.get())
  2492. }
  2493. FORM (NEW1_FilterBanks_crossCorrelate, U"FilterBanks: Cross-correlate", nullptr) {
  2494. RADIO_ENUM (kSounds_convolve_scaling, amplitudeScaling,
  2495. U"Amplitude scaling", kSounds_convolve_scaling::DEFAULT)
  2496. RADIO_ENUM (kSounds_convolve_signalOutsideTimeDomain, signalOutsideTimeDomainIs,
  2497. U"Signal outside time domain is...", kSounds_convolve_signalOutsideTimeDomain::DEFAULT)
  2498. OK
  2499. DO
  2500. CONVERT_COUPLE (FilterBank)
  2501. autoSound result = FilterBanks_crossCorrelate (me, you, amplitudeScaling, signalOutsideTimeDomainIs);
  2502. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  2503. }
  2504. FORM (NEW1_BandFilterSpectrograms_crossCorrelate, U"BandFilterSpectrograms: Cross-correlate", nullptr) {
  2505. RADIO_ENUM (kSounds_convolve_scaling, amplitudeScaling,
  2506. U"Amplitude scaling", kSounds_convolve_scaling::DEFAULT)
  2507. RADIO_ENUM (kSounds_convolve_signalOutsideTimeDomain, signalOutsideTimeDomainIs,
  2508. U"Signal outside time domain is...", kSounds_convolve_signalOutsideTimeDomain::DEFAULT)
  2509. OK
  2510. DO
  2511. CONVERT_COUPLE (BandFilterSpectrogram)
  2512. autoSound result = BandFilterSpectrograms_crossCorrelate (me, you, amplitudeScaling, signalOutsideTimeDomainIs);
  2513. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  2514. }
  2515. FORM (NEW1_FilterBanks_convolve, U"FilterBanks: Convolve", nullptr) {
  2516. RADIO_ENUM (kSounds_convolve_scaling, amplitudeScaling,
  2517. U"Amplitude scaling", kSounds_convolve_scaling::DEFAULT)
  2518. RADIO_ENUM (kSounds_convolve_signalOutsideTimeDomain, signalOutsideTimeDomainIs,
  2519. U"Signal outside time domain is...", kSounds_convolve_signalOutsideTimeDomain::DEFAULT)
  2520. OK
  2521. DO
  2522. CONVERT_COUPLE (FilterBank)
  2523. autoSound result = FilterBanks_convolve (me, you, amplitudeScaling, signalOutsideTimeDomainIs);
  2524. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  2525. }
  2526. FORM (NEW1_BandFilterSpectrograms_convolve, U"BandFilterSpectrograms: Convolve", nullptr) {
  2527. RADIO_ENUM (kSounds_convolve_scaling, amplitudeScaling,
  2528. U"Amplitude scaling", kSounds_convolve_scaling::DEFAULT)
  2529. RADIO_ENUM (kSounds_convolve_signalOutsideTimeDomain, signalOutsideTimeDomainIs,
  2530. U"Signal outside time domain is...", kSounds_convolve_signalOutsideTimeDomain::DEFAULT)
  2531. OK
  2532. DO
  2533. CONVERT_COUPLE (BandFilterSpectrogram)
  2534. autoSound result = BandFilterSpectrograms_convolve (me, you, amplitudeScaling, signalOutsideTimeDomainIs);
  2535. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  2536. }
  2537. DIRECT (NEW_FilterBank_to_Intensity) {
  2538. CONVERT_EACH (FilterBank)
  2539. autoIntensity result = FilterBank_to_Intensity (me);
  2540. CONVERT_EACH_END (my name.get())
  2541. }
  2542. DIRECT (NEW_BandFilterSpectrogram_to_Intensity) {
  2543. CONVERT_EACH (BandFilterSpectrogram)
  2544. autoIntensity result = BandFilterSpectrogram_to_Intensity (me);
  2545. CONVERT_EACH_END (my name.get())
  2546. }
  2547. /*********** FormantFilter *******************************************/
  2548. DIRECT (HELP_FormantFilter_help) {
  2549. HELP (U"FormantFilter")
  2550. }
  2551. FORM (GRAPHICS_FormantFilter_drawFilterFunctions, U"FormantFilter: Draw filter functions", U"FilterBank: Draw filter functions...") {
  2552. INTEGER (fromFilter, U"left Filter range", U"0")
  2553. INTEGER (toFilter, U"right Filter range", U"0")
  2554. POSITIVE (bandwidth, U"Bandwidth (Hz)", U"100.0")
  2555. RADIO (frequencyScale, U"Frequency scale", 1)
  2556. RADIOBUTTON (U"Hertz")
  2557. RADIOBUTTON (U"Bark")
  2558. RADIOBUTTON (U"mel")
  2559. REAL (fromFrequency, U"left Frequency range", U"0.0")
  2560. REAL (toFrequency, U"right Frequency range", U"0.0")
  2561. BOOLEAN (dBScale, U"Amplitude scale in dB", 1)
  2562. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  2563. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  2564. BOOLEAN (garnish, U"Garnish", true)
  2565. OK
  2566. DO
  2567. GRAPHICS_EACH (FormantFilter)
  2568. FormantFilter_drawFilterFunctions (me, GRAPHICS, bandwidth, frequencyScale, fromFilter, toFilter, fromFrequency, toFrequency, dBScale, fromAmplitude, toAmplitude, garnish);
  2569. GRAPHICS_EACH_END
  2570. }
  2571. FORM (GRAPHICS_FormantFilter_drawSpectrum_slice, U"FormantFilter: Draw spectrum (slice)", U"FilterBank: Draw spectrum (slice)...") {
  2572. REAL (time, U"Time (s)", U"0.1")
  2573. REAL (fromFrequency, U"left Frequency range (Hz)", U"0.0")
  2574. REAL (toFrequency, U"right Frequency range (Hz)", U"0.0")
  2575. REAL (fromAmplitude, U"left Amplitude range (dB)", U"0.0")
  2576. REAL (toAmplitude, U"right Amplitude range (dB)", U"0.0")
  2577. BOOLEAN (garnish, U"Garnish", true)
  2578. OK
  2579. DO
  2580. GRAPHICS_EACH (FilterBank)
  2581. FilterBank_drawTimeSlice (me, GRAPHICS, time, fromFrequency, toFrequency, fromAmplitude, toAmplitude, U"Hz", garnish);
  2582. GRAPHICS_EACH_END
  2583. }
  2584. /****************** FormantGrid *********************************/
  2585. FORM (GRAPHICS_old_FormantGrid_draw, U"FormantGrid: Draw", nullptr) {
  2586. praat_TimeFunction_RANGE(fromTime,toTime)
  2587. REAL (fromFrequency, U"left Frequency range (Hz)", U"0.0")
  2588. REAL (toFrequency, U"right Frequency range (Hz)", U"0.0 (= auto)")
  2589. BOOLEAN (bandwidths, U"Bandwidths", false)
  2590. BOOLEAN (garnish, U"Garnish", true)
  2591. OK
  2592. DO
  2593. GRAPHICS_EACH (FormantGrid)
  2594. FormantGrid_draw (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, bandwidths, garnish, U"lines and speckles");
  2595. GRAPHICS_EACH_END
  2596. }
  2597. FORM (GRAPHICS_FormantGrid_draw, U"FormantGrid: Draw", nullptr) {
  2598. praat_TimeFunction_RANGE(fromTime,toTime)
  2599. REAL (fromFrequency, U"left Frequency range (Hz)", U"0.0")
  2600. REAL (toFrequency, U"right Frequency range (Hz)", U"0.0 (= auto)")
  2601. BOOLEAN (bandwidths, U"Bandwidths", false)
  2602. BOOLEAN (garnish, U"Garnish", true)
  2603. LABEL (U"")
  2604. OPTIONMENUSTR (drawingMethod, U"Drawing method", 1)
  2605. OPTION (U"lines")
  2606. OPTION (U"speckles")
  2607. OPTION (U"lines and speckles")
  2608. OK
  2609. DO_ALTERNATIVE (GRAPHICS_old_FormantGrid_draw)
  2610. GRAPHICS_EACH (FormantGrid)
  2611. FormantGrid_draw (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, bandwidths, garnish, drawingMethod);
  2612. GRAPHICS_EACH_END
  2613. }
  2614. /****************** FunctionTerms *********************************/
  2615. FORM (GRAPHICS_FunctionTerms_draw, U"FunctionTerms: Draw", nullptr) {
  2616. REAL (xmin, U"Xmin", U"0.0")
  2617. REAL (xmax, U"Xmax", U"0.0")
  2618. REAL (ymin, U"left Vertical range", U"0.0")
  2619. REAL (ymax, U"right Vertical range", U"0.0")
  2620. BOOLEAN (extrapolate, U"Extrapolate", false)
  2621. BOOLEAN (garnish, U"Garnish", true)
  2622. OK
  2623. DO
  2624. GRAPHICS_EACH (FunctionTerms)
  2625. FunctionTerms_draw (me, GRAPHICS, xmin, xmax, ymin, ymax,extrapolate, garnish);
  2626. GRAPHICS_EACH_END
  2627. }
  2628. FORM (GRAPHICS_FunctionTerms_drawBasisFunction, U"FunctionTerms: Draw basis function", nullptr) {
  2629. NATURAL (index, U"Index", U"1")
  2630. REAL (xmin, U"Xmin", U"0.0")
  2631. REAL (xmax, U"Xmax", U"0.0")
  2632. REAL (ymin, U"left Vertical range", U"0.0")
  2633. REAL (ymax, U"right Vertical range", U"0.0")
  2634. BOOLEAN (extrapolate, U"Extrapolate", false)
  2635. BOOLEAN (garnish, U"Garnish", true)
  2636. OK
  2637. DO
  2638. GRAPHICS_EACH (FunctionTerms)
  2639. FunctionTerms_drawBasisFunction (me, GRAPHICS, index, xmin, xmax, ymin, ymax, extrapolate, garnish);
  2640. GRAPHICS_EACH_END
  2641. }
  2642. FORM (REAL_FunctionTerms_getValue, U"FunctionTerms: Evaluate", nullptr) {
  2643. REAL (x, U"X", U"0.0")
  2644. OK
  2645. DO
  2646. NUMBER_ONE (FunctionTerms)
  2647. double result = FunctionTerms_evaluate (me, x);
  2648. NUMBER_ONE_END (U"")
  2649. }
  2650. DIRECT (INTEGER_FunctionTerms_getNumberOfCoefficients) {
  2651. INTEGER_ONE (FunctionTerms)
  2652. integer result = my numberOfCoefficients;
  2653. INTEGER_ONE_END (U"")
  2654. }
  2655. FORM (REAL_FunctionTerms_getCoefficient, U"FunctionTerms: Get coefficient", nullptr) {
  2656. LABEL (U"p(x) = c[1] + c[2] x + ... c[n+1] x^n")
  2657. NATURAL (index, U"Index", U"1")
  2658. OK
  2659. DO
  2660. NUMBER_ONE (FunctionTerms)
  2661. double result = ( index > 0 && index <= my numberOfCoefficients ? my coefficients [index] : undefined );
  2662. NUMBER_ONE_END (U"")
  2663. }
  2664. DIRECT (INTEGER_FunctionTerms_getDegree) {
  2665. INTEGER_ONE (FunctionTerms)
  2666. integer result = FunctionTerms_getDegree (me);
  2667. INTEGER_ONE_END (U"")
  2668. }
  2669. FORM (REAL_FunctionTerms_getMaximum, U"FunctionTerms: Get maximum", U"Polynomial: Get maximum...") {
  2670. LABEL (U"Interval")
  2671. REAL (xmin, U"Xmin", U"0.0")
  2672. REAL (xmax, U"Xmax", U"0.0")
  2673. OK
  2674. DO
  2675. NUMBER_ONE (FunctionTerms)
  2676. double result = FunctionTerms_getMaximum (me, xmin, xmax);
  2677. NUMBER_ONE_END (U" (maximum)")
  2678. }
  2679. FORM (REAL_FunctionTerms_getMinimum, U"FunctionTerms: Get minimum", U"Polynomial: Get minimum...") {
  2680. LABEL (U"Interval")
  2681. REAL (xmin, U"Xmin", U"0.0")
  2682. REAL (xmax, U"Xmax", U"0.0")
  2683. OK
  2684. DO
  2685. NUMBER_ONE (FunctionTerms)
  2686. double result = FunctionTerms_getMinimum (me, xmin, xmax);
  2687. NUMBER_ONE_END (U" (minimum)")
  2688. }
  2689. FORM (REAL_FunctionTerms_getXOfMaximum, U"FunctionTerms: Get x of maximum", U"Polynomial: Get x of maximum...") {
  2690. LABEL (U"Interval")
  2691. REAL (xmin, U"Xmin", U"0.0")
  2692. REAL (xmax, U"Xmax", U"0.0")
  2693. OK
  2694. DO
  2695. NUMBER_ONE (FunctionTerms)
  2696. double result = FunctionTerms_getXOfMaximum (me, xmin, xmax);
  2697. NUMBER_ONE_END (U" (x of maximum)")
  2698. }
  2699. FORM (REAL_FunctionTerms_getXOfMinimum, U"FunctionTerms: Get x of minimum", U"Polynomial: Get x of minimum...") {
  2700. LABEL (U"Interval")
  2701. REAL (xmin, U"Xmin", U"0.0")
  2702. REAL (xmax, U"Xmax", U"0.0")
  2703. OK
  2704. DO
  2705. NUMBER_ONE (FunctionTerms)
  2706. double result = FunctionTerms_getXOfMinimum (me, xmin, xmax);
  2707. NUMBER_ONE_END (U" (x of minimum)")
  2708. }
  2709. FORM (MODIFY_FunctionTerms_setCoefficient, U"FunctionTerms: Set coefficient", nullptr) {
  2710. LABEL (U"p(x) = c[1]F[0] + c[2]F[1] + ... c[n+1]F[n]")
  2711. LABEL (U"F[k] is of degree k")
  2712. NATURAL (index, U"Index", U"1")
  2713. REAL (value, U"Value", U"0.0")
  2714. OK
  2715. DO
  2716. MODIFY_EACH (FunctionTerms)
  2717. FunctionTerms_setCoefficient (me, index, value);
  2718. MODIFY_EACH_END
  2719. }
  2720. FORM (MODIFY_FunctionTerms_setDomain, U"FunctionTerms: Set domain", nullptr) {
  2721. REAL (xmin, U"Xmin", U"0.0")
  2722. REAL (xmax, U"Xmax", U"2.0")
  2723. OK
  2724. DO
  2725. MODIFY_EACH (FunctionTerms)
  2726. if (xmax <= xmin) {
  2727. Melder_throw (U"Xmax should be larger than Xmin.");
  2728. }
  2729. FunctionTerms_setDomain (me, xmin, xmax);
  2730. MODIFY_EACH_END
  2731. }
  2732. /***************** Intensity ***************************************************/
  2733. FORM (NEW_Intensity_to_TextGrid_silences, U"Intensity: To TextGrid (silences)", U"Intensity: To TextGrid (silences)...") {
  2734. REAL (silenceThreshold, U"Silence threshold (dB)", U"-25.0")
  2735. POSITIVE (minimumSilenceDuration, U"Minimum silent interval duration (s)", U"0.1")
  2736. POSITIVE (minimumSoundingDuration, U"Minimum sounding interval duration (s)", U"0.05")
  2737. WORD (silenceLabel, U"Silent interval label", U"silent")
  2738. WORD (soundingLabel, U"Sounding interval label", U"sounding")
  2739. OK
  2740. DO
  2741. CONVERT_EACH (Intensity)
  2742. autoTextGrid result = Intensity_to_TextGrid_detectSilences (me, silenceThreshold, minimumSilenceDuration, minimumSoundingDuration, silenceLabel, soundingLabel);
  2743. CONVERT_EACH_END (my name.get())
  2744. }
  2745. /***************** IntensityTier ***************************************************/
  2746. FORM (NEW_IntensityTier_to_TextGrid_silences, U"IntensityTier: To TextGrid (silences)", U"Intensity: To TextGrid (silences)...") {
  2747. REAL (silenceThreshold, U"Silence threshold (dB)", U"-25.0")
  2748. POSITIVE (minimumSilenceDuration, U"Minimum silent interval duration (s)", U"0.1")
  2749. POSITIVE (minimumSoundingDuration, U"Minimum sounding interval duration (s)", U"0.05")
  2750. WORD (silenceLabel, U"Silent interval label", U"silent")
  2751. WORD (soundingLabel, U"Sounding interval label", U"sounding")
  2752. POSITIVE (timeStep, U"Time step (s)", U"0.001")
  2753. OK
  2754. DO
  2755. CONVERT_EACH (IntensityTier)
  2756. autoTextGrid result = IntensityTier_to_TextGrid_detectSilences (me, timeStep, silenceThreshold, minimumSilenceDuration, minimumSoundingDuration, silenceLabel, soundingLabel);
  2757. CONVERT_EACH_END (my name.get())
  2758. }
  2759. FORM (NEW_IntensityTier_to_Intensity, U"", nullptr) {
  2760. POSITIVE (timeStep, U"Time step (s)", U"0.001")
  2761. OK
  2762. DO
  2763. CONVERT_EACH (IntensityTier)
  2764. autoIntensity result = IntensityTier_to_Intensity (me, timeStep);
  2765. CONVERT_EACH_END (my name.get())
  2766. }
  2767. /***************** ISpline ***************************************************/
  2768. DIRECT (HELP_ISpline_help) {
  2769. HELP (U"ISpline")
  2770. }
  2771. FORM (NEW1_ISpline_create, U"Create ISpline", U"Create ISpline...") {
  2772. WORD (name, U"Name", U"ispline")
  2773. LABEL (U"Domain")
  2774. REAL (xmin, U"Xmin", U"0")
  2775. REAL (xmax, U"Xmax", U"1")
  2776. LABEL (U"ISpline(x) = c[1] I[1](x) + c[2] I[1](x) + ... c[n] I[n](x)")
  2777. LABEL (U"all I[k] are polynomials of degree \"Degree\"")
  2778. LABEL (U"Relation: numberOfCoefficients == numberOfInteriorKnots + degree")
  2779. INTEGER (degree, U"Degree", U"3")
  2780. SENTENCE (coefficients_string, U"Coefficients (c[k])", U"1.2 2.0 1.2 1.2 3.0 0.0")
  2781. SENTENCE (knots_string, U"Interior knots" , U"0.3 0.5 0.6")
  2782. OK
  2783. DO
  2784. CREATE_ONE
  2785. if (xmax <= xmin) {
  2786. Melder_throw (U"Xmin should be smaller than Xmax.");
  2787. }
  2788. autoISpline result = ISpline_createFromStrings (xmin, xmax, degree, coefficients_string, knots_string);
  2789. CREATE_ONE_END (name)
  2790. }
  2791. /******************* KlattTable *********************************/
  2792. DIRECT (HELP_KlattTable_help) {
  2793. HELP (U"KlattTable")
  2794. }
  2795. DIRECT (NEW1_KlattTable_createExample) {
  2796. CREATE_ONE
  2797. autoKlattTable result = KlattTable_createExample ();
  2798. CREATE_ONE_END (U"example")
  2799. }
  2800. FORM (NEW_KlattTable_to_Sound, U"KlattTable: To Sound", U"KlattTable: To Sound...") {
  2801. POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"16000")
  2802. RADIO (synthesisModel, U"Synthesis model", 1)
  2803. RADIOBUTTON (U"Cascade")
  2804. RADIOBUTTON (U"Parallel")
  2805. NATURAL (numberOfFormants, U"Number of formants", U"5")
  2806. POSITIVE (frameDuration, U"Frame duration (s)", U"0.005")
  2807. REAL (flutter_percentage, U"Flutter percentage (%)", U"0.0") // ppgb: foutgevoelig
  2808. OPTIONMENU (voicingSource, U"Voicing source", 1)
  2809. OPTION (U"Impulsive")
  2810. OPTION (U"Natural")
  2811. OPTIONMENU (soundOutputType, U"Output type", 1)
  2812. OPTION (U"Sound")
  2813. OPTION (U"Voicing")
  2814. OPTION (U"Aspiration")
  2815. OPTION (U"Frication")
  2816. OPTION (U"Cascade-glottal-output")
  2817. OPTION (U"Parallel-glottal-output")
  2818. OPTION (U"Bypass-output")
  2819. OPTION (U"All-excitations")
  2820. OK
  2821. DO
  2822. if (flutter_percentage < 0.0 || flutter_percentage > 100.0) {
  2823. Melder_throw (U"Flutter should be between 0 and 100%.");
  2824. }
  2825. CONVERT_EACH (KlattTable)
  2826. autoSound result = KlattTable_to_Sound (me, samplingFrequency, synthesisModel, numberOfFormants, frameDuration, voicingSource, flutter_percentage, soundOutputType);
  2827. CONVERT_EACH_END (my name.get())
  2828. }
  2829. FORM (NEW_KlattTable_to_KlattGrid, U"KlattTable: To KlattGrid", nullptr) {
  2830. POSITIVE (frameDuration, U"Frame duration (s)", U"0.002")
  2831. OK
  2832. DO
  2833. CONVERT_EACH (KlattTable)
  2834. autoKlattGrid result = KlattTable_to_KlattGrid (me, frameDuration);
  2835. CONVERT_EACH_END (my name.get())
  2836. }
  2837. DIRECT (NEW_KlattTable_to_Table) {
  2838. CONVERT_EACH (KlattTable)
  2839. autoTable result = KlattTable_to_Table (me);
  2840. CONVERT_EACH_END (my name.get())
  2841. }
  2842. DIRECT (NEW_Table_to_KlattTable) {
  2843. CONVERT_EACH (Table)
  2844. autoKlattTable result = Table_to_KlattTable (me);
  2845. CONVERT_EACH_END (my name.get())
  2846. }
  2847. FORM (REAL_Table_getMedianAbsoluteDeviation, U"Table: Get median absolute deviation", U"Table: Get median absolute deviation...") {
  2848. SENTENCE (columnLabel, U"Column label", U"")
  2849. OK
  2850. DO
  2851. NUMBER_ONE (Table)
  2852. integer icol = Table_getColumnIndexFromColumnLabel (me, columnLabel);
  2853. double result = Table_getMedianAbsoluteDeviation (me, icol);
  2854. NUMBER_ONE_END (U"")
  2855. }
  2856. static void print_means (Table me);
  2857. static void print_means (Table me) {
  2858. Table_numericize_Assert (me, 2);
  2859. Table_numericize_Assert (me, 3);
  2860. if (my numberOfColumns < 3) {
  2861. MelderInfo_writeLine (U"Table does not have the right format.");
  2862. return;
  2863. }
  2864. MelderInfo_writeLine (
  2865. Melder_padOrTruncate (15, my columnHeaders[1]. label.get()), U"\t",
  2866. Melder_padOrTruncate (15, my columnHeaders[2]. label.get()), U"\t",
  2867. Melder_padOrTruncate (15, my columnHeaders[3]. label.get()));
  2868. for (integer irow = 1; irow <= my rows.size; irow ++) {
  2869. TableRow row = my rows.at [irow];
  2870. MelderInfo_writeLine (
  2871. Melder_padOrTruncate (15, row -> cells[1]. string.get()), U"\t",
  2872. Melder_padOrTruncate (15, Melder_double (row -> cells[2]. number)), U"\t",
  2873. Melder_padOrTruncate (15, Melder_double (row -> cells[3]. number)));
  2874. }
  2875. }
  2876. FORM (INTEGER_Table_getNumberOfRowsWhere, U"", nullptr) {
  2877. TEXTFIELD (formula, U"Count only rows where the following condition holds:", U"1; self$[\"gender\"]=\"M\"")
  2878. OK
  2879. DO
  2880. INTEGER_ONE (Table)
  2881. integer result = Table_getNumberOfRowsWhere (me, formula, interpreter);
  2882. INTEGER_ONE_END (U"")
  2883. }
  2884. FORM (INFO_Table_reportOneWayAnova, U"Table: Report one-way anova", U"Table: Report one-way anova...") {
  2885. SENTENCE (dataColumn_string, U"Column with data", U"F0")
  2886. SENTENCE (factor_string, U"Factor", U"Vowel")
  2887. BOOLEAN (wantMeans, U"Table with means", false);
  2888. BOOLEAN (wantDifferencesBetweenMeans, U"Table with differences between means", false)
  2889. BOOLEAN (wantTukeyPostHoc, U"Table with Tukey's post-hoc HSD test", false)
  2890. OK
  2891. DO
  2892. INFO_ONE (Table)
  2893. integer factorColumn = Table_getColumnIndexFromColumnLabel (me, factor_string);
  2894. integer dataColumn = Table_getColumnIndexFromColumnLabel (me, dataColumn_string);
  2895. autoTable means, meansDiff, meansDiffProbabilities;
  2896. autoTable anova = Table_getOneWayAnalysisOfVarianceF (me, dataColumn, factorColumn, &means, &meansDiff, & meansDiffProbabilities);
  2897. MelderInfo_open ();
  2898. MelderInfo_writeLine (U"One-way analysis of \"", dataColumn_string, U"\" by \"", factor_string, U"\".\n");
  2899. Table_printAsAnovaTable (anova.get());
  2900. MelderInfo_writeLine (U"\nMeans:\n");
  2901. print_means (means.get());
  2902. MelderInfo_close ();
  2903. if (wantMeans) {
  2904. praat_new (means.move(), my name.get(), U"_groupMeans");
  2905. }
  2906. if (wantDifferencesBetweenMeans) {
  2907. praat_new (meansDiff.move(), my name.get(), U"_meansDiff");
  2908. }
  2909. if (wantTukeyPostHoc) {
  2910. praat_new (meansDiffProbabilities.move(), my name.get(), U"_meansDiffP");
  2911. }
  2912. INFO_ONE_END
  2913. }
  2914. FORM (INFO_Table_reportTwoWayAnova, U"Table: Report two-way anova", U"Table: Report two-way anova...") {
  2915. SENTENCE (dataColumn_string, U"Column with data", U"Data")
  2916. SENTENCE (firstFactor_string, U"First factor", U"A")
  2917. SENTENCE (secondFactor_string, U"Second factor", U"B")
  2918. BOOLEAN (wantMeans, U"Table with means", false);
  2919. OK
  2920. DO
  2921. INFO_ONE (Table)
  2922. integer firstFactorColumn = Table_getColumnIndexFromColumnLabel (me, firstFactor_string);
  2923. integer secondFactorColumn = Table_getColumnIndexFromColumnLabel (me, secondFactor_string);
  2924. integer dataColumn = Table_getColumnIndexFromColumnLabel (me, dataColumn_string);
  2925. autoTable means, sizes;
  2926. autoTable anova = Table_getTwoWayAnalysisOfVarianceF (me, dataColumn, firstFactorColumn, secondFactorColumn, &means, &sizes);
  2927. MelderInfo_open ();
  2928. MelderInfo_writeLine (U"Two-way analysis of \"", dataColumn_string, U"\" by \"", firstFactor_string, U"\" and \"", secondFactor_string, U".\n");
  2929. Table_printAsAnovaTable (anova.get());
  2930. MelderInfo_writeLine (U"\nMeans:\n");
  2931. Table_printAsMeansTable (means.get());
  2932. MelderInfo_writeLine (U"\nCell sizes:\n");
  2933. Table_printAsMeansTable (sizes.get());
  2934. MelderInfo_close ();
  2935. if (wantMeans) {
  2936. praat_new (means.move(), my name.get(), U"_groupMeans");
  2937. }
  2938. INFO_ONE_END
  2939. }
  2940. FORM (INFO_Table_reportOneWayKruskalWallis, U"Table: Report one-way Kruskal-Wallis", U"Table: Report one-way Kruskal-Wallis...") {
  2941. SENTENCE (dataColumn_string, U"Column with data", U"Data")
  2942. SENTENCE (factor_string, U"Factor", U"Group")
  2943. OK
  2944. DO
  2945. INFO_ONE (Table)
  2946. integer factorColumn = Table_getColumnIndexFromColumnLabel (me, factor_string);
  2947. integer dataColumn = Table_getColumnIndexFromColumnLabel (me, dataColumn_string);
  2948. double df, kruskalWallis, prob;
  2949. autoTable result = Table_getOneWayKruskalWallis (me, dataColumn, factorColumn, & prob, & kruskalWallis, & df);
  2950. MelderInfo_open ();
  2951. MelderInfo_writeLine (U"One-way Kruskal-Wallis of \"", dataColumn_string, U"\" by \"", factor_string, U"\".\n");
  2952. MelderInfo_writeLine (U"Chi squared: ", kruskalWallis);
  2953. MelderInfo_writeLine (U"Degrees of freedom: ", df);
  2954. MelderInfo_writeLine (U"Probability: ", prob);
  2955. MelderInfo_writeLine (U"\nMeans:\n");
  2956. print_means (result.get());
  2957. MelderInfo_close ();
  2958. INFO_ONE_END
  2959. }
  2960. FORM (NEW_Table_to_StringsIndex_column, U"Table: To StringsIndex (column)", nullptr) {
  2961. SENTENCE (columnLabel, U"Column label", U"")
  2962. OK
  2963. DO
  2964. CONVERT_EACH (Table)
  2965. integer icol = Table_getColumnIndexFromColumnLabel (me, columnLabel);
  2966. autoStringsIndex result = Table_to_StringsIndex_column (me, icol);
  2967. CONVERT_EACH_END (my name.get(), U"_", columnLabel)
  2968. }
  2969. /******************* LegendreSeries *********************************/
  2970. FORM (NEW1_LegendreSeries_create, U"Create LegendreSeries", U"Create LegendreSeries...") {
  2971. WORD (name, U"Name", U"ls")
  2972. LABEL (U"Domain")
  2973. REAL (xmin, U"Xmin", U"-1")
  2974. REAL (xmax, U"Xmax", U"1")
  2975. LABEL (U"LegendreSeries(x) = c[1] P[0](x) + c[2] P[1](x) + ... c[n+1] P[n](x)")
  2976. LABEL (U"P[k] is a Legendre polynomial of degree k")
  2977. SENTENCE (coefficients_string, U"Coefficients", U"0 0 1.0")
  2978. OK
  2979. DO
  2980. Melder_require (xmin < xmax, U"Xmin should be smaller than Xmax.");
  2981. CREATE_ONE
  2982. autoLegendreSeries result = LegendreSeries_createFromString (xmin, xmax, coefficients_string);
  2983. CREATE_ONE_END (name)
  2984. }
  2985. DIRECT (HELP_LegendreSeries_help) {
  2986. HELP (U"LegendreSeries")
  2987. }
  2988. DIRECT (NEW_LegendreSeries_to_Polynomial) {
  2989. CONVERT_EACH (LegendreSeries)
  2990. autoPolynomial result = LegendreSeries_to_Polynomial (me);
  2991. CONVERT_EACH_END (my name.get())
  2992. }
  2993. /********************* LongSound **************************************/
  2994. FORM_READ (READ1_LongSounds_appendToExistingSoundFile, U"LongSound: Append to existing sound file", 0, false) {
  2995. OrderedOf<structSampled> list;
  2996. LOOP {
  2997. iam (Sampled);
  2998. list. addItem_ref (me);
  2999. }
  3000. LongSounds_appendToExistingSoundFile (& list, file);
  3001. END }
  3002. FORM_SAVE (SAVE_LongSounds_saveAsStereoAIFFFile, U"LongSound: Save as AIFF file", 0, U"aiff") {
  3003. FIND_COUPLE (LongSound)
  3004. LongSounds_writeToStereoAudioFile16 (me, you, Melder_AIFF, file);
  3005. END
  3006. }
  3007. FORM_SAVE (SAVE_LongSounds_saveAsStereoAIFCFile, U"LongSound: Save as AIFC file", 0, U"aifc") {
  3008. FIND_COUPLE (LongSound)
  3009. LongSounds_writeToStereoAudioFile16 (me, you, Melder_AIFC, file);
  3010. END
  3011. }
  3012. FORM_SAVE (SAVE_LongSounds_saveAsStereoWAVFile, U"LongSound: Save as WAV file", 0, U"wav") {
  3013. FIND_COUPLE (LongSound)
  3014. LongSounds_writeToStereoAudioFile16 (me, you, Melder_WAV, file);
  3015. END
  3016. }
  3017. FORM_SAVE (SAVE_LongSounds_saveAsStereoNeXtSunFile, U"LongSound: Save as NeXT/Sun file", 0, U"au") {
  3018. FIND_COUPLE (LongSound)
  3019. LongSounds_writeToStereoAudioFile16 (me, you, Melder_NEXT_SUN, file);
  3020. END
  3021. }
  3022. FORM_SAVE (SAVE_LongSounds_saveAsStereoNISTFile, U"LongSound: Save as NIST file", 0, U"nist") {
  3023. FIND_COUPLE (LongSound)
  3024. LongSounds_writeToStereoAudioFile16 (me, you, Melder_NIST, file);
  3025. END
  3026. }
  3027. /******************* Matrix **************************************************/
  3028. FORM (GRAPHICS_Matrix_drawAsSquares, U"Matrix: Draw as squares", U"Matrix: Draw as squares...") {
  3029. REAL (xmin, U"left Horizontal range", U"0.0")
  3030. REAL (xmax, U"right Horizontal range", U"0.0")
  3031. REAL (ymin, U"left Vertical range", U"0.0")
  3032. REAL (ymax, U"right Vertical range", U"0.0")
  3033. BOOLEAN (garnish, U"Garnish", true)
  3034. OK
  3035. DO
  3036. GRAPHICS_EACH (Matrix)
  3037. Matrix_drawAsSquares (me, GRAPHICS, xmin, xmax, ymin, ymax, garnish);
  3038. GRAPHICS_EACH_END
  3039. }
  3040. FORM (GRAPHICS_Matrix_drawDistribution, U"Matrix: Draw distribution", U"Matrix: Draw distribution...") {
  3041. LABEL (U"Selection of (part of) Matrix")
  3042. REAL (xmin, U"left Horizontal range", U"0.0")
  3043. REAL (xmax, U"right Horizontal range", U"0.0")
  3044. REAL (ymin, U"left Vertical range", U"0.0")
  3045. REAL (ymax, U"right Vertical range", U"0.0")
  3046. LABEL (U"Selection of Matrix values")
  3047. REAL (minimumValue, U"Minimum value", U"0.0")
  3048. REAL (maximumValue, U"Maximum value", U"0.0")
  3049. LABEL (U"Display of the distribution")
  3050. NATURAL (numberOfBins, U"Number of bins", U"10")
  3051. REAL (minimumFrequency, U"Minimum frequency", U"0.0")
  3052. REAL (maximumFrequency, U"Maximum frequency", U"0.0")
  3053. BOOLEAN (garnish, U"Garnish", true)
  3054. OK
  3055. DO
  3056. GRAPHICS_EACH (Matrix)
  3057. Matrix_drawDistribution (me, GRAPHICS, xmin, xmax, ymin, ymax, minimumValue, maximumValue, numberOfBins, minimumFrequency, maximumFrequency, false, garnish);
  3058. GRAPHICS_EACH_END
  3059. }
  3060. FORM (GRAPHICS_Matrix_drawCumulativeDistribution, U"Matrix: Draw cumulative distribution", nullptr) {
  3061. LABEL (U"Selection of (part of) Matrix")
  3062. REAL (xmin, U"left Horizontal range", U"0.0")
  3063. REAL (xmax, U"right Horizontal range", U"0.0")
  3064. REAL (ymin, U"left Vertical range", U"0.0")
  3065. REAL (ymax, U"right Vertical range", U"0.0")
  3066. LABEL (U"Selection of Matrix values")
  3067. REAL (minimumValue, U"Minimum value", U"0.0")
  3068. REAL (maximumValue, U"Maximum value", U"0.0")
  3069. LABEL (U"Display of the distribution")
  3070. NATURAL (numberOfBins, U"Number of bins", U"10")
  3071. REAL (minimum, U"Minimum", U"0.0")
  3072. REAL (maximum, U"Maximum", U"0.0")
  3073. BOOLEAN (garnish, U"Garnish", true)
  3074. OK
  3075. DO
  3076. GRAPHICS_EACH (Matrix)
  3077. Matrix_drawDistribution (me, GRAPHICS, xmin, xmax, ymin, ymax, minimumValue, maximumValue, numberOfBins, minimum, maximum, true, garnish);
  3078. GRAPHICS_EACH_END
  3079. }
  3080. FORM (REAL_Matrix_getMean, U"Matrix: Get mean", nullptr) {
  3081. REAL (xmin, U"left Horizontal range", U"0.0")
  3082. REAL (xmax, U"right Horizontal range", U"0.0")
  3083. REAL (ymin, U"left Vertical range", U"0.0")
  3084. REAL (ymax, U"right Vertical range", U"0.0")
  3085. OK
  3086. DO
  3087. NUMBER_ONE (Matrix)
  3088. double result = Matrix_getMean (me, xmin, xmax, ymin, ymax);
  3089. NUMBER_ONE_END (U" (mean)")
  3090. }
  3091. FORM (REAL_Matrix_getStandardDeviation, U"Matrix: Get standard deviation", nullptr) {
  3092. REAL (xmin, U"left Horizontal range", U"0.0")
  3093. REAL (xmax, U"right Horizontal range", U"0.0")
  3094. REAL (ymin, U"left Vertical range", U"0.0")
  3095. REAL (ymax, U"right Vertical range", U"0.0")
  3096. OK
  3097. DO
  3098. NUMBER_ONE (Matrix)
  3099. double result = Matrix_getStandardDeviation (me, xmin, xmax, ymin, ymax);
  3100. NUMBER_ONE_END (U" (std dev)")
  3101. }
  3102. FORM (MODIFY_Matrix_scale, U"Matrix: Scale", nullptr) {
  3103. LABEL (U"self[row, col] := self[row, col] / `Scale factor'")
  3104. RADIO (scaleMethod, U"Scale factor", 1)
  3105. RADIOBUTTON (U"Extremum in matrix")
  3106. RADIOBUTTON (U"Extremum in each row")
  3107. RADIOBUTTON (U"Extremum in each column")
  3108. OK
  3109. DO
  3110. MODIFY_EACH (Matrix)
  3111. Matrix_scale (me, scaleMethod);
  3112. MODIFY_EACH_END
  3113. }
  3114. DIRECT (NEW_Matrix_transpose) {
  3115. CONVERT_EACH (Matrix)
  3116. autoMatrix result = Matrix_transpose (me);
  3117. CONVERT_EACH_END (my name.get(), U"_transposed")
  3118. }
  3119. DIRECT (NEW_Matrix_to_PCA_byColumns) {
  3120. CONVERT_EACH (Matrix)
  3121. autoPCA result = Matrix_to_PCA_byColumns (me);
  3122. CONVERT_EACH_END (my name.get(), U"_columns");
  3123. }
  3124. DIRECT (NEW_Matrix_to_PCA_byRows) {
  3125. CONVERT_EACH (Matrix)
  3126. autoPCA result = Matrix_to_PCA_byRows (me);
  3127. CONVERT_EACH_END (my name.get(), U"_rows")
  3128. }
  3129. FORM (NEW_Matrix_solveEquation, U"Matrix: Solve equation", U"Matrix: Solve equation...") {
  3130. REAL (tolerance, U"Tolerance", U"1.19e-7")
  3131. OK
  3132. DO
  3133. CONVERT_EACH (Matrix)
  3134. autoMatrix result = Matrix_solveEquation (me, tolerance);
  3135. CONVERT_EACH_END (my name.get(), U"_solution")
  3136. }
  3137. DIRECT (NEW1_Matrix_Categories_to_TableOfReal) {
  3138. CONVERT_ONE_AND_GENERIC (Categories, Matrix)
  3139. autoTableOfReal result = Matrix_Categories_to_TableOfReal (you, me);
  3140. CONVERT_ONE_AND_GENERIC_END (my name.get(), U"_", your name.get())
  3141. }
  3142. DIRECT (NEW1_ActivationList_Categories_to_TableOfReal) {
  3143. CONVERT_TWO (ActivationList, Categories)
  3144. autoTableOfReal result = Matrix_Categories_to_TableOfReal (me, you);
  3145. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  3146. }
  3147. FORM (GRAPHICS_Matrix_scatterPlot, U"Matrix: Scatter plot", nullptr) {
  3148. NATURAL (xColumn, U"Column for X-axis", U"1")
  3149. NATURAL (yColumn, U"Column for Y-axis", U"2")
  3150. REAL (xmin, U"left Horizontal range", U"0.0")
  3151. REAL (xmax, U"right Horizontal range", U"0.0")
  3152. REAL (ymin, U"left Vertical range", U"0.0")
  3153. REAL (ymax, U"right Vertical range", U"0.0")
  3154. POSITIVE (markSize_mm, U"Mark size (mm)", U"1.0")
  3155. SENTENCE (mark_string, U"Mark string (+xo.)", U"+")
  3156. BOOLEAN (garnish, U"Garnish", true)
  3157. OK
  3158. DO
  3159. GRAPHICS_EACH (Matrix)
  3160. Matrix_scatterPlot (me, GRAPHICS, xColumn, yColumn, xmin, xmax, ymin, ymax, markSize_mm, mark_string, garnish);
  3161. GRAPHICS_EACH_END
  3162. }
  3163. DIRECT (NEW_Matrix_to_ActivationList) {
  3164. CONVERT_EACH (Matrix)
  3165. autoActivationList result = Matrix_to_ActivationList (me);
  3166. CONVERT_EACH_END (my name.get())
  3167. }
  3168. DIRECT (NEW_Matrix_to_Eigen) {
  3169. CONVERT_EACH (Matrix)
  3170. autoEigen result = Matrix_to_Eigen (me);
  3171. CONVERT_EACH_END (my name.get())
  3172. }
  3173. DIRECT (NEWTIMES2_Matrix_eigen_complex) {
  3174. LOOP {
  3175. iam_LOOP (Matrix);
  3176. autoMatrix vectors, values;
  3177. Matrix_Eigen_complex (me, & vectors, & values);
  3178. praat_new (vectors.move(), U"eigenvectors");
  3179. praat_new (values.move(), U"eigenvalues");
  3180. }
  3181. END }
  3182. FORM (NEW1_Matrices_to_DTW, U"Matrices: To DTW", U"Matrix: To DTW...") {
  3183. LABEL (U"Distance between cepstral coefficients")
  3184. REAL (distanceMetric, U"Distance metric", U"2.0")
  3185. DTW_constraints_addCommonFields (matchStart, matchEnd, slopeConstraint)
  3186. OK
  3187. DO
  3188. CONVERT_COUPLE (Matrix)
  3189. autoDTW result = Matrices_to_DTW (me, you, matchStart, matchEnd, slopeConstraint, distanceMetric);
  3190. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  3191. }
  3192. FORM (NEW_Matrix_to_PatternList, U"Matrix: To PatternList", nullptr) {
  3193. NATURAL (join, U"Join", U"1")
  3194. OK
  3195. DO
  3196. CONVERT_EACH (Matrix)
  3197. autoPatternList result = Matrix_to_PatternList (me, join);
  3198. CONVERT_EACH_END (my name.get())
  3199. }
  3200. /**** Filterbank (deprecated) *******/
  3201. DIRECT (REAL_FilterBank_getHighestFrequency) {
  3202. NUMBER_ONE (FilterBank)
  3203. double result = my ymax;
  3204. NUMBER_ONE_END (U" ", my v_getFrequencyUnit ())
  3205. }
  3206. DIRECT (REAL_FilterBank_getLowestFrequency) {
  3207. NUMBER_ONE (FilterBank)
  3208. double result = my ymin;
  3209. NUMBER_ONE_END (U" ", my v_getFrequencyUnit ())
  3210. }
  3211. DIRECT (INTEGER_FilterBank_getNumberOfFrequencies) {
  3212. INTEGER_ONE (FilterBank)
  3213. integer result = my ny;
  3214. INTEGER_ONE_END (U"")
  3215. }
  3216. DIRECT (REAL_FilterBank_getFrequencyDistance) {
  3217. NUMBER_ONE (FilterBank)
  3218. double result = my dy;
  3219. NUMBER_ONE_END (U" ", my v_getFrequencyUnit ())
  3220. }
  3221. FORM (REAL_FilterBank_getTimeFromColumn, U"Get time of column", nullptr) {
  3222. NATURAL (columnNumber, U"Column number", U"1")
  3223. OK
  3224. DO
  3225. NUMBER_ONE (FilterBank)
  3226. double result = Matrix_columnToX (me, columnNumber);
  3227. NUMBER_ONE_END (U"")
  3228. }
  3229. FORM (REAL_FilterBank_getFrequencyFromRow, U"Get frequency of row", nullptr) {
  3230. NATURAL (rowNumber, U"Row number", U"1")
  3231. OK
  3232. DO
  3233. NUMBER_ONE (FilterBank)
  3234. double result = Matrix_rowToY (me, rowNumber);
  3235. NUMBER_ONE_END (U" ", my v_getFrequencyUnit ())
  3236. }
  3237. FORM (REAL_FilterBank_getValueInCell, U"Get value in cell", nullptr) {
  3238. REAL (time, U"Time (s)", U"0.5")
  3239. POSITIVE (frequency, U"Frequency", U"1.0")
  3240. OK
  3241. DO
  3242. NUMBER_ONE (FilterBank)
  3243. double result = undefined;
  3244. if ((frequency >= my ymin && frequency <= my ymax) && (time >+ my xmin && time <= my ymin)) {
  3245. integer col = Matrix_xToNearestColumn (me, time);
  3246. if (col < 1) {
  3247. col = 1;
  3248. }
  3249. if (col > my nx) {
  3250. col = my nx;
  3251. }
  3252. integer row = Matrix_yToNearestRow (me, frequency);
  3253. if (row < 1) {
  3254. row = 1;
  3255. }
  3256. if (row > my ny) {
  3257. row = my ny;
  3258. }
  3259. result = my z[row][col];
  3260. }
  3261. NUMBER_ONE_END (U"")
  3262. }
  3263. /***** MATRIXFT *************/
  3264. DIRECT (REAL_BandFilterSpectrogram_getHighestFrequency) {
  3265. NUMBER_ONE (BandFilterSpectrogram)
  3266. double result = my ymax;
  3267. NUMBER_ONE_END (U" ", my v_getFrequencyUnit ())
  3268. }
  3269. DIRECT (REAL_BandFilterSpectrogram_getLowestFrequency) {
  3270. NUMBER_ONE (BandFilterSpectrogram)
  3271. double result = my ymin;
  3272. NUMBER_ONE_END (U" ", my v_getFrequencyUnit ())
  3273. }
  3274. DIRECT (INTEGER_BandFilterSpectrogram_getNumberOfFrequencies) {
  3275. INTEGER_ONE (BandFilterSpectrogram)
  3276. integer result = my ny;
  3277. INTEGER_ONE_END (U"")
  3278. }
  3279. DIRECT (REAL_BandFilterSpectrogram_getFrequencyDistance) {
  3280. NUMBER_ONE (BandFilterSpectrogram)
  3281. double result = my dy;
  3282. NUMBER_ONE_END (U" ", my v_getFrequencyUnit ())
  3283. }
  3284. FORM (REAL_BandFilterSpectrogram_getFrequencyFromRow, U"Get frequency of row", nullptr) {
  3285. NATURAL (rowNumber, U"Row number", U"1")
  3286. OK
  3287. DO
  3288. NUMBER_ONE (BandFilterSpectrogram)
  3289. double result = Matrix_rowToY (me, rowNumber);
  3290. NUMBER_ONE_END (U" ", my v_getFrequencyUnit ())
  3291. }
  3292. FORM (REAL_BandFilterSpectrogram_getTimeFromColumn, U"Get time of column", nullptr) {
  3293. NATURAL (columnNumber, U"Column number", U"1")
  3294. OK
  3295. DO
  3296. NUMBER_ONE (BandFilterSpectrogram)
  3297. double result = Matrix_columnToX (me, columnNumber);
  3298. NUMBER_ONE_END (U" s")
  3299. }
  3300. FORM (REAL_BandFilterSpectrogram_getValueInCell, U"Get value in cell", nullptr) {
  3301. REAL (time, U"Time (s)", U"0.5")
  3302. POSITIVE (frequency, U"Frequency", U"1")
  3303. OK
  3304. DO
  3305. NUMBER_ONE (BandFilterSpectrogram)
  3306. double result = undefined;
  3307. if ((frequency >= my ymin && frequency <= my ymax) && (time >+ my xmin && time <= my ymin)) {
  3308. integer col = Matrix_xToNearestColumn (me, time);
  3309. if (col < 1) {
  3310. col = 1;
  3311. }
  3312. if (col > my nx) {
  3313. col = my nx;
  3314. }
  3315. integer row = Matrix_yToNearestRow (me, frequency);
  3316. if (row < 1) {
  3317. row = 1;
  3318. }
  3319. if (row > my ny) {
  3320. row = my ny;
  3321. }
  3322. result = my z[row][col];
  3323. }
  3324. NUMBER_ONE_END (U"")
  3325. }
  3326. /**************** MelFilter *******************************************/
  3327. DIRECT (HELP_MelFilter_help) {
  3328. HELP (U"MelFilter")
  3329. }
  3330. DIRECT (HELP_MelSpectrogram_help) {
  3331. HELP (U"MelSpectrogram")
  3332. }
  3333. FORM (GRAPHICS_MelFilter_drawFilterFunctions, U"MelFilter: Draw filter functions", U"FilterBank: Draw filter functions...") {
  3334. INTEGER (fromFilter, U"left Filter range", U"0")
  3335. INTEGER (toFilter, U"right Filter range", U"0")
  3336. RADIO (frequencyScale, U"Frequency scale", 1)
  3337. RADIOBUTTON (U"Hertz")
  3338. RADIOBUTTON (U"Bark")
  3339. RADIOBUTTON (U"Mel")
  3340. REAL (fromFrequency, U"left Frequency range", U"0.0")
  3341. REAL (toFrequency, U"right Frequency range", U"0.0")
  3342. BOOLEAN (dBScale, U"Amplitude scale in dB", false)
  3343. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  3344. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  3345. BOOLEAN (garnish, U"Garnish", true)
  3346. OK
  3347. DO
  3348. GRAPHICS_EACH (MelFilter)
  3349. MelFilter_drawFilterFunctions (me, GRAPHICS, frequencyScale, fromFilter, toFilter, fromFrequency, toFrequency, dBScale, fromAmplitude, toAmplitude, garnish);
  3350. GRAPHICS_EACH_END
  3351. }
  3352. FORM (GRAPHICS_MelSpectrogram_drawTriangularFilterFunctions, U"MelSpectrogram: Draw triangulat filter functions", U"MelSpectrogram: Draw filter functions...") {
  3353. INTEGER (fromFilter, U"left Filter range", U"0")
  3354. INTEGER (toFilter, U"right Filter range", U"0")
  3355. RADIO (frequencyScale, U"Frequency scale", 1)
  3356. RADIOBUTTON (U"Mel")
  3357. RADIOBUTTON (U"Hertz")
  3358. REAL (fromFrequency, U"left Frequency range", U"0.0")
  3359. REAL (toFrequency, U"right Frequency range", U"0.0")
  3360. BOOLEAN (dBScale, U"Amplitude scale in dB", false)
  3361. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  3362. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  3363. BOOLEAN (garnish, U"Garnish", true)
  3364. OK
  3365. DO
  3366. GRAPHICS_EACH (MelSpectrogram)
  3367. MelSpectrogram_drawTriangularFilterFunctions (me, GRAPHICS, frequencyScale - 1, fromFilter, toFilter, fromFrequency, toFrequency, dBScale, fromAmplitude, toAmplitude, garnish);
  3368. GRAPHICS_EACH_END
  3369. }
  3370. FORM (GRAPHICS_MelFilter_drawSpectrum, U"MelFilter: Draw spectrum (slice)", U"FilterBank: Draw spectrum (slice)...") {
  3371. REAL (time, U"Time (s)", U"0.1")
  3372. REAL (fromFrequency, U"left Frequency range (mel)", U"0.0")
  3373. REAL (toFrequency, U"right Frequency range (mel)", U"0.0")
  3374. REAL (fromAmplitude, U"left Amplitude range (dB)", U"0.0")
  3375. REAL (toAmplitude, U"right Amplitude range (dB)", U"0.0")
  3376. BOOLEAN (garnish, U"Garnish", true)
  3377. OK
  3378. DO
  3379. GRAPHICS_EACH (FilterBank)
  3380. FilterBank_drawTimeSlice (me, GRAPHICS, time, fromFrequency, toFrequency, fromAmplitude, toAmplitude, U"Mels", garnish);
  3381. GRAPHICS_EACH_END
  3382. }
  3383. FORM (GRAPHICS_MelSpectrogram_drawSpectrumAtNearestTimeSlice, U"MelSpectrogram: Draw spectrum at nearest time slice", U"BandFilterSpectrogram: Draw spectrum at nearest time slice...") {
  3384. REAL (time, U"Time (s)", U"0.1")
  3385. REAL (fromFrequency, U"left Frequency range (mel)", U"0.0")
  3386. REAL (toFrequency, U"right Frequency range (mel)", U"0.0")
  3387. REAL (fromAmplitude, U"left Amplitude range (dB)", U"0.0")
  3388. REAL (toAmplitude, U"right Amplitude range (dB)", U"0.0")
  3389. BOOLEAN (garnish, U"Garnish", true)
  3390. OK
  3391. DO
  3392. GRAPHICS_EACH (MelSpectrogram)
  3393. BandFilterSpectrogram_drawSpectrumAtNearestTimeSlice (me, GRAPHICS, time, fromFrequency, toFrequency, fromAmplitude, toAmplitude, garnish);
  3394. GRAPHICS_EACH_END
  3395. }
  3396. FORM (GRAPHICS_BarkSpectrogram_drawSpectrumAtNearestTimeSlice, U"BarkSpectrogram: Draw spectrum at nearest time slice", U"BandFilterSpectrogram: Draw spectrum at nearest time slice...") {
  3397. REAL (time, U"Time (s)", U"0.1")
  3398. REAL (fromFrequency, U"left Frequency range (bark)", U"0.0")
  3399. REAL (toFrequency, U"right Frequency range (bark)", U"0.0")
  3400. REAL (fromAmplitude, U"left Amplitude range (dB)", U"0.0")
  3401. REAL (toAmplitude, U"right Amplitude range (dB)", U"0.0")
  3402. BOOLEAN (garnish, U"Garnish", true)
  3403. OK
  3404. DO
  3405. GRAPHICS_EACH (MelSpectrogram)
  3406. BandFilterSpectrogram_drawSpectrumAtNearestTimeSlice (me, GRAPHICS, time, fromFrequency, toFrequency, fromAmplitude, toAmplitude, garnish);
  3407. GRAPHICS_EACH_END
  3408. }
  3409. FORM (GRAPHICS_MelFilter_paint, U"FilterBank: Paint", nullptr) {
  3410. praat_TimeFunction_RANGE(fromTime,toTime)
  3411. REAL (fromFrequency, U"left Frequency range (mel)", U"0.0")
  3412. REAL (toFrequency, U"right Frequency range (mel)", U"0.0")
  3413. REAL (fromAmplitude, U"left Amplitude range", U"0.0")
  3414. REAL (toAmplitude, U"right Amplitude range", U"0.0")
  3415. BOOLEAN (garnish, U"Garnish", false)
  3416. OK
  3417. DO
  3418. GRAPHICS_EACH (Matrix)
  3419. FilterBank_paint ((FilterBank) me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, fromAmplitude, toAmplitude, garnish);
  3420. GRAPHICS_EACH_END
  3421. }
  3422. FORM (NEW_MelFilter_to_MFCC, U"MelFilter: To MFCC", U"MelSpectrogram: To MFCC...") {
  3423. NATURAL (numberOfCoefficients, U"Number of coefficients", U"12")
  3424. OK
  3425. DO
  3426. CONVERT_EACH (MelFilter)
  3427. autoMFCC result = MelFilter_to_MFCC (me, numberOfCoefficients);
  3428. CONVERT_EACH_END (my name.get())
  3429. }
  3430. FORM (NEW_MelSpectrogram_to_MFCC, U"MelSpectrogram: To MFCC", U"MelSpectrogram: To MFCC...") {
  3431. NATURAL (numberOfCoefficients, U"Number of coefficients", U"12")
  3432. OK
  3433. DO
  3434. CONVERT_EACH (MelSpectrogram)
  3435. autoMFCC result = MelSpectrogram_to_MFCC (me, numberOfCoefficients);
  3436. CONVERT_EACH_END (my name.get())
  3437. }
  3438. /**************** Ltas *******************************************/
  3439. #include "../kar/UnicodeData.h"
  3440. FORM (INFO_Ltas_reportSpectralTilt, U"Ltas: Report spectral tilt", nullptr) {
  3441. POSITIVE (fromFrequency, U"left Frequency range (Hz)", U"100.0")
  3442. POSITIVE (toFrequency, U"right Frequency range (Hz)", U"5000.0")
  3443. OPTIONMENU (frequencyScale, U"Frequency scale", 1)
  3444. OPTION (U"Linear")
  3445. OPTION (U"Logarithmic")
  3446. OPTIONMENU (fitMethod, U"Fit method", 2)
  3447. OPTION (U"Least squares")
  3448. OPTION (U"Robust")
  3449. OK
  3450. DO
  3451. bool logScale = frequencyScale == 2;
  3452. INFO_ONE (Ltas)
  3453. double a, b;
  3454. Ltas_fitTiltLine (me, fromFrequency, toFrequency, logScale, fitMethod, &a, &b);
  3455. MelderInfo_open ();
  3456. MelderInfo_writeLine (U"Spectral model: amplitude_dB(frequency_Hz) " UNITEXT_ALMOST_EQUAL_TO " ", logScale ? U"offset + slope * log (frequency_Hz)" : U"offset + slope * frequency_Hz");
  3457. MelderInfo_writeLine (U"Slope: ", a, logScale ? U" dB/decade" : U" dB/Hz");
  3458. MelderInfo_writeLine (U"Offset: ", b, U" dB");
  3459. MelderInfo_close ();
  3460. INFO_ONE_END
  3461. }
  3462. /**************** MFCC *******************************************/
  3463. DIRECT (HELP_MFCC_help) {
  3464. HELP (U"MFCC")
  3465. }
  3466. FORM (NEW_MFCC_to_MelFilter, U"MFCC: To MelFilter", nullptr) {
  3467. INTEGER (fromCoefficient, U"From coefficient", U"0")
  3468. INTEGER (toCoefficient, U"To coefficient", U"0")
  3469. OK
  3470. DO
  3471. CONVERT_EACH (MFCC)
  3472. autoMelFilter result = MFCC_to_MelFilter (me, fromCoefficient, toCoefficient);
  3473. CONVERT_EACH_END (my name.get())
  3474. }
  3475. FORM (NEW_MFCC_to_MelSpectrogram, U"MFCC: MelSpectrogram", U"MFCC: To MelSpectrogram...") {
  3476. INTEGER (fromCoefficient, U"From coefficient", U"0")
  3477. INTEGER (toCoefficient, U"To coefficient", U"0")
  3478. BOOLEAN (includeConstant, U"Include constant term", true)
  3479. OK
  3480. DO
  3481. CONVERT_EACH (MFCC)
  3482. autoMelSpectrogram result = MFCC_to_MelSpectrogram (me, fromCoefficient, toCoefficient, includeConstant);
  3483. CONVERT_EACH_END (my name.get())
  3484. }
  3485. FORM (NEW_MFCC_to_TableOfReal, U"MFCC: To TableOfReal", U"MFCC: To TableOfReal...") {
  3486. BOOLEAN (includeEnergy, U"Include energy", false)
  3487. OK
  3488. DO
  3489. CONVERT_EACH (MFCC)
  3490. autoTableOfReal result = MFCC_to_TableOfReal (me, includeEnergy);
  3491. CONVERT_EACH_END (my name.get())
  3492. }
  3493. FORM (NEW_MFCC_to_Matrix_features, U"MFCC: To Matrix (features)", nullptr) {
  3494. POSITIVE (windowLength, U"Window length (s)", U"0.025")
  3495. BOOLEAN (includeEnergy, U"Include energy", false)
  3496. OK
  3497. DO
  3498. CONVERT_EACH (MFCC)
  3499. autoMatrix result = MFCC_to_Matrix_features (me, windowLength, includeEnergy);
  3500. CONVERT_EACH_END (my name.get())
  3501. }
  3502. FORM (NEW1_MFCCs_crossCorrelate, U"MFCC & MFCC: Cross-correlate", nullptr) {
  3503. RADIO_ENUM (kSounds_convolve_scaling, amplitudeScaling,
  3504. U"Amplitude scaling", kSounds_convolve_scaling::DEFAULT)
  3505. RADIO_ENUM (kSounds_convolve_signalOutsideTimeDomain, signalOutsideTimeDomainIs,
  3506. U"Signal outside time domain is...", kSounds_convolve_signalOutsideTimeDomain::DEFAULT)
  3507. OK
  3508. DO
  3509. CONVERT_COUPLE (MFCC)
  3510. autoSound result = MFCCs_crossCorrelate (me, you, amplitudeScaling, signalOutsideTimeDomainIs);
  3511. CONVERT_COUPLE_END (my name.get(), U"_",your name.get())
  3512. }
  3513. FORM (NEW1_MFCCs_convolve, U"MFCC & MFCC: Convolve", nullptr) {
  3514. RADIO_ENUM (kSounds_convolve_scaling, amplitudeScaling,
  3515. U"Amplitude scaling", kSounds_convolve_scaling::DEFAULT)
  3516. RADIO_ENUM (kSounds_convolve_signalOutsideTimeDomain, signalOutsideTimeDomainIs,
  3517. U"Signal outside time domain is...", kSounds_convolve_signalOutsideTimeDomain::DEFAULT)
  3518. OK
  3519. DO
  3520. CONVERT_COUPLE (MFCC)
  3521. autoSound result = MFCCs_convolve (me, you, amplitudeScaling, signalOutsideTimeDomainIs);
  3522. CONVERT_COUPLE_END (my name.get(), U"_",your name.get())
  3523. }
  3524. DIRECT (NEW_MFCC_to_Sound) {
  3525. CONVERT_EACH (MFCC)
  3526. autoSound result = MFCC_to_Sound (me);
  3527. CONVERT_EACH_END (my name.get())
  3528. }
  3529. /**************** MSpline *******************************************/
  3530. FORM (NEW_MSpline_create, U"Create MSpline", U"Create MSpline...") {
  3531. WORD (name, U"Name", U"mspline")
  3532. LABEL (U"Domain")
  3533. REAL (xmin, U"Xmin", U"0")
  3534. REAL (xmax, U"Xmax", U"1")
  3535. LABEL (U"MSpline(x) = c[1] M[1](x) + c[2] M[1](x) + ... c[n] M[n](x)")
  3536. LABEL (U"all M[k] are polynomials of degree \"Degree\"")
  3537. LABEL (U"Relation: numberOfCoefficients == numberOfInteriorKnots + degree + 1")
  3538. INTEGER (degree, U"Degree", U"2")
  3539. SENTENCE (coefficients_string, U"Coefficients (c[k])", U"1.2 2.0 1.2 1.2 3.0 0.0")
  3540. SENTENCE (knots_string, U"Interior knots" , U"0.3 0.5 0.6")
  3541. OK
  3542. DO
  3543. Melder_require (xmin < xmax, U"Xmin should be smaller than Xmax.");
  3544. CREATE_ONE
  3545. autoMSpline result = MSpline_createFromStrings (xmin, xmax, degree, coefficients_string, knots_string);
  3546. CREATE_ONE_END (name)
  3547. }
  3548. DIRECT (HELP_MSpline_help) {
  3549. HELP (U"MSpline")
  3550. }
  3551. /********************** PatternList *******************************************/
  3552. DIRECT (NEW1_PatternList_Categories_to_Discriminant) {
  3553. CONVERT_TWO (PatternList, Categories)
  3554. autoDiscriminant result = PatternList_Categories_to_Discriminant (me, you);
  3555. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  3556. }
  3557. FORM (GRAPHICS_PatternList_draw, U"PatternList: Draw", nullptr) {
  3558. NATURAL (patternNumber, U"Pattern number", U"1")
  3559. REAL (xmin, U"left Horizontal range", U"0.0")
  3560. REAL (xmax, U"right Horizontal range", U"0.0")
  3561. REAL (ymin, U"left Vertical range", U"0.0")
  3562. REAL (ymax, U"right Vertical range", U"0.0")
  3563. BOOLEAN (garnish, U"Garnish", true)
  3564. OK
  3565. DO
  3566. GRAPHICS_EACH (PatternList)
  3567. PatternList_draw (me, GRAPHICS, patternNumber, xmin, xmax, ymin, ymax, garnish);
  3568. GRAPHICS_EACH_END
  3569. }
  3570. DIRECT (INTEGER_PatternList_getNumberOfPatterns) {
  3571. INTEGER_ONE (PatternList)
  3572. integer result = my ny;
  3573. INTEGER_ONE_END (U" (number of patterns)")
  3574. }
  3575. DIRECT (INTEGER_PatternList_getPatternSize) {
  3576. INTEGER_ONE (PatternList)
  3577. integer result = my nx;
  3578. INTEGER_ONE_END (U" (pattern size)")
  3579. }
  3580. FORM (REAL_PatternList_getValue, U"", nullptr) {
  3581. NATURAL (patternNumber, U"Pattern number", U"1")
  3582. NATURAL (nodeNumber, U"Node number", U"2")
  3583. OK
  3584. DO
  3585. NUMBER_ONE (PatternList)
  3586. double result = ( patternNumber <= my ny && nodeNumber <= my nx ? my z [patternNumber] [nodeNumber] : undefined );
  3587. NUMBER_ONE_END (U"")
  3588. }
  3589. FORM (MODIFY_PatternList_formula, U"PatternList: Formula", nullptr) {
  3590. LABEL (U"# `col` is the node number, `row` is the pattern number")
  3591. LABEL (U"for row from 1 to nrow ; for all patterns")
  3592. LABEL (U" for col from 1 to ncol ; for all nodes")
  3593. LABEL (U" self [row, col] =")
  3594. TEXTFIELD (formula, nullptr, U"5 * exp (-0.5 * ((col - 10 - row/100) / 1.5) ^ 2) - 0.5 ; sliding peak")
  3595. LABEL (U" endfor")
  3596. LABEL (U"endfor")
  3597. OK
  3598. DO
  3599. MODIFY_EACH (PatternList)
  3600. Matrix_formula (me, formula, interpreter, nullptr);
  3601. MODIFY_EACH_END
  3602. }
  3603. FORM (MODIFY_PatternList_setValue, U"PatternList: Set value", U"PatternList: Set value...") {
  3604. NATURAL (rowNumber, U"Row number", U"1")
  3605. NATURAL (columnNumber, U"Column number", U"1")
  3606. REAL (newValue, U"New value", U"0.0")
  3607. OK
  3608. DO
  3609. MODIFY_EACH (PatternList)
  3610. Melder_require (rowNumber <= my ny, U"The row number should not be greater than the number of rows.");
  3611. Melder_require (columnNumber <= my nx, U"The column number should not be greater than the number of columns.");
  3612. my z [rowNumber] [columnNumber] = newValue;
  3613. MODIFY_EACH_END
  3614. }
  3615. DIRECT (NEW_PatternList_to_Matrix) {
  3616. CONVERT_EACH (PatternList)
  3617. autoMatrix result = PatternList_to_Matrix (me);
  3618. CONVERT_EACH_END (my name.get())
  3619. }
  3620. /******************* PCA ******************************/
  3621. DIRECT (HELP_PCA_help) {
  3622. HELP (U"PCA")
  3623. }
  3624. DIRECT (HINT_hint_PCA_TableOfReal_to_Configuration) {
  3625. Melder_information (U"You can get principal components by selecting a PCA and a TableOfReal\n"
  3626. "together and choosing \"To Configuration...\".");
  3627. END }
  3628. DIRECT (HINT_hint_PCA_Covariance_Project) {
  3629. Melder_information (U"You can get a new Covariance object rotated to the directions of the direction vectors\n"
  3630. " in the PCA object by selecting a PCA and a Covariance object together.");
  3631. END }
  3632. DIRECT (HINT_hint_PCA_Configuration_to_TableOfReal_reconstruct) {
  3633. Melder_information (U"You can reconstruct the original TableOfReal as well as possible from\n"
  3634. " the principal components in the Configuration and the direction vectors in the PCA object.");
  3635. END }
  3636. FORM (REAL_PCA_TableOfReal_getFractionVariance, U"PCA & TableOfReal: Get fraction variance", U"PCA & TableOfReal: Get fraction variance...") {
  3637. NATURAL (fromPrincipalComponent, U"left Principal component range", U"1")
  3638. NATURAL (toPrincipalComponent, U"right Principal component range", U"1")
  3639. OK
  3640. DO
  3641. NUMBER_TWO (PCA, TableOfReal)
  3642. double result = PCA_TableOfReal_getFractionVariance (me, you, fromPrincipalComponent, toPrincipalComponent);
  3643. NUMBER_TWO_END (U"")
  3644. }
  3645. DIRECT (NEW_PCA_Configuration_to_TableOfReal_reconstruct) {
  3646. CONVERT_TWO (PCA, Configuration)
  3647. autoTableOfReal result = PCA_Configuration_to_TableOfReal_reconstruct (me, you);
  3648. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  3649. }
  3650. FORM (NEW1_PCA_TableOfReal_to_TableOfReal_projectRows, U"PCA & TableOfReal: To TableOfReal (project rows)", U"PCA & TableOfReal: To Configuration...") {
  3651. INTEGER (numberOfDimensionsToKeep, U"Number of dimensions to keep", U"0 (= all)")
  3652. OK
  3653. DO
  3654. Melder_require (numberOfDimensionsToKeep >= 0, U"The number of dimensions to keep should be at least zero.");
  3655. CONVERT_ONE_AND_GENERIC (PCA, TableOfReal)
  3656. autoTableOfReal result = PCA_TableOfReal_to_TableOfReal_projectRows (me, you, numberOfDimensionsToKeep);
  3657. CONVERT_ONE_AND_GENERIC_END (my name.get(), U"_", your name.get())
  3658. }
  3659. FORM (NEW1_PCA_TableOfReal_to_Configuration, U"PCA & TableOfReal: To Configuration", U"PCA & TableOfReal: To Configuration...") {
  3660. INTEGER (numberOfDimensions, U"Number of dimensions", U"0 (= all)")
  3661. OK
  3662. DO
  3663. Melder_require (numberOfDimensions >= 0, U"The number of dimensions should be at least zero.");
  3664. CONVERT_ONE_AND_GENERIC (PCA, TableOfReal)
  3665. autoConfiguration result = PCA_TableOfReal_to_Configuration (me, you, numberOfDimensions);
  3666. CONVERT_ONE_AND_GENERIC_END (my name.get(), U"_", your name.get())
  3667. }
  3668. FORM (NEW1_PCA_TableOfReal_to_TableOfReal_zscores, U"PCA & TableOfReal: To TableOfReal (z-scores)", U"PCA & TableOfReal: To TableOfReal (z-scores)...") {
  3669. INTEGER (numberOfDimensions, U"Number of dimensions", U"0 (= all)")
  3670. OK
  3671. DO
  3672. Melder_require (numberOfDimensions >= 0, U"The number of dimensions should be at least zero.");
  3673. CONVERT_ONE_AND_GENERIC (PCA, TableOfReal)
  3674. autoTableOfReal result = PCA_TableOfReal_to_TableOfReal_zscores (me, you, numberOfDimensions);
  3675. CONVERT_ONE_AND_GENERIC_END (my name.get(), U"_", your name.get(), U"_zscores")
  3676. }
  3677. FORM (NEW1_PCA_Matrix_to_Matrix_projectRows, U"PCA & Matrix: To Matrix (project rows)", nullptr) {
  3678. INTEGER (numberOfDimensions, U"Number of dimensions", U"0 (= all)")
  3679. OK
  3680. DO
  3681. Melder_require (numberOfDimensions >= 0, U"The number of dimensions should be at least zero.");
  3682. CONVERT_TWO (PCA, Matrix)
  3683. autoMatrix result = Eigen_Matrix_to_Matrix_projectRows (me, you, numberOfDimensions);
  3684. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  3685. }
  3686. FORM (NEW1_PCA_Matrix_to_Matrix_projectColumns, U"PCA & Matrix: To Matrix (project columns)", nullptr) {
  3687. INTEGER (numberOfDimensions, U"Number of dimensions", U"0 (= all)")
  3688. OK
  3689. DO
  3690. Melder_require (numberOfDimensions >= 0, U"The number of dimensions should be at least zero.");
  3691. CONVERT_ONE_AND_GENERIC (PCA, Matrix)
  3692. autoMatrix result = Eigen_Matrix_to_Matrix_projectColumns (me, you, numberOfDimensions);
  3693. CONVERT_ONE_AND_GENERIC_END (my name.get(), U"_", your name.get())
  3694. }
  3695. FORM (REAL_PCA_getCentroidElement, U"PCA: Get centroid element...", nullptr) {
  3696. NATURAL (number, U"Number", U"1")
  3697. OK
  3698. DO
  3699. NUMBER_ONE (PCA)
  3700. Melder_require (number <= my dimension, U"Number should not be greater than ", my dimension, U".");
  3701. double result = my centroid [number];
  3702. NUMBER_ONE_END (U" (element ", number, U")")
  3703. }
  3704. FORM (REAL_PCA_getEqualityOfEigenvalues, U"PCA: Get equality of eigenvalues", U"PCA: Get equality of eigenvalues...") {
  3705. INTEGER (fromEigenvalue, U"left Eigenvalue range", U"0")
  3706. INTEGER (toEigenvalue, U"right Eigenvalue range", U"0")
  3707. BOOLEAN (conservativeTest, U"Conservative test", false)
  3708. OK
  3709. DO
  3710. NUMBER_ONE (PCA)
  3711. double result, chisq, df;
  3712. PCA_getEqualityOfEigenvalues (me, fromEigenvalue, toEigenvalue,
  3713. conservativeTest, & result, & chisq, & df);
  3714. NUMBER_ONE_END (U" (= probability, based on chisq = ", chisq, U" and df = ", df)
  3715. }
  3716. FORM (INTEGER_PCA_getNumberOfComponents_VAF, U"PCA: Get number of components (VAF)", U"PCA: Get number of components (VAF)...") {
  3717. POSITIVE (varianceFraction, U"Variance fraction (0-1)", U"0.95")
  3718. OK
  3719. DO
  3720. Melder_require (varianceFraction >= 0.0 && varianceFraction <= 1.0, U"The variance fraction should be in interval [0-1].");
  3721. NUMBER_ONE (PCA)
  3722. double result = Eigen_getDimensionOfFraction (me, varianceFraction);
  3723. NUMBER_ONE_END (U" (variance fraction)")
  3724. }
  3725. FORM (REAL_PCA_getFractionVAF, U"PCA: Get fraction variance accounted for", U"PCA: Get fraction variance accounted for...") {
  3726. NATURAL (fromPrincipalComponent, U"left Principal component range", U"1")
  3727. NATURAL (toPrincipalComponent, U"right Principal component range", U"1")
  3728. OK
  3729. DO
  3730. Melder_require (fromPrincipalComponent <= toPrincipalComponent, U"The second component should be greater than or equal to the first component.");
  3731. NUMBER_ONE (PCA)
  3732. double result = Eigen_getCumulativeContributionOfComponents (me, fromPrincipalComponent, toPrincipalComponent);
  3733. NUMBER_ONE_END (U"")
  3734. }
  3735. FORM (MODIFY_PCA_invertEigenvector, U"PCA: Invert eigenvector", nullptr) {
  3736. NATURAL (eigenvectorNumber, U"Eigenvector number", U"1")
  3737. OK
  3738. DO
  3739. MODIFY_EACH (Eigen)
  3740. Eigen_invertEigenvector (me, eigenvectorNumber);
  3741. MODIFY_EACH_END
  3742. }
  3743. FORM (NEW_PCA_extractEigenvector, U"PCA: Extract eigenvector", U"Eigen: Extract eigenvector...") {
  3744. NATURAL (eigenvectorNumber, U"Eigenvector number", U"1")
  3745. LABEL (U"Reshape as")
  3746. INTEGER (numberOfRows, U"Number of rows", U"0")
  3747. INTEGER (numberOfColumns, U"Number of columns", U"0")
  3748. OK
  3749. DO
  3750. Melder_require (numberOfRows >= 0, U"The number of rows should beat least 0.");
  3751. Melder_require (numberOfColumns >= 0, U"The number of columns should be at least 0.");
  3752. CONVERT_EACH (PCA);
  3753. autoMatrix result = Eigen_extractEigenvector (me, eigenvectorNumber, numberOfRows, numberOfColumns);
  3754. CONVERT_EACH_END (my name.get(), U"_ev", eigenvectorNumber)
  3755. }
  3756. DIRECT (NEW_PCA_extractEigen) {
  3757. CONVERT_EACH (PCA)
  3758. autoEigen result = PCA_to_Eigen (me);
  3759. CONVERT_EACH_END (my name.get())
  3760. }
  3761. FORM (NEW_PCA_to_TableOfReal_reconstruct1, U"PCA: To TableOfReal (reconstruct)", U"PCA: To TableOfReal (reconstruct 1)...") {
  3762. SENTENCE (coefficients_string, U"Coefficients", U"1.0 1.0")
  3763. OK
  3764. DO
  3765. CONVERT_EACH (PCA)
  3766. autoTableOfReal result = PCA_to_TableOfReal_reconstruct1 (me, coefficients_string);
  3767. CONVERT_EACH_END (my name.get(), U"_reconstructed")
  3768. }
  3769. FORM (NEW1_PCAs_to_Procrustes, U"PCA & PCA: To Procrustes", U"PCA & PCA: To Procrustes...") {
  3770. NATURAL (fromEigenvector, U"left Eigenvector range", U"1")
  3771. NATURAL (toEigenvector, U"right Eigenvector range", U"2")
  3772. OK
  3773. DO
  3774. CONVERT_COUPLE (PCA)
  3775. autoProcrustes result = Eigens_to_Procrustes (me, you, fromEigenvector, toEigenvector);
  3776. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  3777. }
  3778. DIRECT (REAL_PCAs_getAngleBetweenPc1Pc2Plane_degrees) {
  3779. NUMBER_COUPLE (PCA)
  3780. double result = Eigens_getAngleBetweenEigenplanes_degrees (me, you);
  3781. NUMBER_COUPLE_END (U" degrees (= angle of intersection between the two pc1-pc2 eigenplanes)")
  3782. }
  3783. /******************* Permutation **************************************/
  3784. DIRECT (HELP_Permutation_help) {
  3785. HELP (U"Permutation")
  3786. }
  3787. FORM (NEW_Permutation_create, U"Create Permutation", U"Create Permutation...") {
  3788. WORD (name, U"Name", U"p")
  3789. NATURAL (numberOfElements, U"Number of elements", U"10")
  3790. BOOLEAN (identity, U"Identity Permutation", true)
  3791. OK
  3792. DO
  3793. CREATE_ONE
  3794. autoPermutation result = Permutation_create (numberOfElements);
  3795. if (! identity) {
  3796. Permutation_permuteRandomly_inplace (result.get(), 0, 0);
  3797. }
  3798. CREATE_ONE_END (name)
  3799. }
  3800. DIRECT (INTEGER_Permutation_getNumberOfElements) {
  3801. INTEGER_ONE (Permutation)
  3802. integer result = my numberOfElements;
  3803. INTEGER_ONE_END (U" (number of elements)")
  3804. }
  3805. FORM (INTEGER_Permutation_getValueAtIndex, U"Permutation: Get value", U"Permutation: Get value...") {
  3806. NATURAL (index, U"Index", U"1")
  3807. OK
  3808. DO
  3809. INTEGER_ONE (Permutation)
  3810. integer result = Permutation_getValueAtIndex (me, index);
  3811. INTEGER_ONE_END (U" (value, at index = ", index, U")")
  3812. }
  3813. FORM (INTEGER_Permutation_getIndexAtValue, U"Permutation: Get index", U"Permutation: Get index...") {
  3814. NATURAL (value, U"Value", U"1")
  3815. OK
  3816. DO
  3817. INTEGER_ONE (Permutation)
  3818. integer result = Permutation_getIndexAtValue (me, value);
  3819. INTEGER_ONE_END (U" (index, at value = ", value, U")")
  3820. }
  3821. FORM (MODIFY_Permutation_tableJump, U"Permutation: Table jump", U"Permutation: Table jump...") {
  3822. NATURAL (jumpSize, U"Jump size", U"4")
  3823. NATURAL (first, U"First", U"1")
  3824. OK
  3825. DO
  3826. MODIFY_EACH (Permutation)
  3827. Permutation_tableJump_inline (me, jumpSize, first);
  3828. MODIFY_EACH_END
  3829. }
  3830. DIRECT (MODIFY_Permutation_sort) {
  3831. MODIFY_EACH (Permutation)
  3832. Permutation_sort (me);
  3833. MODIFY_EACH_END
  3834. }
  3835. FORM (MODIFY_Permutation_swapBlocks, U"Permutation: Swap blocks", U"Permutation: Swap blocks...") {
  3836. NATURAL (fromIndex, U"From index", U"1")
  3837. NATURAL (toIndex, U"To index", U"2")
  3838. NATURAL (blockSize, U"Block size", U"1")
  3839. OK
  3840. DO
  3841. MODIFY_EACH (Permutation)
  3842. Permutation_swapBlocks (me, fromIndex, toIndex, blockSize);
  3843. MODIFY_EACH_END
  3844. }
  3845. FORM (MODIFY_Permutation_swapPositions, U"Permutation: Swap positions", U"Permutation: Swap positions...") {
  3846. NATURAL (firstIndex, U"First index", U"1")
  3847. NATURAL (secondIndex, U"Second index", U"2")
  3848. OK
  3849. DO
  3850. LOOP {
  3851. iam (Permutation);
  3852. Permutation_swapPositions (me, firstIndex, secondIndex);
  3853. praat_dataChanged (me);
  3854. }
  3855. END }
  3856. FORM (MODIFY_Permutation_swapNumbers, U"Permutation: Swap numbers", U"Permutation: Swap numbers...") {
  3857. NATURAL (firstNumber, U"First number", U"1")
  3858. NATURAL (secondNumber, U"Second number", U"2")
  3859. OK
  3860. DO
  3861. MODIFY_EACH (Permutation)
  3862. Permutation_swapNumbers (me, firstNumber, secondNumber);
  3863. MODIFY_EACH_END
  3864. }
  3865. FORM (MODIFY_Permutation_swapOneFromRange, U"Permutation: Swap one from range", U"Permutation: Swap one from range...") {
  3866. LABEL (U"A randomly chosen element from ")
  3867. INTEGER (fromIndex, U"left Index range", U"0")
  3868. INTEGER (toIndex, U"right Index range", U"0")
  3869. LABEL (U"is swapped with the element at")
  3870. NATURAL (index, U"Index", U"1")
  3871. BOOLEAN (forbidSame, U"Forbid same", true)
  3872. OK
  3873. DO
  3874. MODIFY_EACH (Permutation)
  3875. Permutation_swapOneFromRange (me, fromIndex, toIndex, index, forbidSame);
  3876. MODIFY_EACH_END
  3877. }
  3878. FORM (NEW_Permutation_permuteRandomly, U"Permutation: Permute randomly", U"Permutation: Permute randomly...") {
  3879. INTEGER (fromIndex, U"left Index range", U"0")
  3880. INTEGER (toIndex, U"right Index range", U"0")
  3881. OK
  3882. DO
  3883. CONVERT_EACH (Permutation)
  3884. autoPermutation result = Permutation_permuteRandomly (me, fromIndex, toIndex);
  3885. CONVERT_EACH_END (my name.get(), U"_rdm")
  3886. }
  3887. FORM (NEW_Permutation_rotate, U"Permutation: Rotate", U"Permutation: Rotate...") {
  3888. INTEGER (fromIndex, U"left Index range", U"0")
  3889. INTEGER (toIndex, U"right Index range", U"0")
  3890. INTEGER (step, U"Step size", U"1")
  3891. OK
  3892. DO
  3893. CONVERT_EACH (Permutation)
  3894. autoPermutation result = Permutation_rotate (me, fromIndex, toIndex, step);
  3895. CONVERT_EACH_END (my name.get(), U"_rot", step)
  3896. }
  3897. FORM (NEW_Permutation_reverse, U"Permutation: Reverse", U"Permutation: Reverse...") {
  3898. INTEGER (fromIndex, U"left Index range", U"0")
  3899. INTEGER (toIndex, U"right Index range", U"0")
  3900. OK
  3901. DO
  3902. CONVERT_EACH (Permutation)
  3903. autoPermutation result = Permutation_reverse (me, fromIndex, toIndex);
  3904. CONVERT_EACH_END (my name.get(), U"_rev")
  3905. }
  3906. FORM (NEW_Permutation_permuteBlocksRandomly, U"Permutation: Permute blocks randomly", U"Permutation: Permute randomly (blocks)...") {
  3907. INTEGER (fromIndex, U"left Index range", U"0")
  3908. INTEGER (toIndex, U"right Index range", U"0")
  3909. NATURAL (blockSize, U"Block size", U"12")
  3910. BOOLEAN (permuteWithinBlocks, U"Permute within blocks", true)
  3911. BOOLEAN (noDoublets, U"No doublets", false)
  3912. OK
  3913. DO
  3914. CONVERT_EACH (Permutation)
  3915. autoPermutation result = Permutation_permuteBlocksRandomly (me, fromIndex, toIndex, blockSize, permuteWithinBlocks, noDoublets);
  3916. CONVERT_EACH_END (my name.get(), U"_pbr", blockSize)
  3917. }
  3918. FORM (NEW_Permutation_interleave, U"Permutation: Interleave", U"Permutation: Interleave...") {
  3919. INTEGER (fromIndex, U"left Index range", U"0")
  3920. INTEGER (toIndex, U"right Index range", U"0")
  3921. NATURAL (blockSize, U"Block size", U"12")
  3922. INTEGER (offset, U"Offset", U"0")
  3923. OK
  3924. DO
  3925. CONVERT_EACH (Permutation)
  3926. autoPermutation result = Permutation_interleave (me, fromIndex, toIndex, blockSize, offset);
  3927. CONVERT_EACH_END (my name.get(), U"_itl")
  3928. }
  3929. DIRECT (NEW_Permutation_invert) {
  3930. CONVERT_EACH (Permutation)
  3931. autoPermutation result = Permutation_invert (me);
  3932. CONVERT_EACH_END (my name.get(), U"_inv")
  3933. }
  3934. DIRECT (NEW1_Permutations_multiply) {
  3935. CONVERT_LIST (Permutation)
  3936. autoPermutation result = Permutations_multiply (& list);
  3937. CONVERT_LIST_END (U"mul_", list.size);
  3938. }
  3939. DIRECT (MODIFY_Permutations_next) {
  3940. MODIFY_EACH (Permutation)
  3941. Permutation_next_inplace (me);
  3942. MODIFY_EACH_END
  3943. }
  3944. DIRECT (MODIFY_Permutations_previous) {
  3945. MODIFY_EACH (Permutation)
  3946. Permutation_previous_inplace (me);
  3947. MODIFY_EACH_END
  3948. }
  3949. FORM (NEW1_Pitches_to_DTW, U"Pitches: To DTW", U"Pitches: To DTW...") {
  3950. REAL (vuvCosts, U"Voiced-unvoiced costs", U"24.0")
  3951. REAL (weight, U"Time costs weight", U"10.0")
  3952. DTW_constraints_addCommonFields (matchStart, matchEnd, slopeConstraint)
  3953. OK
  3954. DO
  3955. CONVERT_COUPLE (Pitch)
  3956. autoDTW result = Pitches_to_DTW (me, you, vuvCosts, weight, matchStart, matchEnd, slopeConstraint);
  3957. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  3958. }
  3959. FORM (NEW_PitchTier_to_Pitch, U"PitchTier: To Pitch", U"PitchTier: To Pitch...") {
  3960. POSITIVE (stepSize, U"Step size", U"0.02")
  3961. POSITIVE (pitchFloor, U"Pitch floor (Hz)", U"60.0")
  3962. POSITIVE (pitchCeiling, U"Pitch ceiling (Hz)", U"400.0")
  3963. OK
  3964. DO
  3965. CONVERT_EACH (PitchTier)
  3966. autoPitch result = PitchTier_to_Pitch (me, stepSize, pitchFloor, pitchCeiling);
  3967. CONVERT_EACH_END (my name.get())
  3968. }
  3969. FORM (MODIFY_PitchTier_modifyInterval, U"PitchTier: Modify interval", U"PitchTier: Modify interval...") {
  3970. REAL (fromTime, U"left Time range (s)", U"0.0")
  3971. REAL (toTime, U"right Time range", U"0.0 (= all)")
  3972. LABEL (U"")
  3973. SENTENCE (timesString, U"Relative times", U"0.0 0.5 1.0")
  3974. OPTIONMENU (timeOffset, U"...are...", 1)
  3975. OPTION (U"fractions")
  3976. OPTION (U"percentages")
  3977. OPTION (U"independent")
  3978. LABEL (U"...of the interval duration which will be added...")
  3979. LABEL (U"...to the start time of the interval.")
  3980. SENTENCE (pitches_string, U"The \"pitch\" values", U"100 200 100")
  3981. OPTIONMENU (pitch_as, U"...are...", 1)
  3982. OPTION (U"frequencies")
  3983. OPTION (U"fractions")
  3984. OPTION (U"percentages")
  3985. OPTION (U"start and slopes")
  3986. OPTION (U"slopes and end")
  3987. OPTION (U"music notes")
  3988. // OPTION (U"semitones")
  3989. LABEL (U"...to be added to the anchor value (if used)...")
  3990. OPTIONMENU (pitch_is, U"...which is the...", 1)
  3991. OPTION (U"not used")
  3992. OPTION (U"current")
  3993. OPTION (U"start")
  3994. OPTION (U"end")
  3995. OPTION (U"mean of the curve")
  3996. OPTION (U"mean of the points")
  3997. OPTION (U"maximum")
  3998. OPTION (U"minimum")
  3999. LABEL (U"...frequency value in the interval.")
  4000. LABEL (U"")
  4001. OPTIONMENU (pitch_unit, U"Pitch frequency unit", 1)
  4002. OPTION (U"Hertz")
  4003. OK
  4004. DO
  4005. MODIFY_EACH (PitchTier)
  4006. PitchTier_modifyInterval (me, fromTime, toTime, timesString, timeOffset, pitches_string, pitch_unit, pitch_as, pitch_is);
  4007. MODIFY_EACH_END
  4008. }
  4009. FORM (MODIFY_PitchTier_modifyInterval_toneLevels, U"PitchTier: Modify interval (tone levels)", U"PitchTier: Modify interval (tone levels)...") {
  4010. REAL (fromTime, U"left Time range (s)", U"0.0")
  4011. REAL (toTime, U"right Time range", U"0.0 (= all)")
  4012. REAL (fmin, U"left Pitch range (Hz)", U"80.0")
  4013. REAL (fmax, U"right Pitch range", U"200.0")
  4014. NATURAL (numberOfToneLevels, U"Number of tone levels", U"5")
  4015. LABEL (U"")
  4016. SENTENCE (times_string, U"Relative times", U"0.0 0.5 1.0")
  4017. OPTIONMENU (time_offset, U"...are...", 1)
  4018. OPTION (U"fractions")
  4019. OPTION (U"percentages")
  4020. OPTION (U"independent")
  4021. LABEL (U"...of the interval duration which will be added...")
  4022. LABEL (U"...to the start time of the interval.")
  4023. SENTENCE (pitches_string, U"Tone levels", U"2.1 2.1 5.0")
  4024. OK
  4025. DO
  4026. MODIFY_EACH (PitchTier)
  4027. PitchTier_modifyInterval_toneLevels (me, fromTime, toTime, fmin, fmax, numberOfToneLevels, times_string, time_offset, pitches_string);
  4028. MODIFY_EACH_END
  4029. }
  4030. /******************* Polygon & Categories *************************************/
  4031. FORM (NEW1_Polygon_createSimple, U"Create simple Polygon", U"Create simple Polygon...") {
  4032. WORD (name, U"Name", U"p")
  4033. SENTENCE (vertices_string, U"Vertices as X-Y pairs", U"0.0 0.0 0.0 1.0 1.0 0.0")
  4034. OK
  4035. DO
  4036. CREATE_ONE
  4037. autoPolygon result = Polygon_createSimple (vertices_string);
  4038. CREATE_ONE_END (name)
  4039. }
  4040. FORM (NEW1_Polygon_createFromRandomPoints, U"Polygon: Create from random points", nullptr) {
  4041. WORD (name, U"Name", U"p")
  4042. NATURAL (numberOfPoints, U"Number of points", U"10")
  4043. REAL (xmin, U"left X range", U"0.0")
  4044. REAL (xmax, U"right X range", U"1.0")
  4045. REAL (ymin, U"left Y range", U"0.0")
  4046. REAL (ymax, U"right Y range", U"1.0")
  4047. OK
  4048. DO
  4049. CREATE_ONE
  4050. autoPolygon result = Polygon_createFromRandomPoints (numberOfPoints, xmin, xmax, ymin, ymax);
  4051. CREATE_ONE_END (name)
  4052. }
  4053. DIRECT (INTEGER_Polygon_getNumberOfPoints) {
  4054. INTEGER_ONE (Polygon)
  4055. integer result = my numberOfPoints;
  4056. INTEGER_ONE_END (U" (number of points)")
  4057. }
  4058. FORM (REAL_Polygon_getPointX, U"Polygon: Get point (x)", nullptr) {
  4059. NATURAL (pointNumber, U"Point number", U"1")
  4060. OK
  4061. DO
  4062. NUMBER_ONE (Polygon)
  4063. double result = ( pointNumber <= my numberOfPoints ? my x [pointNumber] : undefined );
  4064. NUMBER_ONE_END (U" (x [", pointNumber, U"])")
  4065. }
  4066. FORM (REAL_Polygon_getPointY, U"Polygon: Get point (y)", nullptr) {
  4067. NATURAL (pointNumber, U"Point number", U"1")
  4068. OK
  4069. DO
  4070. NUMBER_ONE (Polygon)
  4071. double result = ( pointNumber <= my numberOfPoints ? my y [pointNumber] : undefined );
  4072. NUMBER_ONE_END (U" (y [", pointNumber, U"])")
  4073. }
  4074. FORM (INFO_Polygon_getLocationOfPoint, U"Get location of point", U"Polygon: Get location of point...") {
  4075. LABEL (U"Point is (I)n, (O)ut, (E)dge or (V)ertex?")
  4076. REAL (x, U"X", U"0.0")
  4077. REAL (y, U"Y", U"0.0")
  4078. REAL (eps, U"Precision", U"1.64e-15")
  4079. OK
  4080. DO
  4081. Melder_require (eps >= 0.0, U"The precision cannot be negative.");
  4082. STRING_ONE (Polygon)
  4083. int loc = Polygon_getLocationOfPoint (me, x, y, eps);
  4084. conststring32 result = ( loc == Polygon_INSIDE ? U"I" : loc == Polygon_OUTSIDE ? U"O" :
  4085. loc == Polygon_EDGE ? U"E" : U"V" );
  4086. STRING_ONE_END
  4087. }
  4088. DIRECT (REAL_Polygon_getAreaOfConvexHull) {
  4089. NUMBER_ONE (Polygon)
  4090. double result = Polygon_getAreaOfConvexHull (me);
  4091. NUMBER_ONE_END (U" (area convex hull)")
  4092. }
  4093. FORM (NEW_Polygon_circularPermutation, U"Polygon: Circular permutation", nullptr) {
  4094. INTEGER (shift, U"Shift", U"1")
  4095. OK
  4096. DO
  4097. CONVERT_EACH (Polygon)
  4098. autoPolygon result = Polygon_circularPermutation (me, shift);
  4099. CONVERT_EACH_END (my name.get(), U"_", shift)
  4100. }
  4101. DIRECT (NEW_Polygon_simplify) {
  4102. CONVERT_EACH (Polygon)
  4103. autoPolygon result = Polygon_simplify (me);
  4104. CONVERT_EACH_END (my name.get(), U"_s")
  4105. }
  4106. DIRECT (NEW_Polygon_convexHull) {
  4107. CONVERT_EACH (Polygon)
  4108. autoPolygon result = Polygon_convexHull (me);
  4109. CONVERT_EACH_END (my name.get(), U"_hull")
  4110. }
  4111. FORM (MODIFY_Polygon_translate, U"Polygon: Translate", U"Polygon: Translate...") {
  4112. REAL (xDistance, U"X distance", U"0.0")
  4113. REAL (yDistance, U"Y distance", U"0.0")
  4114. OK
  4115. DO
  4116. MODIFY_EACH (Polygon)
  4117. Polygon_translate (me, xDistance, yDistance);
  4118. MODIFY_EACH_END
  4119. }
  4120. FORM (MODIFY_Polygon_rotate, U"Polygon: Rotate", U"Polygon: Rotate...") {
  4121. LABEL (U"Rotate counterclockwise over the")
  4122. REAL (angle_degrees, U"Angle (degrees)", U"0.0")
  4123. LABEL (U"With respect to the point")
  4124. REAL (x, U"X", U"0.0")
  4125. REAL (y, U"Y", U"0.0")
  4126. OK
  4127. DO
  4128. MODIFY_EACH (Polygon)
  4129. Polygon_rotate (me, angle_degrees, x, y);
  4130. MODIFY_EACH_END
  4131. }
  4132. FORM (MODIFY_Polygon_scale, U"Polygon: Scale polygon", nullptr) {
  4133. REAL (x, U"X", U"0.0")
  4134. REAL (y, U"Y", U"0.0")
  4135. OK
  4136. DO
  4137. MODIFY_EACH (Polygon)
  4138. Polygon_scale (me, x, y);
  4139. MODIFY_EACH_END
  4140. }
  4141. FORM (GRAPHICS_Polygon_Categories_draw, U"Polygon & Categories: Draw", nullptr) {
  4142. REAL (xmin, U"left Horizontal range", U"0.0")
  4143. REAL (xmax, U"right Horizontal range", U"0.0")
  4144. REAL (ymin, U"left Vertical range", U"0.0")
  4145. REAL (ymax, U"right Vertical range", U"0.0")
  4146. BOOLEAN (garnish, U"Garnish", true)
  4147. OK
  4148. DO
  4149. GRAPHICS_TWO (Polygon, Categories)
  4150. Polygon_Categories_draw (me, you, GRAPHICS, xmin, xmax, ymin, ymax, garnish);
  4151. GRAPHICS_TWO_END
  4152. }
  4153. DIRECT (MODIFY_Polygon_reverseX) {
  4154. MODIFY_EACH (Polygon)
  4155. Polygon_reverseX (me);
  4156. MODIFY_EACH_END
  4157. }
  4158. DIRECT (MODIFY_Polygon_reverseY) {
  4159. MODIFY_EACH (Polygon)
  4160. Polygon_reverseY (me);
  4161. MODIFY_EACH_END
  4162. }
  4163. /***************** Polynomial *******************/
  4164. DIRECT (HELP_Polynomial_help) {
  4165. HELP (U"Polynomial")
  4166. }
  4167. FORM (NEW1_Polynomial_create, U"Create Polynomial from coefficients", U"Create Polynomial...") {
  4168. WORD (name, U"Name", U"p")
  4169. LABEL (U"Domain of polynomial")
  4170. REAL (xmin, U"Xmin", U"-3.0")
  4171. REAL (xmax, U"Xmax", U"4.0")
  4172. LABEL (U"p(x) = c[1] + c[2] x + ... c[n+1] x^n")
  4173. SENTENCE (coefficients_string, U"Coefficients", U"2.0 -1.0 -2.0 1.0")
  4174. OK
  4175. DO
  4176. Melder_require (xmin < xmax, U"Xmin should be less than Xmax.");
  4177. CREATE_ONE
  4178. autoPolynomial result = Polynomial_createFromString (xmin, xmax, coefficients_string);
  4179. CREATE_ONE_END (name)
  4180. }
  4181. FORM (NEW1_Polynomial_createFromProductTerms, U"Create Polynomial from second order products", nullptr) {
  4182. WORD (name, U"Name", U"p")
  4183. LABEL (U"Domain of polynomial")
  4184. REAL (xmin, U"Xmin", U"-2.0")
  4185. REAL (xmax, U"Xmax", U"2.0")
  4186. LABEL (U"(1+a[1]*x+x^2)*(1+a[2]*x+x^2)*...*(1+a[n]*x+x^2)")
  4187. SENTENCE (coefficients_string, U"The a's", U"1.0 2.0")
  4188. OK
  4189. DO
  4190. Melder_require (xmin < xmax, U"Xmin should be less than Xmax.");
  4191. CREATE_ONE
  4192. autoPolynomial result = Polynomial_createFromProductOfSecondOrderTermsString (xmin, xmax, coefficients_string);
  4193. CREATE_ONE_END (name)
  4194. }
  4195. FORM (NEW1_Polynomial_createFromRealZeros, U"Create Polynomial from first order products", nullptr) {
  4196. WORD (name, U"Name", U"p")
  4197. LABEL (U"Domain of polynomial")
  4198. REAL (xmin, U"Xmin", U"-3.0")
  4199. REAL (xmax, U"Xmax", U"3.0")
  4200. LABEL (U"(P(x) = (x-zero[1])*(1-zero[2])*...*(x-zero[n])")
  4201. SENTENCE (zeros_string, U"The zero's", U"1.0 2.0")
  4202. OK
  4203. DO
  4204. Melder_require (xmin < xmax, U"Xmin should be less than Xmax.");
  4205. CREATE_ONE
  4206. autoPolynomial result = Polynomial_createFromRealRootsString (xmin, xmax, zeros_string);
  4207. CREATE_ONE_END (name)
  4208. }
  4209. FORM (MODIFY_Polynomial_divide_secondOrderFactor, U"Polynomial: Divide second order factor", nullptr) {
  4210. LABEL (U"P(x) / (x^2 - factor)")
  4211. REAL (factor, U"Factor", U"1.0")
  4212. OK
  4213. DO
  4214. MODIFY_EACH (Polynomial)
  4215. Polynomial_divide_secondOrderFactor (me, factor);
  4216. MODIFY_EACH_END
  4217. }
  4218. FORM (REAL_Polynomial_getArea, U"Polynomial: Get area", U"Polynomial: Get area...") {
  4219. LABEL (U"Interval")
  4220. REAL (xmin, U"Xmin", U"0.0")
  4221. REAL (xmax, U"Xmax", U"0.0")
  4222. OK
  4223. DO
  4224. NUMBER_ONE (Polynomial)
  4225. double result = Polynomial_getArea (me, xmin, xmax);
  4226. NUMBER_ONE_END (U" (area)")
  4227. }
  4228. FORM (REAL_Polynomial_getRemainderAfterDivision, U"Polynomial: Get remainder after division", nullptr) {
  4229. LABEL (U"P(x) / (x - factor)")
  4230. REAL (factor, U"Monomial factor", U"1.0")
  4231. OK
  4232. DO
  4233. NUMBER_ONE (Polynomial)
  4234. double result;
  4235. autoPolynomial p = Data_copy (me);
  4236. Polynomial_divide_firstOrderFactor (p.get(), factor, & result);
  4237. NUMBER_ONE_END (U" (remainder)")
  4238. }
  4239. FORM (INFO_Polynomial_getDerivativesAtX, U"Polynomial: Get derivatives at X", nullptr) {
  4240. REAL (x, U"X", U"0.5")
  4241. INTEGER (numberOfDerivatives, U"Number of derivatives", U"2")
  4242. OK
  4243. DO
  4244. autoNUMvector <double> derivatives ((integer) 0, numberOfDerivatives);
  4245. INFO_ONE (Polynomial)
  4246. Polynomial_evaluateDerivatives (me, x, derivatives.peek(), numberOfDerivatives);
  4247. MelderInfo_open ();
  4248. for (integer i = 0; i <= numberOfDerivatives; i ++) {
  4249. MelderInfo_writeLine (i, U": ", i < my numberOfCoefficients ? derivatives [i] : undefined);
  4250. }
  4251. MelderInfo_close ();
  4252. INFO_ONE_END
  4253. }
  4254. FORM (REAL_Polynomial_getOneRealRoot, U"Polynomial: Get one real root", nullptr) {
  4255. LABEL (U"Interval: ")
  4256. REAL (xmin, U"left X Range", U"-1.0")
  4257. REAL (xmax, U"right X Range", U"1.0")
  4258. OK
  4259. DO
  4260. NUMBER_ONE (Polynomial)
  4261. double result = Polynomial_findOneSimpleRealRoot_nr (me, xmin, xmax);
  4262. NUMBER_ONE_END (U" (root)")
  4263. }
  4264. DIRECT (NEW_Polynomial_getDerivative) {
  4265. CONVERT_EACH (Polynomial)
  4266. autoPolynomial result = Polynomial_getDerivative (me);
  4267. CONVERT_EACH_END (my name.get(), U"_derivative")
  4268. }
  4269. FORM (NEW_Polynomial_getPrimitive, U"Polynomial: Get primitive", nullptr) {
  4270. REAL (constant, U"Constant", U"0.0")
  4271. OK
  4272. DO
  4273. CONVERT_EACH (Polynomial)
  4274. autoPolynomial result = Polynomial_getPrimitive (me,constant);
  4275. CONVERT_EACH_END (my name.get(), U"_primitive")
  4276. }
  4277. FORM (NEW_Polynomial_scaleX, U"Polynomial: Scale x", U"Polynomial: Scale x...") {
  4278. LABEL (U"New domain")
  4279. REAL (xmin, U"Xmin", U"-1.0")
  4280. REAL (xmax, U"Xmax", U"1.0")
  4281. OK
  4282. DO
  4283. Melder_require (xmin < xmax, U"Xmin should be less than Xmax.");
  4284. CONVERT_EACH (Polynomial)
  4285. autoPolynomial result = Polynomial_scaleX (me, xmin, xmax);
  4286. CONVERT_EACH_END (my name.get(), U"_scaleX")
  4287. }
  4288. DIRECT (MODIFY_Polynomial_scaleCoefficients_monic) {
  4289. MODIFY_EACH (Polynomial)
  4290. Polynomial_scaleCoefficients_monic (me);
  4291. MODIFY_EACH_END
  4292. }
  4293. DIRECT (NEW_Polynomial_to_Roots) {
  4294. CONVERT_EACH (Polynomial)
  4295. autoRoots result = Polynomial_to_Roots (me);
  4296. CONVERT_EACH_END (my name.get())
  4297. }
  4298. FORM (INFO_Polynomial_evaluate_z, U"Polynomial: Get value (complex)", U"Polynomial: Get value (complex)...") {
  4299. REAL (x, U"Real part", U"0.0")
  4300. REAL (y, U"Imaginary part", U"0.0")
  4301. OK
  4302. DO
  4303. dcomplex z { x, y };
  4304. INFO_ONE (Polynomial)
  4305. dcomplex result = Polynomial_evaluate_z (me, z);
  4306. MelderInfo_open ();
  4307. MelderInfo_writeLine (result);
  4308. MelderInfo_close ();
  4309. INFO_ONE_END
  4310. }
  4311. FORM (NEW_Polynomial_to_Spectrum, U"Polynomial: To Spectrum", U"Polynomial: To Spectrum...") {
  4312. POSITIVE (maximumFrequency, U"Maximum frequency (Hz)", U"5000.0")
  4313. NATURAL (numberOfFrequencies, U"Number of frequencies (>1)", U"1025")
  4314. OK
  4315. DO
  4316. CONVERT_EACH (Polynomial)
  4317. autoSpectrum result = Polynomial_to_Spectrum (me, maximumFrequency, numberOfFrequencies, 1.0);
  4318. CONVERT_EACH_END (my name.get())
  4319. }
  4320. DIRECT (NEW_Polynomials_multiply) {
  4321. CONVERT_COUPLE (Polynomial)
  4322. autoPolynomial result = Polynomials_multiply (me, you);
  4323. CONVERT_COUPLE_END (my name.get(), U"_x_", your name.get())
  4324. }
  4325. FORM (NEWMANY_Polynomials_divide, U"Polynomials: Divide", U"Polynomials: Divide...") {
  4326. BOOLEAN (wantQuotient, U"Want quotient", true)
  4327. BOOLEAN (wantRemainder, U"Want remainder", true)
  4328. OK
  4329. DO
  4330. Melder_require (wantQuotient || wantRemainder, U"You should select \"Want quotient\", \"Want remainder\", or both.");
  4331. FIND_COUPLE (Polynomial)
  4332. autoPolynomial aq, ar;
  4333. Polynomials_divide (me, you, wantQuotient ? & aq : nullptr, wantRemainder ? & ar : nullptr);
  4334. if (wantQuotient) {
  4335. praat_new (aq.move(), my name.get(), U"_q");
  4336. }
  4337. if (wantRemainder) {
  4338. praat_new (ar.move(), my name.get(), U"_r");
  4339. }
  4340. END
  4341. }
  4342. /********************* Roots ******************************/
  4343. DIRECT (HELP_Roots_help) {
  4344. HELP (U"Roots")
  4345. }
  4346. FORM (GRAPHICS_Roots_draw, U"Roots: Draw", nullptr) {
  4347. REAL (xmin, U"Minimum of real axis", U"0.0")
  4348. REAL (xmax, U"Maximum of real axis", U"0.0")
  4349. REAL (ymin, U"Minimum of imaginary axis", U"0.0")
  4350. REAL (ymax, U"Maximum of imaginary axis", U"0.0")
  4351. SENTENCE (mark_string, U"Mark string (+x0...)", U"o")
  4352. NATURAL (markSize, U"Mark size", U"12")
  4353. BOOLEAN (garnish, U"Garnish", false)
  4354. OK
  4355. DO
  4356. GRAPHICS_EACH (Roots)
  4357. Roots_draw (me, GRAPHICS, xmin, xmax, ymin, ymax, mark_string, markSize, garnish);
  4358. GRAPHICS_EACH_END
  4359. }
  4360. DIRECT (INTEGER_Roots_getNumberOfRoots) {
  4361. INTEGER_ONE (Roots)
  4362. integer result = Roots_getNumberOfRoots (me);
  4363. INTEGER_ONE_END (U"")
  4364. }
  4365. FORM (COMPLEX_Roots_getRoot, U"Roots: Get root", nullptr) {
  4366. NATURAL (rootNumber, U"Root number", U"1")
  4367. OK
  4368. DO
  4369. NUMBER_ONE (Roots)
  4370. dcomplex result = Roots_getRoot (me, rootNumber);
  4371. NUMBER_ONE_END (U"")
  4372. }
  4373. FORM (REAL_Roots_getRealPartOfRoot, U"Roots: Get real part", nullptr) {
  4374. NATURAL (rootNumber, U"Root number", U"1")
  4375. OK
  4376. DO
  4377. NUMBER_ONE (Roots)
  4378. dcomplex z = Roots_getRoot (me, rootNumber);
  4379. double result = z.re;
  4380. NUMBER_ONE_END (U"")
  4381. }
  4382. FORM (REAL_Roots_getImaginaryPartOfRoot, U"Roots: Get imaginary part", nullptr) {
  4383. NATURAL (rootNumber, U"Root number", U"1")
  4384. OK
  4385. DO
  4386. NUMBER_ONE (Roots)
  4387. dcomplex z = Roots_getRoot (me, rootNumber);
  4388. double result = z.im;
  4389. NUMBER_ONE_END (U" i")
  4390. }
  4391. FORM (MODIFY_Roots_setRoot, U"Roots: Set root", nullptr) {
  4392. NATURAL (rootNumber, U"Root number", U"1")
  4393. REAL (x, U"Real part", U"1.0/sqrt(2)")
  4394. REAL (y, U"Imaginary part", U"1.0/sqrt(2)")
  4395. OK
  4396. DO
  4397. MODIFY_EACH (Roots)
  4398. Roots_setRoot (me, rootNumber, x, y);
  4399. MODIFY_EACH_END
  4400. }
  4401. FORM (NEW_Roots_to_Spectrum, U"Roots: To Spectrum", U"Roots: To Spectrum...") {
  4402. POSITIVE (maximumFrequency, U"Maximum frequency (Hz)", U"5000.0")
  4403. NATURAL (numberOfFrequencies, U"Number of frequencies (>1)", U"1025")
  4404. OK
  4405. DO
  4406. CONVERT_EACH (Roots)
  4407. autoSpectrum result = Roots_to_Spectrum (me, maximumFrequency, numberOfFrequencies, 1.0);
  4408. CONVERT_EACH_END (my name.get())
  4409. }
  4410. DIRECT (MODIFY_Roots_Polynomial_polish) {
  4411. MODIFY_FIRST_OF_TWO (Roots, Polynomial)
  4412. Roots_Polynomial_polish (me, you);
  4413. MODIFY_FIRST_OF_TWO_END
  4414. }
  4415. /*****************************************************************************/
  4416. DIRECT (INFO_Praat_ReportFloatingPointProperties) {
  4417. if (! NUMfpp) {
  4418. NUMmachar ();
  4419. }
  4420. MelderInfo_open ();
  4421. MelderInfo_writeLine (U"Double precision floating point properties of this machine,");
  4422. MelderInfo_writeLine (U"as calculated by algorithms from the Binary Linear Algebra System (BLAS)");
  4423. MelderInfo_writeLine (U"Radix: ", NUMfpp -> base);
  4424. MelderInfo_writeLine (U"Number of digits in mantissa: ", NUMfpp -> t);
  4425. MelderInfo_writeLine (U"Smallest exponent before (gradual) underflow (expmin): ", NUMfpp -> emin);
  4426. MelderInfo_writeLine (U"Largest exponent before overflow (expmax): ", NUMfpp -> emax);
  4427. MelderInfo_writeLine (U"Does rounding occur in addition: ", (NUMfpp -> rnd == 1 ? U"yes" : U"no"));
  4428. MelderInfo_writeLine (U"Quantization step (d): ", NUMfpp -> prec);
  4429. MelderInfo_writeLine (U"Quantization error (eps = d/2): ", NUMfpp -> eps);
  4430. MelderInfo_writeLine (U"Underflow threshold (= radix ^ (expmin - 1)): ", NUMfpp -> rmin);
  4431. MelderInfo_writeLine (U"Safe minimum (such that its inverse does not overflow): ", NUMfpp -> sfmin);
  4432. MelderInfo_writeLine (U"Overflow threshold (= (1 - eps) * radix ^ expmax): ", NUMfpp -> rmax);
  4433. MelderInfo_writeLine (U"\nA long double is ", sizeof (long double), U" bytes");
  4434. MelderInfo_close ();
  4435. END }
  4436. FORM (REAL_Praat_getTukeyQ, U"Get TukeyQ", nullptr) {
  4437. POSITIVE (criticalValue, U"Critical value", U"2.0")
  4438. NATURAL (numberOfMeans, U"Number of means", U"3")
  4439. POSITIVE (degreesOfFreedon, U"Degrees of freedom", U"10.0")
  4440. NATURAL (numberOfRows, U"Number of rows", U"1")
  4441. OK
  4442. DO
  4443. double result = NUMtukeyQ (criticalValue, numberOfMeans, degreesOfFreedon, numberOfRows);
  4444. Melder_information (result, U" (tukeyQ)");
  4445. END }
  4446. FORM (REAL_Praat_getInvTukeyQ, U"Get invTukeyQ", nullptr) {
  4447. REAL (probability, U"Probability", U"0.05")
  4448. NATURAL (numberOfMeans, U"Number of means", U"3")
  4449. POSITIVE (degreesOfFreedon, U"Degrees of freedom", U"10.0")
  4450. NATURAL (numberOfRows, U"Number of rows", U"1")
  4451. OK
  4452. DO
  4453. Melder_require (probability >= 0.0 && probability <= 1.0, U"The probability should be in the interval [0, 1].");
  4454. double result = NUMinvTukeyQ (probability, numberOfMeans, degreesOfFreedon, numberOfRows);
  4455. Melder_information (result, U" (inv tukeyQ)");
  4456. END }
  4457. FORM (COMPLEX_Praat_getIncompleteGamma, U"Get incomplete gamma", U"Get incomplete gamma...") {
  4458. POSITIVE (reAlpha, U"Real part of alpha", U"4.0")
  4459. REAL (imAlpha, U"Imaginary part of alpha", U"0.0")
  4460. REAL (reX, U"Real part of X", U"4.0")
  4461. REAL (imX, U"Imaginary part of X", U"0.0")
  4462. OK
  4463. DO
  4464. dcomplex result = NUMincompleteGammaFunction (reAlpha, imAlpha, reX, imX);
  4465. Melder_information (result);
  4466. END }
  4467. /******************** Sound ****************************************/
  4468. #define Sound_create_addCommonFields(startTime,endTime,samplingFrequency) \
  4469. REAL (startTime, U"Start time (s)", U"0.0") \
  4470. REAL (endTime, U"End time (s)", U"1.0") \
  4471. POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"44100.0")
  4472. static void Sound_create_checkCommonFields (double startTime, double endTime, double samplingFrequency) {
  4473. double numberOfSamples_real;
  4474. numberOfSamples_real = round ( (endTime - startTime) * samplingFrequency);
  4475. if (endTime <= startTime) {
  4476. if (endTime == startTime) {
  4477. Melder_throw (U"A Sound cannot have a duration of zero.");
  4478. } else {
  4479. Melder_throw (U"A Sound cannot have a duration less than zero.");
  4480. }
  4481. if (startTime == 0.0) {
  4482. Melder_throw (U"Please set the finishing time to something greater than 0 seconds.");
  4483. } else {
  4484. Melder_throw (U"Please lower the starting time or raise the finishing time.");
  4485. }
  4486. }
  4487. if (samplingFrequency <= 0.0)
  4488. Melder_throw (U"A Sound cannot have a negative sampling frequency.\n"
  4489. U"Please set the sampling frequency to something greater than zero, e.g. 44100 Hz.");
  4490. if (numberOfSamples_real < 1.0) {
  4491. Melder_appendError (U"A Sound cannot have zero samples.\n");
  4492. if (startTime == 0.0) {
  4493. Melder_throw (U"Please raise the finishing time.");
  4494. } else {
  4495. Melder_throw (U"Please lower the starting time or raise the finishing time.");
  4496. }
  4497. }
  4498. if (numberOfSamples_real > LONG_MAX) { // ppgb: kan niet in een 64-bit-omgeving
  4499. Melder_throw (U"A Sound cannot have ", Melder_bigInteger ((integer) numberOfSamples_real), U" samples; the maximum is ", Melder_bigInteger (LONG_MAX), U" samples.\n");
  4500. }
  4501. }
  4502. FORM (NEW1_Sound_Pitch_to_FormantFilter, U"Sound & Pitch: To FormantFilter", U"Sound & Pitch: To Spectrogram...") {
  4503. POSITIVE (windowLength, U"Analysis window duration (s)", U"0.015")
  4504. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4505. LABEL (U"Filter bank parameters")
  4506. POSITIVE (firstFrequency, U"Position of first filter (Hz)", U"100.0")
  4507. POSITIVE (deltaFrequency, U"Distance between filters (Hz)", U"50.0")
  4508. REAL (maximumFrequency, U"Maximum frequency", U"0");
  4509. POSITIVE (relativeBandwidth, U"Relative bandwidth", U"1.1")
  4510. OK
  4511. DO
  4512. CONVERT_TWO (Sound, Pitch)
  4513. autoFormantFilter result = Sound_Pitch_to_FormantFilter (me, you, windowLength, timeStep, firstFrequency, maximumFrequency, deltaFrequency, relativeBandwidth);
  4514. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  4515. }
  4516. FORM (NEW1_Sound_Pitch_to_Spectrogram, U"Sound & Pitch: To Spectrogram", U"Sound & Pitch: To Spectrogram...") {
  4517. POSITIVE (windowLength, U"Analysis window duration (s)", U"0.015")
  4518. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4519. LABEL (U"Filter bank parameters")
  4520. POSITIVE (firstFrequency, U"Position of first filter (Hz)", U"100.0")
  4521. POSITIVE (deltaFrequency, U"Distance between filters (Hz)", U"50.0")
  4522. REAL (maximumFrequency, U"Maximum frequency", U"0");
  4523. POSITIVE (relativeBandwidth, U"Relative bandwidth", U"1.1")
  4524. OK
  4525. DO
  4526. CONVERT_TWO (Sound, Pitch)
  4527. autoSpectrogram result = Sound_Pitch_to_Spectrogram (me, you, windowLength, timeStep, firstFrequency, maximumFrequency, deltaFrequency, relativeBandwidth);
  4528. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  4529. }
  4530. FORM (NEW1_Sound_Pitch_changeGender, U"Sound & Pitch: Change gender", U"Sound & Pitch: Change gender...") {
  4531. POSITIVE (formantShiftRatio, U"Formant shift ratio", U"1.2")
  4532. REAL (newPitchMedian, U"New pitch median (Hz)", U"0.0 (= no change)")
  4533. POSITIVE (pitchRangeFactor, U"Pitch range factor", U"1.0 (= no change)")
  4534. POSITIVE (durationFactor, U"Duration factor", U"1.0")
  4535. OK
  4536. DO
  4537. CONVERT_TWO (Sound, Pitch)
  4538. autoSound result = Sound_Pitch_changeGender_old (me, you, formantShiftRatio, newPitchMedian, pitchRangeFactor, durationFactor);
  4539. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  4540. }
  4541. FORM (NEW1_Sound_Pitch_changeSpeaker, U"Sound & Pitch: Change speaker", U"Sound & Pitch: Change speaker...") {
  4542. POSITIVE (formantFrequencyMultiplicationFactor, U"Multiply formants by", U"1.1 (male->female)")
  4543. POSITIVE (pitchMultiplicationFactor, U"Multiply pitch by", U"1.8 (male->female")
  4544. REAL (pitchRangeMultiplicationFactor, U"Multiply pitch range by", U"1.0 (= no change)")
  4545. POSITIVE (durationMultiplicationFactor, U"Multiply duration by", U"1.0")
  4546. OK
  4547. DO
  4548. CONVERT_TWO (Sound, Pitch)
  4549. autoSound result = Sound_Pitch_changeSpeaker (me, you, formantFrequencyMultiplicationFactor, pitchMultiplicationFactor, pitchRangeMultiplicationFactor, durationMultiplicationFactor);
  4550. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  4551. }
  4552. FORM (NEW1_Sound_IntervalTier_cutPartsMatchingLabel, U"Sound & IntervalTier: Cut parts matching label", nullptr) {
  4553. SENTENCE (label, U"Label", U"cut")
  4554. OK
  4555. DO
  4556. CONVERT_TWO (Sound, IntervalTier)
  4557. autoSound result = Sound_IntervalTier_cutPartsMatchingLabel (me, you, label);
  4558. CONVERT_TWO_END (my name.get(), U"_cut")
  4559. }
  4560. FORM (NEW1_Sound_createAsGammaTone, U"Create a gammatone", U"Create Sound as gammatone...") {
  4561. WORD (name, U"Name", U"gammatone")
  4562. Sound_create_addCommonFields (startTime, endTime, samplingFrequency)
  4563. INTEGER (gamma, U"Gamma", U"4")
  4564. POSITIVE (frequency, U"Frequency (Hz)", U"1000.0")
  4565. POSITIVE (bandwidth, U"Bandwidth (Hz)", U"150.0")
  4566. REAL (initialPhase, U"Initial phase (radians)", U"0.0")
  4567. REAL (additionFactor, U"Addition factor", U"0.0")
  4568. BOOLEAN (scaleAmplitudes, U"Scale amplitudes", true)
  4569. OK
  4570. DO
  4571. CREATE_ONE
  4572. Sound_create_checkCommonFields (startTime, endTime, samplingFrequency);
  4573. Melder_require (frequency < 0.5 * samplingFrequency,
  4574. U"Your frequency should not be greater than half the sampling frequency. Use a frequency less than ", 0.5 * samplingFrequency, U".");
  4575. Melder_require (gamma >= 0, U"Gamma should not be negative. Use a positive or zero gamma.");
  4576. autoSound result = Sound_createGammaTone (startTime, endTime, samplingFrequency, gamma, frequency, bandwidth, initialPhase, additionFactor, scaleAmplitudes);
  4577. CREATE_ONE_END (name)
  4578. }
  4579. FORM (NEW_Sound_createAsShepardTone, U"Create a Shepard tone", U"Create Sound as Shepard tone...") {
  4580. WORD (name, U"Name", U"shepardTone")
  4581. Sound_create_addCommonFields (startTime, endTime, samplingFrequency)
  4582. POSITIVE (minimumFrequency, U"Lowest frequency (Hz)", U"4.863")
  4583. NATURAL (numberOfComponents, U"Number of components", U"10")
  4584. REAL (frequencyChange, U"Frequency change (semitones/s)", U"4.0")
  4585. POSITIVE (amplitudeRange_dB, U"Amplitude range (dB)", U"30.0")
  4586. REAL (octaveShiftFraction, U"Octave shift fraction ([0,1))", U"0.0")
  4587. OK
  4588. DO
  4589. CREATE_ONE
  4590. Sound_create_checkCommonFields (startTime, endTime, samplingFrequency);
  4591. autoSound result = Sound_createShepardToneComplex (startTime, endTime, samplingFrequency, minimumFrequency, numberOfComponents, frequencyChange, amplitudeRange_dB, octaveShiftFraction);
  4592. CREATE_ONE_END (name)
  4593. }
  4594. FORM (GRAPHICS_Sound_drawWhere, U"Sound: Draw where", U"Sound: Draw where...") {
  4595. praat_TimeFunction_RANGE(fromTime,toTime)
  4596. REAL (ymin, U"left Vertical range", U"0.0")
  4597. REAL (ymax, U"right Vertical range", U"0.0 (= auto)")
  4598. BOOLEAN (garnish, U"Garnish", true)
  4599. LABEL (U"")
  4600. OPTIONMENUSTR (drawingMethod, U"Drawing method", 1)
  4601. OPTION (U"Curve")
  4602. OPTION (U"Bars")
  4603. OPTION (U"Poles")
  4604. OPTION (U"Speckles")
  4605. TEXTFIELD (formula, U"Draw only those parts where the following condition holds:", U"x < xmin + (xmax - xmin) / 2; first half")
  4606. OK
  4607. DO
  4608. integer numberOfBisections = 10;
  4609. GRAPHICS_EACH (Sound)
  4610. Sound_drawWhere (me, GRAPHICS, fromTime, toTime, ymin, ymax, garnish, drawingMethod, numberOfBisections, formula, interpreter);
  4611. GRAPHICS_EACH_END
  4612. }
  4613. FORM (PLAY_Sound_playOneChannel, U"Sound: Play one channel", nullptr) {
  4614. NATURAL (channel, U"Channel", U"1")
  4615. OK
  4616. DO
  4617. LOOP {
  4618. iam (Sound);
  4619. if (channel > my ny) {
  4620. Melder_throw (me, U": there is no channel ", channel, U". Sound has only ", my ny, U" channel",
  4621. (my ny > 1 ? U"s." : U"."));
  4622. }
  4623. autoSound thee = Sound_extractChannel (me, channel);
  4624. Sound_play (thee.get(), 0, 0);
  4625. }
  4626. END }
  4627. FORM (PLAY_Sound_playAsFrequencyShifted, U"Sound: Play as frequency shifted", U"Sound: Play as frequency shifted...") {
  4628. REAL (frequencyShift, U"Shift by (Hz)", U"1000.0")
  4629. POSITIVE (samplingFrequency, U"New sampling frequency (Hz)", U"44100.0")
  4630. NATURAL (samplePrecision, U"Precision (samples)", U"50")
  4631. OK
  4632. DO
  4633. LOOP {
  4634. iam (Sound);
  4635. Sound_playAsFrequencyShifted (me, frequencyShift, samplingFrequency, samplePrecision);
  4636. }
  4637. END }
  4638. FORM (NEW1_Sounds_to_DTW, U"Sounds: To DTW", nullptr) {
  4639. POSITIVE (windowLength, U"Window length (s)", U"0.015")
  4640. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4641. LABEL (U"")
  4642. REAL (sakoeChibaBand, U"Sakoe-Chiba band (s)", U"0.1")
  4643. RADIO (slopeConstraint, U"Slope constraint", 1)
  4644. RADIOBUTTON (U"no restriction")
  4645. RADIOBUTTON (U"1/3 < slope < 3")
  4646. RADIOBUTTON (U"1/2 < slope < 2")
  4647. RADIOBUTTON (U"2/3 < slope < 3/2")
  4648. OK
  4649. DO
  4650. CONVERT_COUPLE (Sound)
  4651. autoDTW result = Sounds_to_DTW (me, you, windowLength, timeStep, sakoeChibaBand, slopeConstraint);
  4652. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  4653. }
  4654. FORM (NEW_Sound_to_TextGrid_detectSilences, U"Sound: To TextGrid (silences)", U"Sound: To TextGrid (silences)...") {
  4655. LABEL (U"Parameters for the intensity analysis")
  4656. POSITIVE (minimumPitch, U"Minimum pitch (Hz)", U"100")
  4657. REAL (timeStep, U"Time step (s)", U"0.0 (= auto)")
  4658. LABEL (U"Silent intervals detection")
  4659. REAL (silenceThreshold, U"Silence threshold (dB)", U"-25.0")
  4660. POSITIVE (minimumSilenceDuration, U"Minimum silent interval duration (s)", U"0.1")
  4661. POSITIVE (minimumSoundingDuration, U"Minimum sounding interval duration (s)", U"0.1")
  4662. WORD (silenceLabel, U"Silent interval label", U"silent")
  4663. WORD (soundingLabel, U"Sounding interval label", U"sounding")
  4664. OK
  4665. DO
  4666. CONVERT_EACH (Sound)
  4667. autoTextGrid result = Sound_to_TextGrid_detectSilences (me, minimumPitch, timeStep, silenceThreshold, minimumSilenceDuration, minimumSoundingDuration, silenceLabel, soundingLabel);
  4668. CONVERT_EACH_END (my name.get())
  4669. }
  4670. FORM (NEW_Sound_copyChannelRanges, U"Sound: Copy channel ranges", nullptr) {
  4671. TEXTFIELD (channels, U"Create a new Sound from the following channels:", U"1:64")
  4672. LABEL (U"To supply rising or falling ranges, use e.g. 2:6 or 5:3.")
  4673. OK
  4674. DO
  4675. CONVERT_EACH (Sound)
  4676. autoSound result = Sound_copyChannelRanges (me, channels);
  4677. CONVERT_EACH_END (my name.get(), U"_channels")
  4678. }
  4679. FORM (NEWMANY_Sound_trimSilences, U"Sound: Trim silences", U"Sound: Trim silences...") {
  4680. REAL (trimDuration, U"Trim duration (s)", U"0.08")
  4681. BOOLEAN (onlyAtStartAndEnd, U"Only at start and end", true);
  4682. LABEL (U"Parameters for the intensity analysis")
  4683. POSITIVE (minimumPitch, U"Minimum pitch (Hz)", U"100")
  4684. REAL (timeStep, U"Time step (s)", U"0.0 (= auto)")
  4685. LABEL (U"Silent intervals detection")
  4686. REAL (silenceThreshold, U"Silence threshold (dB)", U"-35.0")
  4687. POSITIVE (minimumSilenceDuration, U"Minimum silent interval duration (s)", U"0.1")
  4688. POSITIVE (minimumSoundingDuration, U"Minimum sounding interval duration (s)", U"0.05")
  4689. BOOLEAN (saveTextGrid, U"Save trimming info as TextGrid", false)
  4690. WORD (trim_string, U"Trim label", U"trimmed")
  4691. OK
  4692. DO
  4693. trimDuration = ( trimDuration < 0.0 ? 0.0 : trimDuration );
  4694. CONVERT_EACH (Sound)
  4695. autoTextGrid tg;
  4696. autoSound result = Sound_trimSilences (me, trimDuration, onlyAtStartAndEnd, minimumPitch, timeStep, silenceThreshold, minimumSilenceDuration, minimumSoundingDuration, (saveTextGrid ? &tg : nullptr ), trim_string);
  4697. if (saveTextGrid) {
  4698. praat_new (tg.move(), my name.get(), U"_trimmed");
  4699. }
  4700. CONVERT_EACH_END (my name.get(), U"_trimmed")
  4701. }
  4702. // deprecated
  4703. FORM (NEW_Sound_to_BarkFilter, U"Sound: To BarkFilter", U"Sound: To BarkSpectrogram...") {
  4704. POSITIVE (windowLength, U"Window length (s)", U"0.015")
  4705. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4706. LABEL (U"Filter bank parameters")
  4707. POSITIVE (firstFrequency, U"Position of first filter (bark)", U"1.0")
  4708. POSITIVE (deltaFrequency, U"Distance between filters (bark)", U"1.0")
  4709. REAL (maximumFrequency, U"Maximum frequency (bark)", U"0.0");
  4710. OK
  4711. DO
  4712. CONVERT_EACH (Sound)
  4713. autoBarkFilter result = Sound_to_BarkFilter (me, windowLength, timeStep, firstFrequency, maximumFrequency, deltaFrequency);
  4714. CONVERT_EACH_END (my name.get())
  4715. }
  4716. FORM (NEW_Sound_to_BarkSpectrogram, U"Sound: To BarkSpectrogram", U"Sound: To BarkSpectrogram...") {
  4717. POSITIVE (windowLength, U"Window length (s)", U"0.015")
  4718. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4719. LABEL (U"Filter bank parameters")
  4720. POSITIVE (firstFrequency, U"Position of first filter (bark)", U"1.0")
  4721. POSITIVE (deltaFrequency, U"Distance between filters (bark)", U"1.0")
  4722. REAL (maximumFrequency, U"Maximum frequency (bark)", U"0.0");
  4723. OK
  4724. DO
  4725. CONVERT_EACH (Sound)
  4726. autoBarkSpectrogram result = Sound_to_BarkSpectrogram (me, windowLength, timeStep, firstFrequency, maximumFrequency, deltaFrequency);
  4727. CONVERT_EACH_END (my name.get())
  4728. }
  4729. // deprecated
  4730. FORM (NEW_Sound_to_FormantFilter, U"Sound: To FormantFilter", U"Sound: To FormantFilter...") {
  4731. POSITIVE (windowLength, U"Window length (s)", U"0.015")
  4732. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4733. LABEL (U"Filter bank parameters")
  4734. POSITIVE (firstFrequency, U"Position of first filter (Hz)", U"100.0")
  4735. POSITIVE (deltaFrequency, U"Distance between filters (Hz)", U"50.0")
  4736. REAL (maximumFrequency, U"Maximum frequency", U"0.0");
  4737. POSITIVE (relativeBandwidth, U"Relative bandwidth", U"1.1")
  4738. LABEL (U"Pitch analysis")
  4739. REAL (minimumPitch, U"Minimum pitch (Hz)", U"75.0")
  4740. REAL (maximumPitch, U"Maximum pitch (Hz)", U"600.0")
  4741. OK
  4742. DO
  4743. CONVERT_EACH (Sound)
  4744. autoFormantFilter result = Sound_to_FormantFilter (me, windowLength, timeStep, firstFrequency, maximumFrequency, deltaFrequency, relativeBandwidth, minimumPitch, maximumPitch);
  4745. CONVERT_EACH_END (my name.get())
  4746. }
  4747. FORM (NEW_Sound_to_Spectrogram_pitchDependent, U"Sound: To Spectrogram (pitch-dependent)", U"Sound: To Spectrogram (pitch-dependent)...") {
  4748. POSITIVE (windowLength, U"Window length (s)", U"0.015")
  4749. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4750. LABEL (U"Filter bank parameters")
  4751. POSITIVE (firstFrequency, U"Position of first filter (Hz)", U"100.0")
  4752. POSITIVE (deltaFrequency, U"Distance between filters (Hz)", U"50.0")
  4753. REAL (maximumFrequency, U"Maximum frequency", U"0.0");
  4754. POSITIVE (relativeBandwidth, U"Relative bandwidth", U"1.1")
  4755. LABEL (U"Pitch analysis")
  4756. REAL (minimumPitch, U"Minimum pitch (Hz)", U"75.0")
  4757. REAL (maximumPitch, U"Maximum pitch (Hz)", U"600.0")
  4758. OK
  4759. DO
  4760. CONVERT_EACH (Sound)
  4761. autoSpectrogram result = Sound_to_Spectrogram_pitchDependent (me, windowLength, timeStep, firstFrequency, maximumFrequency, deltaFrequency, relativeBandwidth, minimumPitch, maximumPitch);
  4762. CONVERT_EACH_END (my name.get())
  4763. }
  4764. // deprecated
  4765. FORM (NEW_Sound_to_MelFilter, U"Sound: To MelFilter", U"Sound: To MelFilter...") {
  4766. POSITIVE (windowLength, U"Window length (s)", U"0.015")
  4767. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4768. LABEL (U"Filter bank parameters")
  4769. POSITIVE (firstFrequency, U"Position of first filter (mel)", U"100.0")
  4770. POSITIVE (deltaFrequency, U"Distance between filters (mel)", U"100.0")
  4771. REAL (maximumFrequency, U"Maximum frequency (mel)", U"0.0");
  4772. OK
  4773. DO
  4774. CONVERT_EACH (Sound)
  4775. autoMelFilter result = Sound_to_MelFilter (me, windowLength, timeStep, firstFrequency, maximumFrequency, deltaFrequency);
  4776. CONVERT_EACH_END (my name.get())
  4777. }
  4778. FORM (NEW_Sound_to_MelSpectrogram, U"Sound: To MelSpectrogram", U"Sound: To MelSpectrogram...") {
  4779. POSITIVE (windowLength, U"Window length (s)", U"0.015")
  4780. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4781. LABEL (U"Filter bank parameters")
  4782. POSITIVE (firstFrequency, U"Position of first filter (mel)", U"100.0")
  4783. POSITIVE (deltaFrequency, U"Distance between filters (mel)", U"100.0")
  4784. REAL (maximumFrequency, U"Maximum frequency (mel)", U"0.0");
  4785. OK
  4786. DO
  4787. CONVERT_EACH (Sound)
  4788. autoMelSpectrogram result = Sound_to_MelSpectrogram (me, windowLength, timeStep, firstFrequency, maximumFrequency, deltaFrequency);
  4789. CONVERT_EACH_END (my name.get())
  4790. }
  4791. FORM (NEW_Sound_to_ComplexSpectrogram, U"Sound: To ComplexSpectrogram", nullptr) {
  4792. POSITIVE (windowLength, U"Window length (s)", U"0.015")
  4793. POSITIVE (timeStep, U"Time step", U"0.005")
  4794. OK
  4795. DO
  4796. CONVERT_EACH (Sound)
  4797. autoComplexSpectrogram result = Sound_to_ComplexSpectrogram (me, windowLength, timeStep);
  4798. CONVERT_EACH_END (my name.get())
  4799. }
  4800. FORM (NEW_Sound_to_Pitch_shs, U"Sound: To Pitch (shs)", U"Sound: To Pitch (shs)...") {
  4801. POSITIVE (timeStep, U"Time step (s)", U"0.01")
  4802. POSITIVE (pitchFloor, U"Minimum pitch (Hz)", U"50.0")
  4803. NATURAL (maximumNumberOfCandidates, U"Max. number of candidates (Hz)", U"15")
  4804. LABEL (U"Algorithm parameters")
  4805. POSITIVE (maximumFrequency, U"Maximum frequency component (Hz)", U"1250.0")
  4806. NATURAL (maximumNumberOfSubharmonics, U"Max. number of subharmonics", U"15")
  4807. POSITIVE (compressionFactor, U"Compression factor (<=1)", U"0.84")
  4808. POSITIVE (pitchCeiling, U"Ceiling (Hz)", U"600.0")
  4809. NATURAL (numberOfPointsPerOctave, U"Number of points per octave", U"48");
  4810. OK
  4811. DO
  4812. Melder_require (pitchFloor < pitchCeiling, U"The minimum pitch should be less than the ceiling.");
  4813. Melder_require (pitchCeiling < maximumFrequency, U"The maximum frequency should be greater than or equal to the ceiling.");
  4814. CONVERT_EACH (Sound)
  4815. autoPitch result = Sound_to_Pitch_shs (me, timeStep, pitchFloor, maximumFrequency, pitchCeiling, maximumNumberOfSubharmonics, maximumNumberOfCandidates, compressionFactor, numberOfPointsPerOctave);
  4816. CONVERT_EACH_END (my name.get())
  4817. }
  4818. FORM (MODIFY_Sound_fadeIn, U"Sound: Fade in", U"Sound: Fade in...") {
  4819. CHANNEL (channel, U"Channel (number; 0 = all)", U"1")
  4820. REAL (time, U"Time (s)", U"-10000.0")
  4821. REAL (fadeTime, U"Fade time (s)", U"0.005")
  4822. BOOLEAN (silentFromStart, U"Silent from start", false)
  4823. OK
  4824. DO
  4825. MODIFY_EACH (Sound)
  4826. Sound_fade (me, channel, time, fadeTime, -1.0, silentFromStart);
  4827. MODIFY_EACH_END
  4828. }
  4829. FORM (MODIFY_Sound_fadeOut, U"Sound: Fade out", U"Sound: Fade out...") {
  4830. CHANNEL (channel, U"Channel (number; 0 = all)", U"1")
  4831. REAL (time, U"Time (s)", U"10000.0")
  4832. REAL (fadeTime, U"Fade time (s)", U"-0.005")
  4833. BOOLEAN (silentToEnd, U"Silent to end", false)
  4834. OK
  4835. DO
  4836. MODIFY_EACH (Sound)
  4837. Sound_fade (me, channel, time, fadeTime, 1, silentToEnd);
  4838. MODIFY_EACH_END
  4839. }
  4840. FORM (NEW_Sound_to_KlattGrid_simple, U"Sound: To KlattGrid (simple)", U"Sound: To KlattGrid (simple)...") {
  4841. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4842. LABEL (U"Formant determination")
  4843. NATURAL (numberOfFormants, U"Max. number of formants", U"5")
  4844. POSITIVE (maximumFormant, U"Maximum formant (Hz)", U"5500 (= adult female)")
  4845. POSITIVE (windowLength, U"Window length (s)", U"0.025")
  4846. POSITIVE (preEmphasisFrequency, U"Pre-emphasis from (Hz)", U"50.0")
  4847. LABEL (U"Pitch determination")
  4848. POSITIVE (pitchFloor, U"Pitch floor (Hz)", U"60.0")
  4849. POSITIVE (pitchCeiling, U"Pitch ceiling (Hz)", U"600.0")
  4850. LABEL (U"Intensity determination")
  4851. POSITIVE (minimumPitch, U"Minimum pitch (Hz)", U"100.0")
  4852. BOOLEAN (subtractMean, U"Subtract mean", true)
  4853. OK
  4854. DO
  4855. CONVERT_EACH (Sound)
  4856. autoKlattGrid result = Sound_to_KlattGrid_simple (me, timeStep, numberOfFormants, maximumFormant, windowLength, preEmphasisFrequency, pitchFloor, pitchCeiling, minimumPitch, subtractMean);
  4857. CONVERT_EACH_END (my name.get())
  4858. }
  4859. FORM (NEW_Sound_to_Pitch_SPINET, U"Sound: To SPINET", U"Sound: To SPINET...") {
  4860. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  4861. POSITIVE (windowLength, U"Window length (s)", U"0.040")
  4862. LABEL (U"Gammatone filter bank")
  4863. POSITIVE (minimumFrequency, U"Minimum filter frequency (Hz)", U"70.0")
  4864. POSITIVE (maximumFrequency, U"Maximum filter frequency (Hz)", U"5000.0")
  4865. NATURAL (numberOfFilters, U"Number of filters", U"250");
  4866. POSITIVE (pitchCeiling, U"Ceiling (Hz)", U"500.0")
  4867. NATURAL (maximumNumberOfCandidates, U"Max. number of candidates", U"15")
  4868. OK
  4869. DO
  4870. Melder_require (minimumFrequency < maximumFrequency, U"The maximum frequency should be greater than the minimum frequency.");
  4871. CONVERT_EACH (Sound)
  4872. autoPitch result = Sound_to_Pitch_SPINET (me, timeStep, windowLength, minimumFrequency, maximumFrequency, numberOfFilters, pitchCeiling, maximumNumberOfCandidates);
  4873. CONVERT_EACH_END (my name.get())
  4874. }
  4875. FORM (NEW_Sound_to_Polygon, U"Sound: To Polygon", U"Sound: To Polygon...") {
  4876. CHANNEL (channel, U"Channel (number, Left, or Right)", U"1")
  4877. praat_TimeFunction_RANGE(fromTime,toTime)
  4878. REAL (ymin, U"left Vertical range", U"0.0")
  4879. REAL (ymax, U"right Vertical range", U"0.0")
  4880. REAL (connectionY, U"Connection y-value", U"0.0")
  4881. OK
  4882. DO
  4883. CONVERT_EACH (Sound)
  4884. channel = channel > my ny ? 1 : channel;
  4885. autoPolygon result = Sound_to_Polygon (me, channel, fromTime, toTime, ymin, ymax, connectionY);
  4886. CONVERT_EACH_END (my name.get())
  4887. }
  4888. FORM (NEW1_Sounds_to_Polygon_enclosed, U"Sounds: To Polygon (enclosed)", U"Sounds: To Polygon (enclosed)...") {
  4889. CHANNEL (channel, U"Channel (number, Left, or Right)", U"1")
  4890. praat_TimeFunction_RANGE(fromTime,toTime)
  4891. REAL (ymin, U"left Vertical range", U"0.0")
  4892. REAL (ymax, U"right Vertical range", U"0.0")
  4893. OK
  4894. DO
  4895. CONVERT_COUPLE (Sound)
  4896. autoPolygon result = Sounds_to_Polygon_enclosed (me, you, channel, fromTime, toTime, ymin, ymax);
  4897. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  4898. }
  4899. FORM (NEW_Sound_filterByGammaToneFilter4, U"Sound: Filter (gammatone)", U"Sound: Filter (gammatone)...") {
  4900. POSITIVE (centreFrequency, U"Centre frequency (Hz)", U"1000.0")
  4901. POSITIVE (bandwidth, U"Bandwidth (Hz)", U"150.0")
  4902. OK
  4903. DO
  4904. CONVERT_EACH (Sound)
  4905. autoSound result = Sound_filterByGammaToneFilter4 (me, centreFrequency, bandwidth);
  4906. CONVERT_EACH_END (my name.get(), U"_filtered")
  4907. }
  4908. FORM (NEW_Sound_removeNoise, U"Sound: Remove noise", U"Sound: Remove noise...") {
  4909. REAL (fromTime, U"left Noise time range (s)", U"0.0")
  4910. REAL (toTime, U"right Noise time range (s)", U"0.0")
  4911. POSITIVE (windowLength, U"Window length (s)", U"0.025")
  4912. LABEL (U"Filter")
  4913. REAL (fromFrequency, U"left Filter frequency range (Hz)", U"80.0")
  4914. REAL (toFrequency, U"right Filter frequency range (Hz)", U"10000.0")
  4915. POSITIVE (smoothingBandwidth, U"Smoothing bandwidth, (Hz)", U"40.0")
  4916. OPTIONMENU (noiseReductionMethod, U"Noise reduction method", 1)
  4917. OPTION (U"Spectral subtraction")
  4918. OK
  4919. DO
  4920. CONVERT_EACH (Sound)
  4921. autoSound result = Sound_removeNoise (me, fromTime, toTime, windowLength, fromFrequency, toFrequency, smoothingBandwidth, noiseReductionMethod);
  4922. CONVERT_EACH_END (my name.get(), U"_denoised")
  4923. }
  4924. FORM (NEW_Sound_changeSpeaker, U"Sound: Change speaker", U"Sound: Change speaker...") {
  4925. LABEL (U"Pitch measurement parameters")
  4926. POSITIVE (pitchFloor, U"Pitch floor (Hz)", U"75.0")
  4927. POSITIVE (pitchCeiling, U"Pitch ceiling (Hz)", U"600.0")
  4928. LABEL (U"Modification parameters")
  4929. POSITIVE (formantMultiplicationFactor, U"Multiply formants by", U"1.2")
  4930. POSITIVE (pitchMultiplicationFactor, U"Multiply pitch by", U"1.0")
  4931. REAL (pitchRangeMultiplicationFactor, U"Multiply pitch range by", U"1.0 (= no change)")
  4932. POSITIVE (durationMultiplicationFactor, U"Multiply duration by", U"1.0")
  4933. OK
  4934. DO
  4935. Melder_require (pitchFloor < pitchCeiling, U"The maximum pitch should be greater than the minimum pitch.");
  4936. CONVERT_EACH (Sound)
  4937. autoSound result = Sound_changeSpeaker (me, pitchFloor, pitchCeiling, formantMultiplicationFactor, pitchMultiplicationFactor, pitchRangeMultiplicationFactor, durationMultiplicationFactor);
  4938. CONVERT_EACH_END (my name.get(), U"_changeSpeaker")
  4939. }
  4940. FORM (NEW_Sound_changeGender, U"Sound: Change gender", U"Sound: Change gender...") {
  4941. LABEL (U"Pitch measurement parameters")
  4942. POSITIVE (pitchFloor, U"Pitch floor (Hz)", U"75.0")
  4943. POSITIVE (pitchCeiling, U"Pitch ceiling (Hz)", U"600.0")
  4944. LABEL (U"Modification parameters")
  4945. POSITIVE (formantShiftRatio, U"Formant shift ratio", U"1.2")
  4946. REAL (pitchMedian, U"New pitch median (Hz)", U"0.0 (= no change)")
  4947. REAL (pitchRangeMultiplicationFactor, U"Pitch range factor", U"1.0 (= no change)")
  4948. POSITIVE (durationMultiplicationFactor, U"Duration factor", U"1.0")
  4949. OK
  4950. DO
  4951. Melder_require (pitchFloor < pitchCeiling, U"The maximum pitch should be greater than the minimum pitch.");
  4952. CONVERT_EACH (Sound)
  4953. autoSound result = Sound_changeGender_old (me, pitchFloor, pitchCeiling, formantShiftRatio, pitchMedian, pitchRangeMultiplicationFactor, durationMultiplicationFactor);
  4954. CONVERT_EACH_END (my name.get(), U"_changeGender");
  4955. }
  4956. FORM (GRAPHICS_Sound_paintWhere, U"Sound paint where", U"Sound: Paint where...") {
  4957. COLOUR (colour, U"Colour (0-1, name, or {r,g,b})", U"0.5")
  4958. praat_TimeFunction_RANGE(fromTime,toTime)
  4959. REAL (ymin, U"left Vertical range", U"0.0")
  4960. REAL (ymax, U"right Vertical range", U"0.0")
  4961. REAL (level, U"Fill from level", U"0.0")
  4962. BOOLEAN (garnish, U"Garnish", true)
  4963. TEXTFIELD (formula, U"Paint only those parts where the following condition holds:", U"1; always")
  4964. OK
  4965. DO
  4966. integer numberOfBisections = 10;
  4967. GRAPHICS_EACH (Sound)
  4968. Sound_paintWhere (me, GRAPHICS, colour, fromTime, toTime, ymin, ymax, level, garnish, numberOfBisections, formula,
  4969. interpreter);
  4970. GRAPHICS_EACH_END
  4971. }
  4972. FORM (GRAPHICS_Sounds_paintEnclosed, U"Sounds paint enclosed", U"Sounds: Paint enclosed...") {
  4973. COLOUR (colour, U"Colour (0-1, name, or {r,g,b})", U"0.5")
  4974. REAL (xFromTime, U"left Horizontal time range (s)", U"0.0")
  4975. REAL (xToTime, U"right Horizontal time range (s)", U"0.0")
  4976. REAL (yFromTime, U"left Vertical time range", U"0.0")
  4977. REAL (yToTime, U"right Vertical time range", U"0.0")
  4978. BOOLEAN (garnish, U"Garnish", true)
  4979. OK
  4980. DO
  4981. GRAPHICS_COUPLE (Sound)
  4982. Sounds_paintEnclosed (me, you, GRAPHICS, colour, xFromTime, xToTime, yFromTime, yToTime, garnish);
  4983. GRAPHICS_COUPLE_END
  4984. }
  4985. FORM_READ (READ1_Sound_readFromRawFileLE, U"Read Sound from raw Little Endian file", nullptr, true) {
  4986. autoSound thee = Sound_readFromRawFile (file, nullptr, 16, 1, 0, 0, 16000.0);
  4987. praat_new (thee.move(), MelderFile_name (file));
  4988. END }
  4989. FORM_READ (READ1_Sound_readFromRawFileBE, U"Read Sound from raw 16-bit Little Endian file", nullptr, true) {
  4990. autoSound thee = Sound_readFromRawFile (file, nullptr, 16, 0, 0, 0, 16000.0);
  4991. praat_new (thee.move(), MelderFile_name (file));
  4992. END }
  4993. FORM_READ (READ1_KlattTable_readFromRawTextFile, U"KlattTable_readFromRawTextFile", nullptr, true) {
  4994. autoKlattTable thee = KlattTable_readFromRawTextFile (file);
  4995. praat_new (thee.move(), MelderFile_name (file));
  4996. END }
  4997. /************ Spectrograms *********************************************/
  4998. FORM (NEW1_Spectrograms_to_DTW, U"Spectrograms: To DTW", nullptr) {
  4999. DTW_constraints_addCommonFields (matchStart, matchEnd, slopeConstraint)
  5000. OK
  5001. DO
  5002. CONVERT_COUPLE (Spectrogram)
  5003. autoDTW result = Spectrograms_to_DTW (me, you, matchStart, matchEnd, slopeConstraint, 1.0);
  5004. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  5005. }
  5006. /**************** Spectrum *******************************************/
  5007. FORM (GRAPHICS_Spectrum_drawPhases, U"Spectrum: Draw phases", U"Spectrum: Draw phases...") {
  5008. REAL (fromFrequency, U"left Frequency range (Hz)", U"0.0")
  5009. REAL (toFrequency, U"right Frequency range (Hz)", U"0.0")
  5010. REAL (fromPhase, U"Minimum phase (dB/Hz)", U"0.0 (= auto)")
  5011. REAL (toPhase, U"Maximum phase (dB/Hz)", U"0.0 (= auto)")
  5012. BOOLEAN (unwrap, U"Unwrap", true)
  5013. BOOLEAN (garnish, U"Garnish", true)
  5014. OK
  5015. DO
  5016. GRAPHICS_EACH (Spectrum)
  5017. Spectrum_drawPhases (me, GRAPHICS, fromFrequency, toFrequency, fromPhase, toPhase, unwrap, garnish);
  5018. GRAPHICS_EACH_END
  5019. }
  5020. FORM (MODIFY_Spectrum_setRealValueInBin, U"Spectrum: Set real value in bin", nullptr) {
  5021. NATURAL (binNumber, U"Bin number", U"100")
  5022. REAL (value, U"Value", U"0.0")
  5023. OK
  5024. DO
  5025. MODIFY_EACH (Spectrum)
  5026. Melder_require (binNumber <= my nx, U"Your bin number should not exceed the number of bins (", my nx, U").");
  5027. my z[1][binNumber]= value;
  5028. MODIFY_EACH_END
  5029. }
  5030. FORM (MODIFY_Spectrum_setImaginaryValueInBin, U"Spectrum: Set imaginary value in bin", nullptr) {
  5031. NATURAL (binNumber, U"Bin number", U"100")
  5032. REAL (value, U"Value", U"0.0")
  5033. OK
  5034. DO
  5035. MODIFY_EACH (Spectrum)
  5036. Melder_require (binNumber <= my nx, U"Your bin number should not exceed the number of bins (", my nx, U").");
  5037. my z[2][binNumber]= value;
  5038. MODIFY_EACH_END
  5039. }
  5040. DIRECT (MODIFY_Spectrum_conjugate) {
  5041. MODIFY_EACH (Spectrum)
  5042. Spectrum_conjugate (me);
  5043. MODIFY_EACH_END
  5044. }
  5045. FORM (NEW_Spectrum_shiftFrequencies, U"Spectrum: Shift frequencies", U"Spectrum: Shift frequencies...") {
  5046. REAL (frequencyShift, U"Shift by (Hz)", U"1000.0")
  5047. POSITIVE (maximumFrequency, U"New maximum frequency (Hz)", U"22050")
  5048. NATURAL (interpolationDepth, U"Interpolation depth", U"50")
  5049. OK
  5050. DO
  5051. CONVERT_EACH (Spectrum)
  5052. autoSpectrum result = Spectrum_shiftFrequencies (me, frequencyShift, maximumFrequency, interpolationDepth);
  5053. CONVERT_EACH_END (my name.get(), ( frequencyShift < 0.0 ? U"_m" : U"_" ), Melder_ifloor (fabs (frequencyShift)))
  5054. }
  5055. DIRECT (NEW_Spectra_multiply) {
  5056. CONVERT_COUPLE (Spectrum)
  5057. autoSpectrum result = Spectra_multiply (me, you);
  5058. CONVERT_COUPLE_END (my name.get(), U"_x_", your name.get())
  5059. }
  5060. FORM (NEW_Spectrum_resample, U"Spectrum: Resample", nullptr) {
  5061. NATURAL (numberOfFrequencies, U"New number of frequencies", U"256")
  5062. OK
  5063. DO
  5064. CONVERT_EACH (Spectrum)
  5065. autoSpectrum result = Spectrum_resample (me, numberOfFrequencies);
  5066. CONVERT_EACH_END (my name.get(), U"_", numberOfFrequencies)
  5067. }
  5068. FORM (NEW_Spectrum_compressFrequencyDomain, U"Spectrum: Compress frequency domain", nullptr) {
  5069. POSITIVE (maximumFrequency, U"Maximum frequency (Hz)", U"5000.0")
  5070. INTEGER (interpolationDepth, U"Interpolation depth", U"50")
  5071. RADIO (scale, U"Interpolation scale", 1)
  5072. RADIOBUTTON (U"Linear")
  5073. RADIOBUTTON (U"Logarithmic")
  5074. OK
  5075. DO
  5076. CONVERT_EACH (Spectrum)
  5077. autoSpectrum result = Spectrum_compressFrequencyDomain (me, maximumFrequency, interpolationDepth, scale, 1);
  5078. CONVERT_EACH_END (my name.get(), U"_", Melder_ifloor (maximumFrequency))
  5079. }
  5080. DIRECT (NEW_Spectrum_unwrap) {
  5081. CONVERT_EACH (Spectrum)
  5082. autoMatrix result = Spectrum_unwrap (me);
  5083. CONVERT_EACH_END (my name.get())
  5084. }
  5085. DIRECT (NEW_Spectrum_to_PowerCepstrum) {
  5086. CONVERT_EACH (Spectrum)
  5087. autoPowerCepstrum result = Spectrum_to_PowerCepstrum (me);
  5088. CONVERT_EACH_END (my name.get())
  5089. }
  5090. DIRECT (NEW_Spectrum_to_Cepstrum) {
  5091. CONVERT_EACH (Spectrum)
  5092. autoCepstrum result = Spectrum_to_Cepstrum (me);
  5093. CONVERT_EACH_END (my name.get())
  5094. }
  5095. /************* SpeechSynthesizer *************************************************/
  5096. DIRECT (HELP_SpeechSynthesizer_help) {
  5097. HELP (U"SpeechSynthesizer")
  5098. }
  5099. FORM (NEW1_ExtractEspeakData, U"SpeechSynthesizer: Extract espeak data", nullptr) {
  5100. OPTIONMENU (which, U"Data", 1)
  5101. OPTION (U"Language properties")
  5102. OPTION (U"Voices properties")
  5103. OK
  5104. DO
  5105. CREATE_ONE
  5106. autoTable result;
  5107. conststring32 name = U"languages";
  5108. if (which == 1) {
  5109. result = Data_copy (espeakdata_languages_propertiesTable.get());
  5110. } else if (which == 2) {
  5111. result = Data_copy (espeakdata_voices_propertiesTable.get());
  5112. name = U"voices";
  5113. }
  5114. CREATE_ONE_END (name)
  5115. }
  5116. FORM (NEW1_SpeechSynthesizer_create, U"Create SpeechSynthesizer", U"Create SpeechSynthesizer...") {
  5117. OPTIONMENUSTR (language_string, U"Language", (int) Strings_findString (espeakdata_languages_names.get(), U"English (Great Britain)"))
  5118. for (integer i = 1; i <= espeakdata_languages_names -> numberOfStrings; i ++) {
  5119. OPTION (espeakdata_languages_names -> strings [i].get());
  5120. }
  5121. OPTIONMENUSTR (voice_string, U"Voice variant", (int) Strings_findString (espeakdata_voices_names.get(), U"Female1"))
  5122. for (integer i = 1; i <= espeakdata_voices_names -> numberOfStrings; i ++) {
  5123. OPTION (espeakdata_voices_names -> strings [i].get());
  5124. }
  5125. OK
  5126. DO
  5127. CREATE_ONE
  5128. int languageIndex, voiceIndex;
  5129. espeakdata_getIndices (language_string, voice_string, & languageIndex, & voiceIndex);
  5130. autoSpeechSynthesizer result = SpeechSynthesizer_create (
  5131. espeakdata_languages_names -> strings [languageIndex].get(),
  5132. espeakdata_voices_names -> strings [voiceIndex].get()
  5133. );
  5134. CREATE_ONE_END (espeakdata_languages_names -> strings [languageIndex].get(), U"_", espeakdata_voices_names -> strings [voiceIndex].get())
  5135. }
  5136. FORM (MODIFY_SpeechSynthesizer_modifyPhonemeSet, U"SpeechSynthesizer: Modify phoneme set", nullptr) {
  5137. OPTIONMENU (phoneneSetIndex, U"Language", (int) Strings_findString (espeakdata_languages_names.get(), U"English (Great Britain)"))
  5138. for (integer i = 1; i <= espeakdata_languages_names -> numberOfStrings; i ++) {
  5139. OPTION (espeakdata_languages_names -> strings [i].get());
  5140. }
  5141. OK
  5142. /* Does not work because me is not defined here.
  5143. int prefPhonemeSet = (int) Strings_findString (espeakdata_languages_names.get(), my d_phonemeSet);
  5144. if (prefPhonemeSet == 0) {
  5145. prefVoice = (int) Strings_findString (espeakdata_languages_names.get(), U"English (Great Britain)");
  5146. }
  5147. SET_OPTION (phoneneSetIndex, prefPhonemeSet)*/
  5148. DO
  5149. MODIFY_EACH (SpeechSynthesizer)
  5150. my d_phonemeSet = Melder_dup (espeakdata_languages_names -> strings [phoneneSetIndex].get());
  5151. MODIFY_EACH_END
  5152. }
  5153. FORM (PLAY_SpeechSynthesizer_playText, U"SpeechSynthesizer: Play text", U"SpeechSynthesizer: Play text...") {
  5154. TEXTFIELD (text, U"Text:", U"This is some text.")
  5155. OK
  5156. DO
  5157. MelderAudio_setOutputMaximumAsynchronicity (kMelder_asynchronicityLevel::INTERRUPTABLE);
  5158. LOOP {
  5159. iam (SpeechSynthesizer);
  5160. SpeechSynthesizer_playText (me, text);
  5161. }
  5162. MelderAudio_setOutputMaximumAsynchronicity (kMelder_asynchronicityLevel::ASYNCHRONOUS);
  5163. END }
  5164. FORM (NEWMANY_SpeechSynthesizer_to_Sound, U"SpeechSynthesizer: To Sound", U"SpeechSynthesizer: To Sound...") {
  5165. TEXTFIELD (text, U"Text:", U"This is some text.")
  5166. BOOLEAN (wantTextGrid, U"Create TextGrid with annotations", false);
  5167. OK
  5168. DO
  5169. CONVERT_EACH (SpeechSynthesizer)
  5170. autoTextGrid tg;
  5171. autoTable t;
  5172. autoSound result = SpeechSynthesizer_to_Sound (me, text, (wantTextGrid ? & tg : nullptr), (Melder_debug == -2 ? & t : nullptr ));
  5173. if (wantTextGrid) {
  5174. praat_new (tg.move(), my name.get());
  5175. }
  5176. if (Melder_debug == -2) {
  5177. praat_new (t.move(), my name.get());
  5178. }
  5179. CONVERT_EACH_END (my name.get())
  5180. }
  5181. DIRECT (INFO_SpeechSynthesizer_getLanguageName) {
  5182. STRING_ONE (SpeechSynthesizer)
  5183. conststring32 result = my d_languageName.get();
  5184. STRING_ONE_END
  5185. }
  5186. DIRECT (INFO_SpeechSynthesizer_getVoiceName) {
  5187. STRING_ONE (SpeechSynthesizer)
  5188. conststring32 result = my d_voiceName.get();
  5189. STRING_ONE_END
  5190. }
  5191. DIRECT (INFO_SpeechSynthesizer_getPhonemeSetName) {
  5192. STRING_ONE (SpeechSynthesizer)
  5193. conststring32 result = my d_phonemeSet.get();
  5194. STRING_ONE_END
  5195. }
  5196. FORM (MODIFY_SpeechSynthesizer_setTextInputSettings, U"SpeechSynthesizer: Set text input settings", U"SpeechSynthesizer: Set text input settings...") {
  5197. OPTIONMENU (inputTextFormat, U"Input text format is", 1)
  5198. OPTION (U"Text only")
  5199. OPTION (U"Phoneme codes only")
  5200. OPTION (U"Mixed with tags")
  5201. OPTIONMENU (inputPhonemeCoding, U"Input phoneme codes are", 1)
  5202. OPTION (U"Kirshenbaum_espeak")
  5203. OK
  5204. DO
  5205. int inputPhonemeCoding_always = SpeechSynthesizer_PHONEMECODINGS_KIRSHENBAUM;
  5206. MODIFY_EACH (SpeechSynthesizer)
  5207. SpeechSynthesizer_setTextInputSettings (me, inputTextFormat, inputPhonemeCoding_always);
  5208. MODIFY_EACH_END
  5209. }
  5210. FORM (MODIFY_SpeechSynthesizer_estimateSpeechRateFromSpeech, U"SpeechSynthesizer: Estimate speech rate from speech", U"SpeechSynthesizer: Estimate speech rate from speech...") {
  5211. BOOLEAN (estimate, U"Estimate speech rate from speech", true);
  5212. OK
  5213. DO
  5214. MODIFY_EACH (SpeechSynthesizer)
  5215. SpeechSynthesizer_setEstimateSpeechRateFromSpeech (me, estimate);
  5216. MODIFY_EACH_END
  5217. }
  5218. FORM (MODIFY_SpeechSynthesizer_speechOutputSettings, U"SpeechSynthesizer: Set speech output settings", U"SpeechSynthesizer: Set speech output settings...") {
  5219. POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"44100.0")
  5220. REAL (wordGap, U"Gap between words (s)", U"0.01")
  5221. POSITIVE (pitchAdjustment, U"Pitch multiplier (0.5-2.0)", U"1.0")
  5222. REAL (pitchRange, U"Pitch range multiplier (0-2.0)", U"1.0");
  5223. POSITIVE (wordsPerMinute, U"Words per minute (80-450)", U"175.0");
  5224. OPTIONMENU (outputPhonemeCodes, U"Output phoneme codes are", 2)
  5225. OPTION (U"Kirshenbaum_espeak")
  5226. OPTION (U"IPA")
  5227. OK
  5228. DO
  5229. if (wordGap < 0.0) wordGap = 0.0;
  5230. Melder_require (pitchAdjustment >= 0.5 && pitchAdjustment <= 2.0, U"The pitch adjustment should be between 0.5 and 2.0.");
  5231. Melder_require (pitchRange >= 0.0 && pitchRange <= 2.0, U"The pitch range multiplier should be between 0.0 and 2.0.");
  5232. MODIFY_EACH (SpeechSynthesizer)
  5233. SpeechSynthesizer_setSpeechOutputSettings (me, samplingFrequency, wordGap, pitchAdjustment, pitchRange, wordsPerMinute, outputPhonemeCodes);
  5234. MODIFY_EACH_END
  5235. }
  5236. FORM (MODIFY_SpeechSynthesizer_setSpeechOutputSettings, U"SpeechSynthesizer: Set speech output settings", U"SpeechSynthesizer: Set speech output settings...") {
  5237. POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"44100.0")
  5238. REAL (wordGap, U"Gap between words (s)", U"0.01")
  5239. INTEGER (pitchAdjustment_0_99, U"Pitch adjustment (0-99)", U"50")
  5240. INTEGER (pitchRange_0_99, U"Pitch range (0-99)", U"50");
  5241. NATURAL (wordsPerMinute, U"Words per minute (80-450)", U"175");
  5242. BOOLEAN (estimateWordsPerMinute, U"Estimate rate from data", true);
  5243. OPTIONMENU (outputPhonemeCodes, U"Output phoneme codes are", 2)
  5244. OPTION (U"Kirshenbaum_espeak")
  5245. OPTION (U"IPA")
  5246. OK
  5247. DO
  5248. if (wordGap < 0) wordGap = 0;
  5249. if (pitchAdjustment_0_99 < 0) pitchAdjustment_0_99 = 0;
  5250. if (pitchAdjustment_0_99 > 99) pitchAdjustment_0_99 = 99;
  5251. if (pitchRange_0_99 < 0) pitchRange_0_99 = 0;
  5252. if (pitchRange_0_99 > 99) pitchRange_0_99 = 99;
  5253. double pitchAdjustment = (1.5/99.0 * pitchAdjustment_0_99 + 0.5);
  5254. double pitchRange = (pitchRange_0_99 / 49.5);
  5255. MODIFY_EACH (SpeechSynthesizer)
  5256. SpeechSynthesizer_setSpeechOutputSettings (me, samplingFrequency, wordGap, pitchAdjustment, pitchRange, wordsPerMinute, outputPhonemeCodes);
  5257. SpeechSynthesizer_setEstimateSpeechRateFromSpeech (me, estimateWordsPerMinute);
  5258. MODIFY_EACH_END
  5259. }
  5260. /************* SpeechSynthesizer and TextGrid ************************/
  5261. FORM (NEWMANY_SpeechSynthesizer_TextGrid_to_Sound, U"SpeechSynthesizer & TextGrid: To Sound", nullptr) {
  5262. NATURAL (tierNumber, U"Tier number", U"1")
  5263. NATURAL (intervalNumber, U"Interval number", U"1")
  5264. BOOLEAN (createAnnotations, U"Create TextGrid with annotations", false);
  5265. OK
  5266. DO
  5267. CONVERT_TWO (SpeechSynthesizer, TextGrid)
  5268. autoTextGrid annotations;
  5269. autoSound result = SpeechSynthesizer_TextGrid_to_Sound (me, you, tierNumber, intervalNumber, (createAnnotations ? & annotations : nullptr ));
  5270. if (createAnnotations) {
  5271. praat_new (annotations.move(), my name.get());
  5272. }
  5273. CONVERT_TWO_END (my name.get())
  5274. }
  5275. FORM (NEW1_SpeechSynthesizer_Sound_TextGrid_align, U"SpeechSynthesizer & Sound & TextGrid: To TextGrid (align)", nullptr) {
  5276. NATURAL (tierNumber, U"Tier number", U"1")
  5277. NATURAL (fromInterval, U"From interval number", U"1")
  5278. NATURAL (toInterval, U"To interval number", U"1")
  5279. REAL (silenceThreshold_dB, U"Silence threshold (dB)", U"-35.0")
  5280. POSITIVE (minimumSilenceDuration, U"Minimum silent interval duration (s)", U"0.1")
  5281. POSITIVE (minimumSoundingDuration, U"Minimum sounding interval duration (s)", U"0.1")
  5282. OK
  5283. DO
  5284. CONVERT_THREE (SpeechSynthesizer, Sound, TextGrid)
  5285. autoTextGrid result = SpeechSynthesizer_Sound_TextGrid_align (me, you, him, tierNumber, fromInterval, toInterval, silenceThreshold_dB, minimumSilenceDuration, minimumSoundingDuration);
  5286. CONVERT_THREE_END (your name.get(), U"_aligned")
  5287. }
  5288. FORM (NEW1_SpeechSynthesizer_Sound_TextGrid_align2, U"SpeechSynthesizer & Sound & TextGrid: To TextGrid (align, trim)", nullptr) {
  5289. NATURAL (tierNumber, U"Tier number", U"1")
  5290. NATURAL (fromInterval, U"From interval number", U"1")
  5291. NATURAL (toInterval, U"To interval number", U"1")
  5292. REAL (silenceThreshold_dB, U"Silence threshold (dB)", U"-35.0")
  5293. POSITIVE (minimumSilenceDuration, U"Minimum silent interval duration (s)", U"0.1")
  5294. POSITIVE (minimumSoundingDuration, U"Minimum sounding interval duration (s)", U"0.1")
  5295. REAL (trimDuration, U"Silence trim duration (s)", U"0.08")
  5296. OK
  5297. DO
  5298. trimDuration = trimDuration < 0.0 ? 0.0 : trimDuration;
  5299. CONVERT_THREE (SpeechSynthesizer, Sound, TextGrid)
  5300. autoTextGrid result = SpeechSynthesizer_Sound_TextGrid_align2 (me, you, him, tierNumber, fromInterval, toInterval, silenceThreshold_dB, minimumSilenceDuration, minimumSoundingDuration, trimDuration);
  5301. CONVERT_THREE_END (his name.get(), U"_aligned")
  5302. }
  5303. /************* Spline *************************************************/
  5304. FORM (GRAPHICS_Spline_drawKnots, U"Spline: Draw knots", nullptr) {
  5305. REAL (xmin, U"Xmin", U"0.0")
  5306. REAL (xmax, U"Xmax", U"0.0")
  5307. REAL (ymin, U"left Vertical range", U"0.0")
  5308. REAL (ymax, U"right Vertical range", U"0.0")
  5309. BOOLEAN (garnish, U"Garnish", true)
  5310. OK
  5311. DO
  5312. GRAPHICS_EACH (Spline)
  5313. Spline_drawKnots (me, GRAPHICS, xmin, xmax, ymin, ymax, garnish);
  5314. GRAPHICS_EACH_END
  5315. }
  5316. DIRECT (INTEGER_Spline_getOrder) {
  5317. INTEGER_ONE (Spline)
  5318. integer result = Spline_getOrder (me);
  5319. INTEGER_ONE_END (U" (order)")
  5320. }
  5321. FORM (NEW_Spline_scaleX, U"Spline: Scale x", U"Spline: Scale x...") {
  5322. LABEL (U"New domain")
  5323. REAL (xmin, U"Xmin", U"-1.0")
  5324. REAL (xmax, U"Xmax", U"1.0")
  5325. OK
  5326. DO
  5327. Melder_require (xmin < xmax, U"Xmin should be less than Xmax.");
  5328. CONVERT_EACH (Spline)
  5329. autoSpline result = Spline_scaleX (me, xmin, xmax);
  5330. CONVERT_EACH_END (my name.get(), U"_scaleX")
  5331. }
  5332. /************ SSCP ***************************************************/
  5333. DIRECT (HELP_SSCP_help) {
  5334. HELP (U"SSCP")
  5335. }
  5336. FORM (GRAPHICS_SSCP_drawConfidenceEllipse, U"SSCP: Draw confidence ellipse", nullptr) {
  5337. POSITIVE (confidenceLevel, U"Confidence level", U"0.95")
  5338. NATURAL (xIndex, U"Index for X-axis", U"1")
  5339. NATURAL (yIndex, U"Index for Y-axis", U"2")
  5340. REAL (xmin, U"left Horizontal range", U"0.0")
  5341. REAL (xmax, U"right Horizontal range", U"0.0")
  5342. REAL (ymin, U"left Vertical range", U"0.0")
  5343. REAL (ymax, U"right Vertical range", U"0.0")
  5344. BOOLEAN (garnish, U"Garnish", true)
  5345. OK
  5346. DO
  5347. GRAPHICS_EACH (SSCP)
  5348. SSCP_drawConcentrationEllipse (me, GRAPHICS, confidenceLevel, 1, xIndex, yIndex, xmin, xmax, ymin, ymax, garnish);
  5349. GRAPHICS_EACH_END
  5350. }
  5351. FORM (GRAPHICS_SSCP_drawSigmaEllipse, U"SSCP: Draw sigma ellipse", U"SSCP: Draw sigma ellipse...") {
  5352. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  5353. NATURAL (xIndex, U"Index for X-axis", U"1")
  5354. NATURAL (yIndex, U"Index for Y-axis", U"2")
  5355. REAL (xmin, U"left Horizontal range", U"0.0")
  5356. REAL (xmax, U"right Horizontal range", U"0.0")
  5357. REAL (ymin, U"left Vertical range", U"0.0")
  5358. REAL (ymax, U"right Vertical range", U"0.0")
  5359. BOOLEAN (garnish, U"Garnish", true)
  5360. OK
  5361. DO
  5362. GRAPHICS_EACH (SSCP)
  5363. SSCP_drawConcentrationEllipse (me, GRAPHICS, numberOfSigmas, 0, xIndex, yIndex, xmin, xmax, ymin, ymax, garnish);
  5364. GRAPHICS_EACH_END
  5365. }
  5366. DIRECT (NEW_SSCP_extractCentroid) {
  5367. CONVERT_EACH (SSCP)
  5368. autoTableOfReal result = SSCP_extractCentroid (me);
  5369. CONVERT_EACH_END (my name.get(), U"_centroid")
  5370. }
  5371. FORM (REAL_SSCP_getConfidenceEllipseArea, U"SSCP: Get confidence ellipse area", U"SSCP: Get confidence ellipse area...") {
  5372. POSITIVE (confidenceLevel, U"Confidence level", U"0.95")
  5373. NATURAL (xIndex, U"Index for X-axis", U"1")
  5374. NATURAL (yIndex, U"Index for Y-axis", U"2")
  5375. OK
  5376. DO
  5377. NUMBER_ONE (SSCP)
  5378. double result = SSCP_getConcentrationEllipseArea (me, confidenceLevel, 1, xIndex, yIndex);
  5379. NUMBER_ONE_END (U" (confidence ellipse area)")
  5380. }
  5381. FORM (REAL_SSCP_getFractionVariation, U"SSCP: Get fraction variation", U"SSCP: Get fraction variation...") {
  5382. NATURAL (fromDimension, U"From dimension", U"1")
  5383. NATURAL (toDimension, U"To dimension", U"1")
  5384. OK
  5385. DO
  5386. NUMBER_ONE (SSCP)
  5387. double result = SSCP_getFractionVariation (me, fromDimension, toDimension);
  5388. NUMBER_ONE_END (U" (fraction)")
  5389. }
  5390. FORM (REAL_SSCP_getConcentrationEllipseArea, U"SSCP: Get sigma ellipse area", U"SSCP: Get sigma ellipse area...") {
  5391. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  5392. NATURAL (xIndex, U"Index for X-axis", U"1")
  5393. NATURAL (yIndex, U"Index for Y-axis", U"2")
  5394. OK
  5395. DO
  5396. NUMBER_ONE (SSCP)
  5397. double result = SSCP_getConcentrationEllipseArea (me, numberOfSigmas, 0, xIndex, yIndex);
  5398. NUMBER_ONE_END (U" (concentation ellipse area)")
  5399. }
  5400. DIRECT (NUMBER_SSCP_getDegreesOfFreedom) {
  5401. NUMBER_ONE (SSCP)
  5402. double result = SSCP_getDegreesOfFreedom (me);
  5403. NUMBER_ONE_END (U" (degrees of freedom)")
  5404. }
  5405. DIRECT (INTEGER_SSCP_getNumberOfObservations) {
  5406. INTEGER_ONE (SSCP)
  5407. integer result = Melder_ifloor (my numberOfObservations); // ppgb: blijf ik raar vinden
  5408. INTEGER_ONE_END (U" (number of observations)")
  5409. }
  5410. DIRECT (REAL_SSCP_getTotalVariance) {
  5411. NUMBER_ONE (SSCP)
  5412. double result = SSCP_getTotalVariance (me);
  5413. NUMBER_ONE_END (U" (total variance)")
  5414. }
  5415. FORM (REAL_SSCP_getCentroidElement, U"SSCP: Get centroid element", U"SSCP: Get centroid element") {
  5416. NATURAL (number, U"Number", U"1")
  5417. OK
  5418. DO
  5419. NUMBER_ONE (SSCP)
  5420. double result = undefined;
  5421. if (number > 0 && number <= my numberOfColumns) {
  5422. result = my centroid [number];
  5423. }
  5424. NUMBER_ONE_END (U" (centroid [", number, U"])")
  5425. }
  5426. DIRECT (REAL_SSCP_getLnDeterminant) {
  5427. NUMBER_ONE (SSCP)
  5428. double result = SSCP_getLnDeterminant (me);
  5429. NUMBER_ONE_END (U" (ln (determinant))")
  5430. }
  5431. FORM (REAL_SSCP_getDiagonality_bartlett, U"SSCP: Get diagonality (bartlett)", U"SSCP: Get diagonality (bartlett)...") {
  5432. NATURAL (numberOfConstraints, U"Number of constraints", U"1")
  5433. OK
  5434. DO
  5435. NUMBER_ONE (SSCP)
  5436. double chisq, result, df;
  5437. SSCP_getDiagonality_bartlett (me, numberOfConstraints, & chisq, & result, & df);
  5438. NUMBER_ONE_END (U" (= probability for chisq = ", chisq, U" and ndf = ", df, U")")
  5439. }
  5440. DIRECT (NEW_SSCP_to_Correlation) {
  5441. CONVERT_EACH (SSCP)
  5442. autoCorrelation result = SSCP_to_Correlation (me);
  5443. CONVERT_EACH_END (my name.get())
  5444. }
  5445. FORM (NEW_SSCP_to_Covariance, U"SSCP: To Covariance", U"SSCP: To Covariance...") {
  5446. NATURAL (numberOfConstraints, U"Number of constraints", U"1")
  5447. OK
  5448. DO
  5449. CONVERT_EACH (SSCP)
  5450. autoCovariance result = SSCP_to_Covariance (me, numberOfConstraints);
  5451. CONVERT_EACH_END (my name.get())
  5452. }
  5453. DIRECT (NEW_SSCP_to_PCA) {
  5454. CONVERT_EACH (SSCP)
  5455. autoPCA result = SSCP_to_PCA (me);
  5456. CONVERT_EACH_END (my name.get())
  5457. }
  5458. /******************* Strings ****************************/
  5459. //DIRECT (NEW1_Strings_createAsEspeakVoices) {
  5460. // //praat_new (nullptr, U"voices"); // TODO ??
  5461. //END }
  5462. FORM (NEW1_Strings_createAsCharacters, U"Strings: Create as characters", nullptr) {
  5463. SENTENCE (text, U"Text", U"intention")
  5464. OK
  5465. DO
  5466. CREATE_ONE
  5467. autoStrings result = Strings_createAsCharacters (text);
  5468. CREATE_ONE_END (U"chars")
  5469. }
  5470. FORM (NEW1_old_Strings_createAsTokens, U"Strings: Create as tokens", nullptr) {
  5471. TEXTFIELD (text, U"Text:", U"There are seven tokens in this text")
  5472. OK
  5473. DO
  5474. CREATE_ONE
  5475. autoStrings result = Strings_createAsTokens (text, U" ");
  5476. CREATE_ONE_END (U"tokens")
  5477. }
  5478. FORM (NEW1_Strings_createAsTokens, U"Strings: Create as tokens", U"Create Strings as tokens...") {
  5479. TEXTFIELD (text, U"Text:", U"There are seven tokens in this text")
  5480. SENTENCE (separators, U"Separators", U" ,")
  5481. OK
  5482. DO_ALTERNATIVE (NEW1_old_Strings_createAsTokens)
  5483. CREATE_ONE
  5484. autoStrings result = Strings_createAsTokens (text, separators);
  5485. CREATE_ONE_END (U"tokens")
  5486. }
  5487. DIRECT (NEW1_Strings_append) {
  5488. CONVERT_LIST (Strings)
  5489. autoStrings result = Strings_append (& list);
  5490. CONVERT_LIST_END (U"appended")
  5491. }
  5492. DIRECT (NEW_Strings_to_Categories) {
  5493. CONVERT_EACH (Strings)
  5494. autoCategories result = Strings_to_Categories (me);
  5495. CONVERT_EACH_END (my name.get())
  5496. }
  5497. FORM (NEW_Strings_change, U"Strings: Change", U"Strings: Change") {
  5498. SENTENCE (search_string, U"Search", U"a")
  5499. SENTENCE (replace_string, U"Replace", U"a")
  5500. INTEGER (replaceLimit, U"Replace limit", U"0 (= unlimited)")
  5501. RADIO (stringType, U"Search and replace are:", 1)
  5502. RADIOBUTTON (U"Literals")
  5503. RADIOBUTTON (U"Regular Expressions")
  5504. OK
  5505. DO
  5506. CONVERT_EACH (Strings)
  5507. integer nmatches, nstringmatches;
  5508. autoStrings result = Strings_change (me, search_string, replace_string, replaceLimit, &nmatches, &nstringmatches, stringType - 1);
  5509. CONVERT_EACH_END (my name.get())
  5510. }
  5511. FORM (NEW_Strings_extractPart, U"Strings: Extract part", nullptr) {
  5512. NATURAL (fromIndex, U"From index", U"1")
  5513. NATURAL (toIndex, U"To index", U"1")
  5514. OK
  5515. DO
  5516. CONVERT_EACH (Strings)
  5517. autoStrings result = Strings_extractPart (me, fromIndex, toIndex);
  5518. CONVERT_EACH_END (my name.get(), U"_part");
  5519. }
  5520. DIRECT (NEW_Strings_to_EditDistanceTable) {
  5521. CONVERT_COUPLE (Strings)
  5522. autoEditDistanceTable result = EditDistanceTable_create (me, you);
  5523. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  5524. }
  5525. FORM (NEW_Strings_to_Permutation, U"Strings: To Permutation", U"Strings: To Permutation...") {
  5526. BOOLEAN (sort, U"Sort", true)
  5527. OK
  5528. DO
  5529. CONVERT_EACH (Strings)
  5530. autoPermutation result = Strings_to_Permutation (me, sort);
  5531. CONVERT_EACH_END (my name.get())
  5532. }
  5533. DIRECT (NEW1_Strings_Permutation_permuteStrings) {
  5534. CONVERT_TWO (Strings, Permutation)
  5535. autoStrings result = Strings_Permutation_permuteStrings (me, you);
  5536. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  5537. }
  5538. /****************************** SVD *****************************************/
  5539. DIRECT (HELP_SVD_help) {
  5540. HELP (U"singular value decomposition")
  5541. }
  5542. DIRECT (INTEGER_SVD_getNumberOfRows) {
  5543. INTEGER_ONE (SVD)
  5544. integer result = my isTransposed ? my numberOfColumns : my numberOfRows;
  5545. INTEGER_ONE_END (U" (number of rows)")
  5546. }
  5547. DIRECT (INTEGER_SVD_getNumberOfColumns) {
  5548. INTEGER_ONE (SVD)
  5549. integer result = my isTransposed ? my numberOfRows : my numberOfColumns;
  5550. INTEGER_ONE_END (U" (= number of columns)")
  5551. }
  5552. DIRECT (REAL_SVD_getConditionNumber) {
  5553. NUMBER_ONE (SVD)
  5554. double result = SVD_getConditionNumber (me);
  5555. NUMBER_ONE_END (U" (= condition number)")
  5556. }
  5557. FORM (REAL_SVD_getSingularValue, U"SVD: Get singular values", nullptr) {
  5558. NATURAL (index, U"Index", U"1")
  5559. OK
  5560. DO
  5561. NUMBER_ONE (SVD)
  5562. Melder_require (index <= my numberOfColumns, U"Index must be in the range [1,", my numberOfColumns, U"].");
  5563. double result = my d [index];
  5564. NUMBER_ONE_END (U" (= singular value [", index, U"])")
  5565. }
  5566. FORM (REAL_SVD_getSumOfSingularValues, U"SVD: Get sum of singular values", nullptr) {
  5567. NATURAL (from, U"From", U"1")
  5568. INTEGER (to, U"To", U"0 (=last)")
  5569. OK
  5570. DO
  5571. NUMBER_ONE (SVD)
  5572. double result = SVD_getSumOfSingularValues (me, from, to);
  5573. NUMBER_ONE_END (U" (sum of singular values)")
  5574. }
  5575. FORM (REAL_SVD_getSumOfSingularValuesAsFractionOfTotal, U"SVD: Get sum of singular values as fraction of total", nullptr) {
  5576. NATURAL (from, U"From", U"1")
  5577. INTEGER (to, U"To", U"0 (=last)")
  5578. OK
  5579. DO
  5580. NUMBER_ONE (SVD)
  5581. double result = SVD_getSumOfSingularValuesAsFractionOfTotal (me, from, to);
  5582. NUMBER_ONE_END (U" (= fraction of total sum of singular values)")
  5583. }
  5584. FORM (INTEGER_SVD_getMinimumNumberOfSingularValues, U"SVD: Get minimum number of singular values", U"SVD: Get minimum number of singular values...") {
  5585. POSITIVE (fraction, U"Fraction of total sum", U"0.95")
  5586. OK
  5587. DO
  5588. Melder_require (fraction <= 1.0, U"Fraction must be a number in (0,1).");
  5589. INTEGER_ONE (SVD)
  5590. integer result = SVD_getMinimumNumberOfSingularValues (me, fraction);
  5591. INTEGER_ONE_END (U" (= number of singular values needed)")
  5592. }
  5593. FORM (NEW_SVD_to_TableOfReal, U"SVD: To TableOfReal", U"SVD: To TableOfReal...") {
  5594. NATURAL (fromComponent, U"First component", U"1")
  5595. INTEGER (toComponent, U"Last component", U"0 (= all)")
  5596. OK
  5597. DO
  5598. CONVERT_EACH (SVD)
  5599. autoTableOfReal result = SVD_to_TableOfReal (me, fromComponent, toComponent);
  5600. CONVERT_EACH_END (my name.get())
  5601. }
  5602. DIRECT (NEW_SVD_extractLeftSingularVectors) {
  5603. LOOP {
  5604. iam (SVD);
  5605. autoTableOfReal result = SVD_extractLeftSingularVectors (me);
  5606. CONVERT_EACH_END (my name.get(), U"_lsv")
  5607. }
  5608. DIRECT (NEW_SVD_extractRightSingularVectors) {
  5609. CONVERT_EACH (SVD)
  5610. autoTableOfReal result = SVD_extractRightSingularVectors (me);
  5611. CONVERT_EACH_END (my name.get(), U"_rsv")
  5612. }
  5613. DIRECT (NEW_SVD_extractSingularValues) {
  5614. CONVERT_EACH (SVD)
  5615. autoTableOfReal result = SVD_extractSingularValues (me);
  5616. CONVERT_EACH_END (my name.get(), U"_sv");
  5617. }
  5618. /******************* Table ****************************/
  5619. DIRECT (NEW1_Table_create_petersonBarney1952) {
  5620. CREATE_ONE
  5621. autoTable result = Table_create_petersonBarney1952 ();
  5622. CREATE_ONE_END (U"pb")
  5623. }
  5624. DIRECT (NEW1_Table_create_polsVanNierop1973) {
  5625. CREATE_ONE
  5626. autoTable result = Table_create_polsVanNierop1973 ();
  5627. CREATE_ONE_END (U"pvn")
  5628. }
  5629. DIRECT (NEW1_Table_create_weenink1983) {
  5630. CREATE_ONE
  5631. autoTable result = Table_create_weenink1983 ();
  5632. CREATE_ONE_END (U"m10w10c10")
  5633. }
  5634. FORM (GRAPHICS_Table_scatterPlotWhere, U"Table: Scatter plot where", nullptr) {
  5635. WORD (xColumn_string, U"Horizontal column", U"")
  5636. REAL (xmin, U"left Horizontal range", U"0.0")
  5637. REAL (xmax, U"right Horizontal range", U"0.0 (= auto)")
  5638. WORD (yColumn_string, U"Vertical column", U"")
  5639. REAL (ymin, U"left Vertical range", U"0.0")
  5640. REAL (ymax, U"right Vertical range", U"0.0 (= auto)")
  5641. WORD (markColumn_string, U"Column with marks", U"")
  5642. NATURAL (fontSize, U"Font size", U"12")
  5643. BOOLEAN (garnish, U"Garnish", true)
  5644. TEXTFIELD (formula, U"Use only data from rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  5645. OK
  5646. DO
  5647. GRAPHICS_EACH (Table)
  5648. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  5649. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5650. integer markColumn = Table_getColumnIndexFromColumnLabel (me, markColumn_string);
  5651. autoTable part = Table_extractRowsWhere (me, formula, interpreter);
  5652. Table_scatterPlot (part.get(), GRAPHICS, xcolumn, ycolumn, xmin, xmax, ymin, ymax, markColumn, fontSize, garnish);
  5653. GRAPHICS_EACH_END
  5654. }
  5655. FORM (GRAPHICS_Table_scatterPlotMarkWhere, U"Scatter plot where (marks)", nullptr) {
  5656. WORD (xColumn_string, U"Horizontal column", U"")
  5657. REAL (xmin, U"left Horizontal range", U"0.0")
  5658. REAL (xmax, U"right Horizontal range", U"0.0 (= auto)")
  5659. WORD (yColumn_string, U"Vertical column", U"")
  5660. REAL (ymin, U"left Vertical range", U"0.0")
  5661. REAL (ymax, U"right Vertical range", U"0.0 (= auto)")
  5662. POSITIVE (markSize_mm, U"Mark size (mm)", U"1.0")
  5663. BOOLEAN (garnish, U"Garnish", true)
  5664. SENTENCE (mark_string, U"Mark string (+xo.)", U"+")
  5665. TEXTFIELD (formula, U"Use only data from rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  5666. OK
  5667. DO
  5668. GRAPHICS_EACH (Table)
  5669. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  5670. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5671. autoTable part = Table_extractRowsWhere (me, formula, interpreter);
  5672. Table_scatterPlot_mark (part.get(), GRAPHICS, xcolumn, ycolumn, xmin, xmax, ymin, ymax, markSize_mm, mark_string, garnish);
  5673. GRAPHICS_EACH_END
  5674. }
  5675. FORM (GRAPHICS_Table_barPlotWhere, U"Table: Bar plot where", U"Table: Bar plot where...") {
  5676. SENTENCE (yColumns_string, U"Vertical column(s)", U"")
  5677. REAL (ymin, U"left Vertical range", U"0.0")
  5678. REAL (ymax, U"right Vertical range", U"0.0 (= auto)")
  5679. SENTENCE (markColumn_string, U"Column with labels", U"")
  5680. LABEL (U"Distances are in units of 'bar width'")
  5681. REAL (distanceFromBorder, U"Distance of first bar from border", U"1.0")
  5682. REAL (distanceBetweenGroups, U"Distance between bar groups", U"1.0")
  5683. REAL (distanceWithinGroup, U"Distance between bars within group", U"0.0")
  5684. SENTENCE (colours, U"Colours", U"Grey")
  5685. REAL (angle, U"Label text angle (degrees)", U"0.0");
  5686. BOOLEAN (garnish, U"Garnish", true)
  5687. TEXTFIELD (formula, U"Use only data from rows where the following condition holds:", U"row >= 1 and row <= 8")
  5688. OK
  5689. DO
  5690. GRAPHICS_EACH (Table)
  5691. Table_barPlotWhere (me, GRAPHICS, yColumns_string, ymin, ymax, markColumn_string, distanceFromBorder, distanceWithinGroup, distanceBetweenGroups, colours, angle, garnish, formula, interpreter);
  5692. GRAPHICS_EACH_END
  5693. }
  5694. FORM (GRAPHICS_Table_LineGraphWhere, U"Table: Line graph where", U"Table: Line graph where...") {
  5695. SENTENCE (yColumn_string, U"Vertical column", U"")
  5696. REAL (ymin, U"left Vertical range", U"0.0")
  5697. REAL (ymax, U"right Vertical range", U"0.0 (= auto)")
  5698. SENTENCE (xColumn_string, U"Horizonal column", U"")
  5699. REAL (xmin, U"left Horizontal range", U"0.0")
  5700. REAL (xmax, U"right Horizontal range", U"0.0 (= auto)")
  5701. WORD (text, U"Text", U"+")
  5702. REAL (angle, U"Label text angle (degrees)", U"0.0");
  5703. BOOLEAN (garnish, U"Garnish", true)
  5704. TEXTFIELD (formula, U"Use only data from rows where the following condition holds:", U"1; (= everything)")
  5705. OK
  5706. DO
  5707. GRAPHICS_EACH (Table)
  5708. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5709. integer xcolumn = Table_findColumnIndexFromColumnLabel (me, xColumn_string);
  5710. Table_lineGraphWhere (me, GRAPHICS, xcolumn, xmin, xmax,ycolumn, ymin, ymax, text, angle, garnish, formula, interpreter);
  5711. GRAPHICS_EACH_END
  5712. }
  5713. FORM (GRAPHICS_Table_boxPlots, U"Table: Box plots", nullptr) {
  5714. WORD (dataColumns_string, U"Data columns", U"F1 F2")
  5715. WORD (factorColumn_string, U"Factor column", U"Sex")
  5716. REAL (ymin, U"left Vertical range", U"0.0")
  5717. REAL (ymax, U"right Vertical range", U"0.0")
  5718. BOOLEAN (garnish, U"Garnish", true);
  5719. OK
  5720. DO
  5721. GRAPHICS_EACH (Table)
  5722. integer factorColumn = Table_getColumnIndexFromColumnLabel (me, factorColumn_string);
  5723. Table_boxPlotsWhere (me, GRAPHICS, dataColumns_string, factorColumn, ymin, ymax, garnish, U"1", interpreter);
  5724. GRAPHICS_EACH_END
  5725. }
  5726. FORM (GRAPHICS_Table_boxPlotsWhere, U"Table: Box plots where", U"Table: Box plots where...") {
  5727. SENTENCE (dataColumns_string, U"Data columns", U"F1 F2")
  5728. WORD (factorColumn_string, U"Factor column", U"")
  5729. REAL (ymin, U"left Vertical range", U"0.0")
  5730. REAL (ymax, U"right Vertical range", U"0.0")
  5731. BOOLEAN (garnish, U"Garnish", true);
  5732. TEXTFIELD (formula, U"Use only data in rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  5733. OK
  5734. DO
  5735. GRAPHICS_EACH (Table)
  5736. integer factorColumn = Table_getColumnIndexFromColumnLabel (me, factorColumn_string);
  5737. Table_boxPlotsWhere (me, GRAPHICS, dataColumns_string, factorColumn, ymin, ymax, garnish, formula, interpreter);
  5738. GRAPHICS_EACH_END
  5739. }
  5740. FORM (GRAPHICS_Table_drawEllipseWhere, U"Draw ellipse (standard deviation)", nullptr) {
  5741. WORD (xColumn_string, U"Horizontal column", U"")
  5742. REAL (xmin, U"left Horizontal range", U"0.0")
  5743. REAL (xmax, U"right Horizontal range", U"0.0 (= auto)")
  5744. WORD (yColumn_string, U"Vertical column", U"")
  5745. REAL (ymin, U"left Vertical range", U"0.0")
  5746. REAL (ymax, U"right Vertical range", U"0.0 (= auto)")
  5747. POSITIVE (numberOfSigmas, U"Number of sigmas", U"2.0")
  5748. BOOLEAN (garnish, U"Garnish", true)
  5749. TEXTFIELD (formula, U"Use only data in rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  5750. OK
  5751. DO
  5752. GRAPHICS_EACH (Table)
  5753. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  5754. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5755. autoTable thee = Table_extractRowsWhere (me, formula, interpreter);
  5756. Table_drawEllipse_e (thee.get(), GRAPHICS, xcolumn, ycolumn, xmin, xmax, ymin, ymax, numberOfSigmas, garnish);
  5757. GRAPHICS_EACH_END
  5758. }
  5759. FORM (GRAPHICS_Table_drawEllipses, U"Table: Draw ellipses", nullptr) {
  5760. WORD (xColumn_string, U"Horizontal column", U"F2")
  5761. REAL (xmin, U"left Horizontal range", U"0.0")
  5762. REAL (xmax, U"right Horizontal range", U"0.0 (= auto)")
  5763. WORD (yColumn_string, U"Vertical column", U"F1")
  5764. REAL (ymin, U"left Vertical range", U"0.0")
  5765. REAL (ymax, U"right Vertical range", U"0.0 (= auto)")
  5766. WORD (factorColumn_string, U"Factor column", U"Vowel")
  5767. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  5768. INTEGER (fontSize, U"Font size", U"12 (0 = no label)")
  5769. BOOLEAN (garnish, U"Garnish", true)
  5770. OK
  5771. DO
  5772. GRAPHICS_EACH (Table)
  5773. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  5774. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5775. integer factorcolumn = Table_getColumnIndexFromColumnLabel (me, factorColumn_string);
  5776. Table_drawEllipsesWhere (me, GRAPHICS, xcolumn, ycolumn, factorcolumn, xmin, xmax, ymin, ymax, numberOfSigmas, fontSize, garnish, U"1", interpreter);
  5777. GRAPHICS_EACH_END
  5778. }
  5779. FORM (GRAPHICS_Table_drawEllipsesWhere, U"Table: Draw ellipses where", nullptr) {
  5780. WORD (xColumn_string, U"Horizontal column", U"F2")
  5781. REAL (xmin, U"left Horizontal range", U"0.0")
  5782. REAL (xmax, U"right Horizontal range", U"0.0 (= auto)")
  5783. WORD (yColumn_string, U"Vertical column", U"F1")
  5784. REAL (ymin, U"left Vertical range", U"0.0")
  5785. REAL (ymax, U"right Vertical range", U"0.0 (= auto)")
  5786. WORD (factorColumn_string, U"Factor column", U"Vowel")
  5787. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  5788. INTEGER (fontSize, U"Font size", U"12 (0 = no label)")
  5789. BOOLEAN (garnish, U"Garnish", true)
  5790. TEXTFIELD (formula, U"Use only data in rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  5791. OK
  5792. DO
  5793. GRAPHICS_EACH (Table)
  5794. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  5795. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5796. integer factorcolumn = Table_getColumnIndexFromColumnLabel (me, factorColumn_string);
  5797. Table_drawEllipsesWhere (me, GRAPHICS, xcolumn, ycolumn, factorcolumn, xmin, xmax, ymin, ymax, numberOfSigmas, fontSize, garnish, formula, interpreter);
  5798. GRAPHICS_EACH_END
  5799. }
  5800. FORM (GRAPHICS_Table_normalProbabilityPlot, U"Table: Normal probability plot", U"Table: Normal probability plot...") {
  5801. WORD (column_string, U"Column", U"F1")
  5802. NATURAL (numberOfQuantiles, U"Number of quantiles", U"100")
  5803. REAL (numberOfSigmas, U"Number of sigmas", U"0.0")
  5804. NATURAL (labelSize, U"Label size", U"12")
  5805. WORD (label, U"Label", U"+")
  5806. BOOLEAN (garnish, U"Garnish", true);
  5807. OK
  5808. DO
  5809. GRAPHICS_EACH (Table)
  5810. integer column = Table_getColumnIndexFromColumnLabel (me, column_string);
  5811. Table_normalProbabilityPlot (me, GRAPHICS, column, numberOfQuantiles, numberOfSigmas, labelSize, label, garnish);
  5812. GRAPHICS_EACH_END
  5813. }
  5814. FORM (GRAPHICS_Table_normalProbabilityPlotWhere, U"Table: Normal probability plot where", U"Table: Normal probability plot...") {
  5815. WORD (column_string, U"Column", U"F0")
  5816. NATURAL (numberOfQuantiles, U"Number of quantiles", U"100")
  5817. REAL (numberOfSigmas, U"Number of sigmas", U"0.0")
  5818. NATURAL (labelSize, U"Label size", U"12")
  5819. WORD (label, U"Label", U"+")
  5820. BOOLEAN (garnish, U"Garnish", true);
  5821. TEXTFIELD (formula, U"Use only data in rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  5822. OK
  5823. DO
  5824. GRAPHICS_EACH (Table)
  5825. integer column = Table_getColumnIndexFromColumnLabel (me, column_string);
  5826. autoTable thee = Table_extractRowsWhere (me, formula, interpreter);
  5827. Table_normalProbabilityPlot (thee.get(), GRAPHICS, column, numberOfQuantiles, numberOfSigmas, labelSize, label, garnish);
  5828. GRAPHICS_EACH_END
  5829. }
  5830. FORM (GRAPHICS_Table_quantileQuantilePlot, U"Table: Quantile-quantile plot", U"Table: Quantile-quantile plot...") {
  5831. WORD (xColumn_string, U"Horizontal axis column", U"")
  5832. WORD (yColumn_string, U"Vertical axis column", U"")
  5833. NATURAL (numberOfQuantiles, U"Number of quantiles", U"100")
  5834. REAL (xmin, U"left Horizontal range", U"0.0")
  5835. REAL (xmax, U"right Horizontal range", U"0.0")
  5836. REAL (ymin, U"left Vertical range", U"0.0")
  5837. REAL (ymax, U"right Vertical range", U"0.0")
  5838. NATURAL (labelSize, U"Label size", U"12")
  5839. WORD (label, U"Label", U"+")
  5840. BOOLEAN (garnish, U"Garnish", true);
  5841. OK
  5842. DO
  5843. GRAPHICS_EACH (Table)
  5844. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  5845. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5846. Table_quantileQuantilePlot (me, GRAPHICS, xcolumn, ycolumn, numberOfQuantiles, xmin, xmax, ymin, ymax, labelSize, label, garnish);
  5847. GRAPHICS_EACH_END
  5848. }
  5849. FORM (GRAPHICS_Table_quantileQuantilePlot_betweenLevels, U"Table: Quantile-quantile plot (between levels)", U"Table: Quantile-quantile plot...") {
  5850. WORD (dataColumn_string, U"Data column", U"F0")
  5851. WORD (factorColumn_string, U"Factor column", U"Sex")
  5852. WORD (xLevel_string, U"Horizontal factor level", U"")
  5853. WORD (yLevelString, U"Vertical factor level", U"")
  5854. NATURAL (numberOfQuantiles, U"Number of quantiles", U"100")
  5855. REAL (xmin, U"left Horizontal range", U"0.0")
  5856. REAL (xmax, U"right Horizontal range", U"0.0")
  5857. REAL (ymin, U"left Vertical range", U"0.0")
  5858. REAL (ymax, U"right Vertical range", U"0.0")
  5859. NATURAL (labelSize, U"Label size", U"12")
  5860. WORD (label, U"Label", U"+")
  5861. BOOLEAN (garnish, U"Garnish", true);
  5862. OK
  5863. DO
  5864. GRAPHICS_EACH (Table)
  5865. integer dataColumn = Table_getColumnIndexFromColumnLabel (me, dataColumn_string);
  5866. integer factorColumn = Table_getColumnIndexFromColumnLabel (me, factorColumn_string);
  5867. Table_quantileQuantilePlot_betweenLevels (me, GRAPHICS, dataColumn, factorColumn, xLevel_string, yLevelString, numberOfQuantiles, xmin, xmax, ymin, ymax, labelSize, label, garnish);
  5868. GRAPHICS_EACH_END
  5869. }
  5870. FORM (GRAPHICS_Table_lagPlot, U"Table: lag plot", nullptr) {
  5871. WORD (dataColumn_string, U"Data column", U"errors")
  5872. NATURAL (lag, U"Lag", U"1")
  5873. REAL (fromXY, U"left Horizontal and vertical range", U"0.0")
  5874. REAL (toXY, U"right Horizontal and vertical range", U"0.0")
  5875. NATURAL (labelSize, U"Label size", U"12")
  5876. WORD (label, U"Label", U"+")
  5877. BOOLEAN (garnish, U"Garnish", true);
  5878. OK
  5879. DO
  5880. GRAPHICS_EACH (Table)
  5881. integer dataColumn = Table_getColumnIndexFromColumnLabel (me, dataColumn_string);
  5882. Table_lagPlotWhere (me, GRAPHICS, dataColumn, lag, fromXY, toXY, label, labelSize, garnish, U"1", interpreter);
  5883. GRAPHICS_EACH_END
  5884. }
  5885. FORM (GRAPHICS_Table_lagPlotWhere, U"Table: lag plot where", nullptr) {
  5886. WORD (dataColumn_string, U"Data column", U"errors")
  5887. NATURAL (lag, U"Lag", U"1")
  5888. REAL (fromXY, U"left Horizontal and vertical range", U"0.0")
  5889. REAL (toXY, U"right Horizontal and vertical range", U"0.0")
  5890. NATURAL (labelSize, U"Label size", U"12")
  5891. WORD (label, U"Label", U"+")
  5892. BOOLEAN (garnish, U"Garnish", true);
  5893. TEXTFIELD (formula, U"Use only data in rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  5894. OK
  5895. DO
  5896. GRAPHICS_EACH (Table)
  5897. integer dataColumn = Table_getColumnIndexFromColumnLabel (me, dataColumn_string);
  5898. Table_lagPlotWhere (me, GRAPHICS, dataColumn, lag, fromXY, toXY, label, labelSize, garnish, formula, interpreter);
  5899. GRAPHICS_EACH_END
  5900. }
  5901. FORM (GRAPHICS_Table_distributionPlot, U"Table: Distribution plot", nullptr) {
  5902. WORD (dataColumn_string, U"Data column", U"data")
  5903. REAL (minimumValue, U"Minimum value", U"0.0")
  5904. REAL (maximumValue, U"Maximum value", U"0.0")
  5905. LABEL (U"Display of the distribution")
  5906. NATURAL (numberOfBins, U"Number of bins", U"10")
  5907. REAL (minimumFrequency, U"Minimum frequency", U"0.0")
  5908. REAL (maximumFrequency, U"Maximum frequency", U"0.0")
  5909. BOOLEAN (garnish, U"Garnish", true)
  5910. OK
  5911. DO
  5912. GRAPHICS_EACH (Table)
  5913. integer dataColumn = Table_getColumnIndexFromColumnLabel (me, dataColumn_string);
  5914. Table_distributionPlotWhere (me, GRAPHICS, dataColumn, minimumValue, maximumValue, numberOfBins, minimumFrequency, maximumFrequency, garnish, U"1", interpreter);
  5915. GRAPHICS_EACH_END
  5916. }
  5917. FORM (GRAPHICS_Table_distributionPlotWhere, U"Table: Distribution plot where", nullptr) {
  5918. WORD (dataColumn_string, U"Data column", U"data")
  5919. REAL (minimumValue, U"Minimum value", U"0.0")
  5920. REAL (maximumValue, U"Maximum value", U"0.0")
  5921. LABEL (U"Display of the distribution")
  5922. NATURAL (numberOfBins, U"Number of bins", U"10")
  5923. REAL (minimumFrequency, U"Minimum frequency", U"0.0")
  5924. REAL (maximumFrequency, U"Maximum frequency", U"0.0")
  5925. BOOLEAN (garnish, U"Garnish", true)
  5926. TEXTFIELD (formula, U"Use only data in rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  5927. OK
  5928. DO
  5929. GRAPHICS_EACH (Table)
  5930. integer dataColumn = Table_getColumnIndexFromColumnLabel (me, dataColumn_string);
  5931. Table_distributionPlotWhere (me, GRAPHICS, dataColumn, minimumValue, maximumValue, numberOfBins, minimumFrequency, maximumFrequency, garnish, formula, interpreter);
  5932. GRAPHICS_EACH_END
  5933. }
  5934. FORM (GRAPHICS_Table_horizontalErrorBarsPlot, U"Table: Horizontal error bars plot", U"Table: Horizontal error bars plot...") {
  5935. WORD (xColumn_string, U"Horizontal column", U"x")
  5936. REAL (xmin, U"left Horizontal range", U"0.0")
  5937. REAL (xmax, U"right Horizontal range", U"0.0")
  5938. WORD (yColumn_string, U"Vertical column", U"y")
  5939. REAL (ymin, U"left Vertical range", U"0.0")
  5940. REAL (ymax, U"right Vertical range", U"0.0")
  5941. WORD (lowerErrorColumn_string, U"Lower error value column", U"error1")
  5942. WORD (upperErrorColumn_string, U"Upper error value column", U"error2")
  5943. REAL (barSize_mm, U"Bar size (mm)", U"1.0")
  5944. BOOLEAN (garnish, U"Garnish", true);
  5945. OK
  5946. DO
  5947. GRAPHICS_EACH (Table)
  5948. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  5949. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5950. integer xl = Table_findColumnIndexFromColumnLabel (me, lowerErrorColumn_string);
  5951. integer xu = Table_findColumnIndexFromColumnLabel (me, upperErrorColumn_string);
  5952. Table_horizontalErrorBarsPlotWhere (me, GRAPHICS, xcolumn, ycolumn, xmin, xmax, ymin, ymax, xl, xu, barSize_mm, garnish, U"1", interpreter);
  5953. GRAPHICS_EACH_END
  5954. }
  5955. FORM (GRAPHICS_Table_horizontalErrorBarsPlotWhere, U"Table: Horizontal error bars plot where", U"Table: Horizontal error bars plot where...") {
  5956. WORD (xColumn_string, U"Horizontal column", U"")
  5957. REAL (xmin, U"left Horizontal range", U"0.0")
  5958. REAL (xmax, U"right Horizontal range", U"0.0")
  5959. WORD (yColumn_string, U"Vertical column", U"")
  5960. REAL (ymin, U"left Vertical range", U"0.0")
  5961. REAL (ymax, U"right Vertical range", U"0.0")
  5962. WORD (lowerErrorColumn_string, U"Lower error value column", U"error1")
  5963. WORD (upperErrorColumn_string, U"Upper error value column", U"error2")
  5964. REAL (barSize_mm, U"Bar size (mm)", U"1.0")
  5965. BOOLEAN (garnish, U"Garnish", true);
  5966. TEXTFIELD (formula, U"Use only data in rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  5967. OK
  5968. DO
  5969. GRAPHICS_EACH (Table)
  5970. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  5971. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5972. integer xl = Table_findColumnIndexFromColumnLabel (me, lowerErrorColumn_string);
  5973. integer xu = Table_findColumnIndexFromColumnLabel (me, upperErrorColumn_string);
  5974. Table_horizontalErrorBarsPlotWhere (me, GRAPHICS, xcolumn, ycolumn, xmin, xmax, ymin, ymax, xl, xu, barSize_mm, garnish, formula, interpreter);
  5975. GRAPHICS_EACH_END
  5976. }
  5977. FORM (GRAPHICS_Table_verticalErrorBarsPlot, U"Table: Vertical error bars plot", U"Table: Vertical error bars plot...") {
  5978. WORD (xColumn_string, U"Horizontal column", U"")
  5979. REAL (xmin, U"left Horizontal range", U"0.0")
  5980. REAL (xmax, U"right Horizontal range", U"0.0")
  5981. WORD (yColumn_string, U"Vertical column", U"")
  5982. REAL (ymin, U"left Vertical range", U"0.0")
  5983. REAL (ymax, U"right Vertical range", U"0.0")
  5984. WORD (lowerErrorColumn_string, U"Lower error value column", U"error1")
  5985. WORD (upperErrorColumn_string, U"Upper error value column", U"error2")
  5986. REAL (barSize_mm, U"Bar size (mm)", U"1.0")
  5987. BOOLEAN (garnish, U"Garnish", true);
  5988. OK
  5989. DO
  5990. GRAPHICS_EACH (Table)
  5991. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  5992. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  5993. integer yl = Table_findColumnIndexFromColumnLabel (me, lowerErrorColumn_string);
  5994. integer yu = Table_findColumnIndexFromColumnLabel (me, upperErrorColumn_string);
  5995. Table_verticalErrorBarsPlotWhere (me, GRAPHICS, xcolumn, ycolumn, xmin, xmax, ymin, ymax, yl, yu, barSize_mm, garnish, U"1", interpreter);
  5996. GRAPHICS_EACH_END
  5997. }
  5998. FORM (GRAPHICS_Table_verticalErrorBarsPlotWhere, U"Table: Vertical error bars plot where", U"Table: Vertical error bars plot where...") {
  5999. WORD (xColumn_string, U"Horizontal column", U"")
  6000. REAL (xmin, U"left Horizontal range", U"0.0")
  6001. REAL (xmax, U"right Horizontal range", U"0.0")
  6002. WORD (yColumn_string, U"Vertical column", U"")
  6003. REAL (ymin, U"left Vertical range", U"0.0")
  6004. REAL (ymax, U"right Vertical range", U"0.0")
  6005. WORD (lowerErrorColumn_string, U"Lower error value column", U"error1")
  6006. WORD (upperErrorColumn_string, U"Upper error value column", U"error2")
  6007. REAL (barSize_mm, U"Bar size (mm)", U"1.0")
  6008. BOOLEAN (garnish, U"Garnish", true);
  6009. TEXTFIELD (formula, U"Use only data in rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  6010. OK
  6011. DO
  6012. GRAPHICS_EACH (Table)
  6013. integer xcolumn = Table_getColumnIndexFromColumnLabel (me, xColumn_string);
  6014. integer ycolumn = Table_getColumnIndexFromColumnLabel (me, yColumn_string);
  6015. integer yl = Table_findColumnIndexFromColumnLabel (me, lowerErrorColumn_string);
  6016. integer yu = Table_findColumnIndexFromColumnLabel (me, upperErrorColumn_string);
  6017. Table_verticalErrorBarsPlotWhere (me, GRAPHICS, xcolumn, ycolumn, xmin, xmax, ymin, ymax, yl, yu, barSize_mm, garnish, formula, interpreter);
  6018. GRAPHICS_EACH_END
  6019. }
  6020. FORM (NEW_Table_extractRowsWhere, U"Table: Extract rows where", nullptr) {
  6021. TEXTFIELD (formula, U"Extract rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  6022. OK
  6023. DO
  6024. CONVERT_EACH (Table)
  6025. autoTable result = Table_extractRowsWhere (me, formula, interpreter);
  6026. CONVERT_EACH_END (my name.get(), U"_formula")
  6027. }
  6028. FORM (NEW_Table_extractRowsMahalanobisWhere, U"Table: Extract rows where (mahalanobis)", nullptr) {
  6029. SENTENCE (dataColumns_string, U"Extract all rows where columns...", U"F1 F2 F3")
  6030. RADIO_ENUM (kMelder_number, haveAMahalanobisDistance,
  6031. U"...have a mahalanobis distance...", kMelder_number::GREATER_THAN)
  6032. REAL (numberOfSigmas, U"...the number", U"2.0")
  6033. WORD (factorColumn_string, U"Factor column", U"")
  6034. TEXTFIELD (formula, U"Process only rows where the following condition holds:", U"1; self$[\"gender\"]=\"male\"")
  6035. OK
  6036. DO
  6037. CONVERT_EACH (Table)
  6038. autoTable result = Table_extractMahalanobisWhere (me, dataColumns_string, factorColumn_string, numberOfSigmas, haveAMahalanobisDistance, formula, interpreter);
  6039. CONVERT_EACH_END (my name.get(), U"_mahalanobis")
  6040. }
  6041. FORM (NEW_Table_extractColumnRanges, U"Table: Extract column ranges", nullptr) {
  6042. TEXTFIELD (columnRanges, U"Create a new Table from the following columns:", U"1 2")
  6043. LABEL (U"To supply rising or falling ranges, use e.g. 2:6 or 5:3.")
  6044. OK
  6045. DO
  6046. CONVERT_EACH (Table)
  6047. autoTable result = Table_extractColumnRanges (me, columnRanges);
  6048. CONVERT_EACH_END (my name.get(), U"_columns")
  6049. }
  6050. /******************* TableOfReal ****************************/
  6051. DIRECT (NEW1_CreateIrisDataset) {
  6052. CREATE_ONE
  6053. autoTableOfReal result = TableOfReal_createIrisDataset ();
  6054. CREATE_ONE_END (U"iris")
  6055. }
  6056. FORM (INFO_TableOfReal_reportMultivariateNormality, U"TableOfReal: Report multivariate normality (BHEP)", U"TableOfReal: Report multivariate normality (BHEP)...") {
  6057. REAL (h, U"Smoothing parameter", U"0.0")
  6058. OK
  6059. DO
  6060. INFO_ONE (TableOfReal)
  6061. double tnb, lnmu, lnvar;
  6062. double prob = TableOfReal_normalityTest_BHEP (me, &h, &tnb, &lnmu, &lnvar);
  6063. MelderInfo_open ();
  6064. MelderInfo_writeLine (U"Baringhaus–Henze–Epps–Pulley normality test:");
  6065. MelderInfo_writeLine (U"Significance of normality: ", prob);
  6066. MelderInfo_writeLine (U"BHEP statistic: ", tnb);
  6067. MelderInfo_writeLine (U"Lognormal mean: ", lnmu);
  6068. MelderInfo_writeLine (U"Lognormal variance: ", lnvar);
  6069. MelderInfo_writeLine (U"Smoothing: ", h);
  6070. MelderInfo_writeLine (U"Sample size: ", my numberOfRows);
  6071. MelderInfo_writeLine (U"Number of variables: ", my numberOfColumns);
  6072. MelderInfo_close ();
  6073. INFO_ONE_END
  6074. }
  6075. DIRECT (NEW1_TableOfReal_Permutation_permuteRows) {
  6076. CONVERT_TWO (TableOfReal, Permutation)
  6077. autoTableOfReal result = TableOfReal_Permutation_permuteRows (me, you);
  6078. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  6079. }
  6080. DIRECT (NEW_TableOfReal_to_Permutation_sortRowlabels) {
  6081. CONVERT_EACH (TableOfReal)
  6082. autoPermutation result = TableOfReal_to_Permutation_sortRowLabels (me);
  6083. CONVERT_EACH_END (my name.get())
  6084. }
  6085. DIRECT (NEW1_TableOfReal_appendColumns) {
  6086. CONVERT_TYPED_LIST (TableOfReal, TableOfRealList)
  6087. autoTableOfReal result = TableOfRealList_appendColumnsMany (list.get());
  6088. CONVERT_TYPED_LIST_END (U"columns_appended");
  6089. }
  6090. FORM (NEW1_TableOfReal_create_pols1973, U"Create TableOfReal (Pols 1973)", U"Create TableOfReal (Pols 1973)...") {
  6091. BOOLEAN (includeFormantAmplitudeLevels, U"Include formant levels", false)
  6092. OK
  6093. DO
  6094. CREATE_ONE
  6095. autoTableOfReal result = TableOfReal_create_pols1973 (includeFormantAmplitudeLevels);
  6096. CREATE_ONE_END (U"pols1973")
  6097. }
  6098. DIRECT (NEW_Table_create_esposito2006) {
  6099. CREATE_ONE
  6100. autoTable result = Table_create_esposito2006 ();
  6101. CREATE_ONE_END (U"esposito2006")
  6102. }
  6103. DIRECT (NEW_Table_create_ganong1980) {
  6104. CREATE_ONE
  6105. autoTable result = Table_create_ganong1980 ();
  6106. CREATE_ONE_END (U"ganong")
  6107. }
  6108. FORM (NEW_TableOfReal_create_vanNierop1973, U"Create TableOfReal (Van Nierop 1973)...", U"Create TableOfReal (Van Nierop 1973)...") {
  6109. BOOLEAN (includeFormantAmplitudeLevels, U"Include formant levels", false)
  6110. OK
  6111. DO
  6112. CREATE_ONE
  6113. autoTableOfReal result = TableOfReal_create_vanNierop1973 (includeFormantAmplitudeLevels);
  6114. CREATE_ONE_END (U"vanNierop1973")
  6115. }
  6116. FORM (NEW_TableOfReal_create_weenink1983, U"Create TableOfReal (Weenink 1985)...", U"Create TableOfReal (Weenink 1985)...") {
  6117. RADIO (speakerGroup, U"Speakers group", 1)
  6118. RADIOBUTTON (U"Men")
  6119. RADIOBUTTON (U"Women")
  6120. RADIOBUTTON (U"Children")
  6121. OK
  6122. DO
  6123. CREATE_ONE
  6124. autoTableOfReal result = TableOfReal_create_weenink1983 (speakerGroup);
  6125. CREATE_ONE_END ((speakerGroup == 1 ? U"m10" : speakerGroup == 2 ? U"w10" : U"c10"));
  6126. }
  6127. DIRECT (NEW_Table_create_sandwell1987) {
  6128. CREATE_ONE
  6129. autoTableOfReal result = TableOfReal_create_sandwell1987 ();
  6130. CREATE_ONE_END (U"Sandwell1987");
  6131. }
  6132. FORM (GRAPHICS_TableOfReal_drawAsScalableSquares, U"TableOfReal: Draw as scalable squares", U"TableOfReal: Draw as scalable squares...") {
  6133. NATURAL (rowmin, U"From row", U"1");
  6134. INTEGER (rowmax, U"To row", U"0 (=all)");
  6135. NATURAL (colmin, U"From column", U"1");
  6136. INTEGER (colmax, U"To column", U"0 (=all)");
  6137. OPTIONMENU_ENUM (kGraphicsMatrixOrigin, origin,
  6138. U"Origin", kGraphicsMatrixOrigin::DEFAULT)
  6139. POSITIVE (scaleFactor, U"Cell area scale factor", U"0.95")
  6140. OPTIONMENU_ENUM (kGraphicsMatrixCellDrawingOrder, drawingOrder,
  6141. U"Filling order", kGraphicsMatrixCellDrawingOrder::DEFAULT)
  6142. BOOLEAN (garnish, U"Garnish", true)
  6143. OK
  6144. DO
  6145. GRAPHICS_EACH (TableOfReal)
  6146. TableOfReal_drawAsScalableSquares (me, GRAPHICS, rowmin, rowmax, colmin, colmax,
  6147. origin, scaleFactor, drawingOrder, garnish);
  6148. GRAPHICS_EACH_END
  6149. }
  6150. FORM (GRAPHICS_TableOfReal_drawScatterPlot, U"TableOfReal: Draw scatter plot", U"TableOfReal: Draw scatter plot...") {
  6151. LABEL (U"Select the part of the table")
  6152. NATURAL (xColumn, U"Horizontal axis column number", U"1")
  6153. NATURAL (yColumn, U"Vertical axis column number", U"2")
  6154. INTEGER (fromRow, U"left Row number range", U"0")
  6155. INTEGER (toRow, U"right Row number range", U"0")
  6156. LABEL (U"Select the drawing area limits")
  6157. REAL (xmin, U"left Horizontal range", U"0.0")
  6158. REAL (xmax, U"right Horizontal range", U"0.0")
  6159. REAL (ymin, U"left Vertical range", U"0.0")
  6160. REAL (ymax, U"right Vertical range", U"0.0")
  6161. NATURAL (labelSize, U"Label size", U"12")
  6162. BOOLEAN (useRowLabels, U"Use row labels", false)
  6163. WORD (label, U"Label", U"+")
  6164. BOOLEAN (garnish, U"Garnish", true)
  6165. OK
  6166. DO
  6167. GRAPHICS_EACH (TableOfReal)
  6168. TableOfReal_drawScatterPlot (me, GRAPHICS, xColumn, yColumn, fromRow, toRow, xmin, xmax, ymin, ymax, labelSize, useRowLabels, label, garnish);
  6169. GRAPHICS_EACH_END
  6170. }
  6171. FORM (GRAPHICS_TableOfReal_drawScatterPlotMatrix, U"TableOfReal: Draw scatter plots matrix", nullptr) {
  6172. INTEGER (fromColumn, U"From column", U"0")
  6173. INTEGER (toColumn, U"To column", U"0")
  6174. POSITIVE (fractionWhite, U"Fraction white", U"0.1")
  6175. OK
  6176. DO
  6177. GRAPHICS_EACH (TableOfReal)
  6178. TableOfReal_drawScatterPlotMatrix (me, GRAPHICS, fromColumn, toColumn, fractionWhite);
  6179. GRAPHICS_EACH_END
  6180. }
  6181. FORM (GRAPHICS_TableOfReal_drawBiplot, U"TableOfReal: Draw biplot", U"TableOfReal: Draw biplot...") {
  6182. LABEL (U"")
  6183. REAL (xmin, U"left Horizontal range", U"0.0")
  6184. REAL (xmax, U"right Horizontal range", U"0.0")
  6185. REAL (ymin, U"left Vertical range", U"0.0")
  6186. REAL (ymax, U"right Vertical range", U"0.0")
  6187. REAL (splitFactor, U"Split factor", U"0.5")
  6188. INTEGER (labelSize, U"Label size", U"10")
  6189. BOOLEAN (garnish, U"Garnish", true)
  6190. OK
  6191. DO
  6192. GRAPHICS_EACH (TableOfReal)
  6193. TableOfReal_drawBiplot (me, GRAPHICS, xmin, xmax, ymin, ymax, splitFactor, labelSize, garnish);
  6194. GRAPHICS_EACH_END
  6195. }
  6196. FORM (GRAPHICS_TableOfReal_drawVectors, U"Draw vectors", U"TableOfReal: Draw vectors...") {
  6197. LABEL (U"From (x1, y1) to (x2, y2)")
  6198. NATURAL (x1Column, U"X1 column", U"1")
  6199. NATURAL (y1Column, U"Y1 column", U"2")
  6200. NATURAL (x2Column, U"X2 column", U"3")
  6201. NATURAL (y2Column, U"Y2 column", U"4")
  6202. LABEL (U"Select the drawing area")
  6203. REAL (xmin, U"left Horizontal range", U"0.0")
  6204. REAL (xmax, U"right Horizontal range", U"0.0")
  6205. REAL (ymin, U"left Vertical range", U"0.0")
  6206. REAL (ymax, U"right Vertical range", U"0.0")
  6207. RADIO (vectorType, U"Vector type", 1)
  6208. RADIOBUTTON (U"Arrow")
  6209. RADIOBUTTON (U"Double arrow")
  6210. RADIOBUTTON (U"Line")
  6211. INTEGER (labelSize, U"Label size", U"10")
  6212. BOOLEAN (garnish, U"Garnish", true)
  6213. OK
  6214. DO
  6215. GRAPHICS_EACH (TableOfReal)
  6216. TableOfReal_drawVectors (me, GRAPHICS, x1Column, y1Column, x2Column, y2Column, xmin, xmax, ymin, ymax, vectorType, labelSize, garnish);
  6217. GRAPHICS_EACH_END
  6218. }
  6219. FORM (GRAPHICS_TableOfReal_drawRowAsHistogram, U"Draw row as histogram", U"TableOfReal: Draw rows as histogram...") {
  6220. LABEL (U"Select from the table")
  6221. WORD (rowNumber, U"Row number", U"1")
  6222. INTEGER (fromColumn, U"left Column range", U"0")
  6223. INTEGER (toColumn, U"right Column range", U"0")
  6224. LABEL (U"Vertical drawing range")
  6225. REAL (ymin, U"left Vertical range", U"0.0")
  6226. REAL (ymax, U"right Vertical range", U"0.0")
  6227. LABEL (U"Offset and distance in units of 'bar width'")
  6228. REAL (xOffset, U"Horizontal offset", U"0.5")
  6229. REAL (distanceBetweenBars, U"Distance between bars", U"1.0")
  6230. WORD (greys, U"Grey value (1=white)", U"0.7")
  6231. BOOLEAN (garnish, U"Garnish", true)
  6232. OK
  6233. DO
  6234. GRAPHICS_EACH (TableOfReal)
  6235. TableOfReal_drawRowsAsHistogram (me, GRAPHICS, rowNumber, fromColumn, toColumn, ymin, ymax, xOffset, 0, distanceBetweenBars, greys, garnish);
  6236. GRAPHICS_EACH_END
  6237. }
  6238. FORM (GRAPHICS_TableOfReal_drawRowsAsHistogram, U"Draw rows as histogram", U"TableOfReal: Draw rows as histogram...") {
  6239. LABEL (U"Select from the table")
  6240. SENTENCE (rowNumbers_string, U"Row numbers", U"1 2")
  6241. INTEGER (fromColumn, U"left Column range", U"0")
  6242. INTEGER (toColumn, U"right Column range", U"0")
  6243. LABEL (U"Vertical drawing range")
  6244. REAL (ymin, U"left Vertical range", U"0.0")
  6245. REAL (ymax, U"right Vertical range", U"0.0")
  6246. LABEL (U"Offset and distance in units of 'bar width'")
  6247. REAL (xOffset, U"Horizontal offset", U"1.0")
  6248. REAL (distanceBetweenBarGroups, U"Distance between bar groups", U"1.0")
  6249. REAL (distanceBetweenBars, U"Distance between bars", U"0.0")
  6250. SENTENCE (greys_string, U"Grey values (1=white)", U"1 1")
  6251. BOOLEAN (garnish, U"Garnish", true)
  6252. OK
  6253. DO
  6254. GRAPHICS_EACH (TableOfReal)
  6255. TableOfReal_drawRowsAsHistogram (me, GRAPHICS, rowNumbers_string, fromColumn, toColumn, ymin, ymax,xOffset, distanceBetweenBars,distanceBetweenBarGroups, greys_string, garnish);
  6256. GRAPHICS_EACH_END
  6257. }
  6258. FORM (GRAPHICS_TableOfReal_drawBoxPlots, U"TableOfReal: Draw box plots", U"TableOfReal: Draw box plots...") {
  6259. INTEGER (fromRow, U"From row", U"0")
  6260. INTEGER (toRow, U"To row", U"0")
  6261. INTEGER (fromColumn, U"From column", U"0")
  6262. INTEGER (toColumn, U"To column", U"0")
  6263. REAL (ymin, U"left Vertical range", U"0.0")
  6264. REAL (ymax, U"right Vertical range", U"0.0")
  6265. BOOLEAN (garnish, U"Garnish", true)
  6266. OK
  6267. DO
  6268. GRAPHICS_EACH (TableOfReal)
  6269. TableOfReal_drawBoxPlots (me, GRAPHICS, fromRow, toRow, fromColumn, toColumn, ymin, ymax, garnish);
  6270. GRAPHICS_EACH_END
  6271. }
  6272. FORM (GRAPHICS_TableOfReal_drawColumnAsDistribution, U"TableOfReal: Draw column as distribution", U"TableOfReal: Draw column as distribution...") {
  6273. NATURAL (columnNumber, U"Column number", U"1")
  6274. REAL (fromValue, U"left Value range", U"0.0")
  6275. REAL (toValue, U"right Value range", U"0.0")
  6276. REAL (fromFrequency, U"left Frequency range", U"0.0")
  6277. REAL (toFrequency, U"right frequency range", U"0.0")
  6278. NATURAL (numberOfBins, U"Number of bins", U"10")
  6279. BOOLEAN (garnish, U"Garnish", true)
  6280. OK
  6281. DO
  6282. GRAPHICS_EACH (TableOfReal)
  6283. TableOfReal_drawColumnAsDistribution (me, GRAPHICS, columnNumber, fromValue, toValue, numberOfBins, fromFrequency, toFrequency, false, garnish);
  6284. GRAPHICS_EACH_END
  6285. }
  6286. FORM (NEW_TableOfReal_to_Configuration_lda, U"TableOfReal: To Configuration (lda)", U"TableOfReal: To Configuration (lda)...") {
  6287. INTEGER (numberOfDimensions, U"Number of dimensions", U"0 (= all)")
  6288. OK
  6289. DO
  6290. Melder_require (numberOfDimensions >= 0, U"The number of dimensions should be at least zero.");
  6291. CONVERT_EACH (TableOfReal)
  6292. autoConfiguration result = TableOfReal_to_Configuration_lda (me, numberOfDimensions);
  6293. CONVERT_EACH_END (my name.get(), U"_lda")
  6294. }
  6295. FORM (NEW_TableOfReal_to_CCA, U"TableOfReal: To CCA", U"TableOfReal: To CCA...") {
  6296. NATURAL (dimensionOfDependentVariate, U"Dimension of dependent variate", U"2")
  6297. OK
  6298. DO
  6299. CONVERT_EACH (TableOfReal)
  6300. autoCCA result = TableOfReal_to_CCA (me, dimensionOfDependentVariate);
  6301. CONVERT_EACH_END (my name.get())
  6302. }
  6303. FORM (NEW_TableOfReal_to_Configuration_pca, U"TableOfReal: To Configuration (pca)", U"TableOfReal: To Configuration (pca)...") {
  6304. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  6305. OK
  6306. DO
  6307. CONVERT_EACH (TableOfReal)
  6308. autoConfiguration result = TableOfReal_to_Configuration_pca (me, numberOfDimensions);
  6309. CONVERT_EACH_END (my name.get(), U"_pca")
  6310. }
  6311. DIRECT (NEW_TableOfReal_to_Discriminant) {
  6312. CONVERT_EACH (TableOfReal)
  6313. autoDiscriminant result = TableOfReal_to_Discriminant (me);
  6314. CONVERT_EACH_END (my name.get())
  6315. }
  6316. DIRECT (NEW_TableOfReal_to_PCA_byRows) {
  6317. CONVERT_EACH (TableOfReal)
  6318. autoPCA result = TableOfReal_to_PCA_byRows (me);
  6319. CONVERT_EACH_END (my name.get())
  6320. }
  6321. FORM (NEW_TableOfReal_to_SSCP, U"TableOfReal: To SSCP", U"TableOfReal: To SSCP...") {
  6322. INTEGER (fromRow, U"Begin row", U"0")
  6323. INTEGER (toRow, U"End row", U"0")
  6324. INTEGER (fromColumn, U"Begin column", U"0")
  6325. INTEGER (toColumn, U"End column", U"0")
  6326. OK
  6327. DO
  6328. CONVERT_EACH (TableOfReal)
  6329. autoSSCP result = TableOfReal_to_SSCP (me, fromRow, toRow, fromColumn, toColumn);
  6330. CONVERT_EACH_END (my name.get())
  6331. }
  6332. /* For the inheritors */
  6333. DIRECT (NEW_TableOfReal_to_TableOfReal) {
  6334. CONVERT_EACH (TableOfReal)
  6335. autoTableOfReal result = TableOfReal_to_TableOfReal (me);
  6336. CONVERT_EACH_END (my name.get())
  6337. }
  6338. DIRECT (NEW_TableOfReal_to_Correlation) {
  6339. CONVERT_EACH (TableOfReal)
  6340. autoCorrelation result = TableOfReal_to_Correlation (me);
  6341. CONVERT_EACH_END (my name.get())
  6342. }
  6343. DIRECT (NEW_TableOfReal_to_Correlation_rank) {
  6344. CONVERT_EACH (TableOfReal)
  6345. autoCorrelation result = TableOfReal_to_Correlation_rank (me);
  6346. CONVERT_EACH_END (my name.get())
  6347. }
  6348. DIRECT (NEW_TableOfReal_to_Covariance) {
  6349. CONVERT_EACH (TableOfReal)
  6350. autoCovariance result = TableOfReal_to_Covariance (me);
  6351. CONVERT_EACH_END (my name.get())
  6352. }
  6353. DIRECT (NEW_TableOfReal_to_SVD) {
  6354. CONVERT_EACH (TableOfReal)
  6355. autoSVD result = TableOfReal_to_SVD (me);
  6356. CONVERT_EACH_END (my name.get())
  6357. }
  6358. DIRECT (NEW1_TablesOfReal_to_Eigen_gsvd) {
  6359. CONVERT_COUPLE (TableOfReal)
  6360. autoEigen result = TablesOfReal_to_Eigen_gsvd (me, you);
  6361. CONVERT_COUPLE_END (U"gsvd");
  6362. }
  6363. FORM (NEW1_TableOfReal_TableOfReal_crossCorrelations, U"TableOfReal & TableOfReal: Cross-correlations", nullptr) {
  6364. OPTIONMENU (between, U"Correlations between", 1)
  6365. OPTION (U"Rows")
  6366. OPTION (U"Columns")
  6367. BOOLEAN (center, U"Center", false)
  6368. BOOLEAN (normalize, U"Normalize", false)
  6369. OK
  6370. DO
  6371. int by_columns = between - 1;
  6372. CONVERT_COUPLE (TableOfReal)
  6373. autoTableOfReal result = TableOfReal_TableOfReal_crossCorrelations (me, you, by_columns, center, normalize);
  6374. CONVERT_COUPLE_END (U"cc_", by_columns ? U"by_cols" : U"by_rows")
  6375. }
  6376. void praat_TableOfReal_init3 (ClassInfo klas);
  6377. void praat_TableOfReal_init3 (ClassInfo klas) {
  6378. praat_TableOfReal_init (klas);
  6379. praat_addAction1 (klas, 2, U"To TableOfReal (cross-correlations)...", 0, 0, NEW1_TableOfReal_TableOfReal_crossCorrelations);
  6380. }
  6381. DIRECT (NEW1_TablesOfReal_to_GSVD) {
  6382. CONVERT_COUPLE (TableOfReal)
  6383. autoGSVD result = TablesOfReal_to_GSVD (me, you);
  6384. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  6385. }
  6386. FORM (NEW_TableOfReal_choleskyDecomposition, U"TableOfReal: Cholesky decomposition", nullptr) {
  6387. BOOLEAN (wantUpper, U"Upper (else L)", false)
  6388. BOOLEAN (wantInverse, U"Inverse", false)
  6389. OK
  6390. DO
  6391. CONVERT_EACH (TableOfReal)
  6392. autoTableOfReal result = TableOfReal_choleskyDecomposition (me, wantUpper, wantInverse);
  6393. CONVERT_EACH_END (my name.get())
  6394. }
  6395. FORM (NEWMANY_TableOfReal_to_PatternList_and_Categories, U"TableOfReal: To PatternList and Categories", U"TableOfReal: To PatternList and Categories...") {
  6396. INTEGER (fromRow, U"left Row range", U"0")
  6397. INTEGER (toRow, U"right Row range", U"0 (= all)")
  6398. INTEGER (fromColumn, U"left Column range", U"0")
  6399. INTEGER (toColumn, U"right Column range", U"0 (= all)")
  6400. OK
  6401. DO
  6402. CONVERT_EACH (TableOfReal)
  6403. autoPatternList ap;
  6404. autoCategories result;
  6405. TableOfReal_to_PatternList_and_Categories (me, fromRow, toRow, fromColumn, toColumn, & ap, & result);
  6406. praat_new (ap.move(), my name.get());
  6407. CONVERT_EACH_END (my name.get())
  6408. }
  6409. FORM (REAL_TableOfReal_getColumnSum, U"TableOfReal: Get column sum", U"") {
  6410. INTEGER (columnNumber, U"Column", U"1")
  6411. OK
  6412. DO
  6413. NUMBER_ONE (TableOfReal)
  6414. double result = TableOfReal_getColumnSum (me, columnNumber);
  6415. NUMBER_ONE_END (U"(column sum)")
  6416. }
  6417. FORM (REAL_TableOfReal_getRowSum, U"TableOfReal: Get row sum", U"") {
  6418. INTEGER (rowNumber, U"Row", U"1")
  6419. OK
  6420. DO
  6421. NUMBER_ONE (TableOfReal)
  6422. double result = TableOfReal_getRowSum (me, rowNumber);
  6423. NUMBER_ONE_END (U"(row sum)")
  6424. }
  6425. DIRECT (REAL_TableOfReal_getGrandSum) {
  6426. NUMBER_ONE (TableOfReal)
  6427. double result = TableOfReal_getGrandSum (me);
  6428. NUMBER_ONE_END (U"(grand sum)")
  6429. }
  6430. FORM (NEW_TableOfReal_meansByRowLabels, U"TableOfReal: Means by row labels", U"TableOfReal: To TableOfReal (means by row labels)...") {
  6431. BOOLEAN (expand, U"Expand", false)
  6432. OK
  6433. DO
  6434. CONVERT_EACH (TableOfReal)
  6435. autoTableOfReal result = TableOfReal_meansByRowLabels (me, expand, 0);
  6436. CONVERT_EACH_END (my name.get(), U"_byrowlabels")
  6437. }
  6438. FORM (NEW_TableOfReal_mediansByRowLabels, U"TableOfReal: Medians by row labels", U"TableOfReal: To TableOfReal (medians by row labels)...") {
  6439. BOOLEAN (expand, U"Expand", false)
  6440. OK
  6441. DO
  6442. CONVERT_EACH (TableOfReal)
  6443. autoTableOfReal result = TableOfReal_meansByRowLabels (me, expand, 1);
  6444. CONVERT_EACH_END (my name.get(), U"_byrowlabels")
  6445. }
  6446. /***** TableOfReal and FilterBank *****/
  6447. FORM (REAL_TextGrid_getTotalDurationOfIntervalsWhere, U"Total duration of intervals where", nullptr) {
  6448. INTEGER (tierNumber, U"Tier number", U"1")
  6449. OPTIONMENU_ENUM (kMelder_string, countIntervalsWhoseLabel___,
  6450. U"Intervals whose label...", kMelder_string::DEFAULT)
  6451. SENTENCE (___theText, U"...the text", U"hi")
  6452. OK
  6453. DO
  6454. NUMBER_ONE (TextGrid)
  6455. double result = TextGrid_getTotalDurationOfIntervalsWhere (me, tierNumber, countIntervalsWhoseLabel___, ___theText);
  6456. NUMBER_ONE_END (U" s (duration of intervals containing \"", ___theText, U"\")");
  6457. }
  6458. FORM (MODIFY_TextGrid_extendTime, U"TextGrid: Extend time", U"TextGrid: Extend time...") {
  6459. LABEL (U"")
  6460. POSITIVE (extendDomainBy, U"Extend domain by (s)", U"1.0")
  6461. RADIO (position, U"At", 1)
  6462. RADIOBUTTON (U"End")
  6463. RADIOBUTTON (U"Start")
  6464. OK
  6465. DO
  6466. MODIFY_EACH (TextGrid)
  6467. TextGrid_extendTime (me, extendDomainBy, position - 1);
  6468. MODIFY_EACH_END
  6469. }
  6470. FORM (MODIFY_TextGrid_replaceIntervalTexts, U"TextGrid: Replace interval text", U"TextGrid: Replace interval text...") {
  6471. LABEL (U"")
  6472. NATURAL (tierNumber, U"Tier number", U"1")
  6473. INTEGER (fromInterval, U"left Interval range", U"0")
  6474. INTEGER (toInterval, U"right Interval range", U"0")
  6475. SENTENCE (search_string, U"Search", U"a")
  6476. SENTENCE (replace_string, U"Replace", U"a")
  6477. RADIO (searchType, U"Search and replace strings are:", 1)
  6478. RADIOBUTTON (U"Literals")
  6479. RADIOBUTTON (U"Regular Expressions")
  6480. OK
  6481. DO
  6482. MODIFY_EACH (TextGrid)
  6483. integer nmatches, nstringmatches;
  6484. TextGrid_changeLabels (me, tierNumber, fromInterval, toInterval, search_string, replace_string, searchType - 1, &nmatches, &nstringmatches);
  6485. MODIFY_EACH_END
  6486. }
  6487. FORM (MODIFY_TextGrid_replacePointTexts, U"TextGrid: Replace point text", U"TextGrid: Replace point text...") {
  6488. LABEL (U"")
  6489. NATURAL (tierNumber, U"Tier number", U"1")
  6490. INTEGER (fromInterval, U"left Interval range", U"0")
  6491. INTEGER (toInterval, U"right Interval range", U"0")
  6492. SENTENCE (search_string, U"Search", U"a")
  6493. SENTENCE (replace_string, U"Replace", U"a")
  6494. RADIO (searchType, U"Search and replace strings are:", 1)
  6495. RADIOBUTTON (U"Literals")
  6496. RADIOBUTTON (U"Regular Expressions")
  6497. OK
  6498. DO
  6499. MODIFY_EACH (TextGrid)
  6500. integer nmatches, nstringmatches;
  6501. TextGrid_changeLabels (me, tierNumber, fromInterval, toInterval, search_string, replace_string, searchType - 1, &nmatches, &nstringmatches);
  6502. MODIFY_EACH_END
  6503. }
  6504. FORM (NEW1_TextGrids_to_Table_textAlignmentment, U"TextGrids: To Table (text alignment)", nullptr) {
  6505. NATURAL (targetTierNumber, U"Target tier", U"1")
  6506. NATURAL (sourceTierNumber, U"Source tier", U"1")
  6507. OK
  6508. DO
  6509. CONVERT_COUPLE (TextGrid)
  6510. autoTable result = TextGrids_to_Table_textAlignmentment (me, targetTierNumber, you, sourceTierNumber, nullptr);
  6511. CONVERT_COUPLE_END (my name.get(), U"_", your name.get());
  6512. }
  6513. FORM (NEW_TextGrid_to_DurationTier, U"TextGrid: To DurationTier", U"TextGrid: To DurationTier...") {
  6514. NATURAL (tierNumber, U"Tier number", U"1")
  6515. POSITIVE (timeScaleFactor, U"Time scale factor", U"2.0")
  6516. POSITIVE (leftTransitionDuration, U"Left transition duration (s)", U"1e-10")
  6517. POSITIVE (rightTransitionDuration, U"Right transition duration (s)", U"1e-10")
  6518. OPTIONMENU_ENUM (kMelder_string, scaleIntervalsWhoseLabel___,
  6519. U"Scale intervals whose label... ", kMelder_string::DEFAULT)
  6520. SENTENCE (___theText, U"...the text", U"hi")
  6521. OK
  6522. DO
  6523. CONVERT_EACH (TextGrid)
  6524. autoDurationTier result = TextGrid_to_DurationTier (me,tierNumber, timeScaleFactor,
  6525. leftTransitionDuration, rightTransitionDuration, scaleIntervalsWhoseLabel___, ___theText);
  6526. CONVERT_EACH_END (my name.get())
  6527. }
  6528. DIRECT (NEW_TextGrid_DurationTier_to_TextGrid) {
  6529. CONVERT_TWO (TextGrid, DurationTier)
  6530. autoTextGrid result = TextGrid_DurationTier_scaleTimes (me, you);
  6531. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  6532. }
  6533. FORM (NEW1_TextGrids_EditCostsTable_to_Table_textAlignmentment, U"TextGrids & EditCostsTable: To Table(text alignmentment)", nullptr) {
  6534. NATURAL (targetTierNumber, U"Target tier", U"1")
  6535. NATURAL (sourceTierNumber, U"Source tier", U"1")
  6536. OK
  6537. DO
  6538. CONVERT_COUPLE_AND_ONE (TextGrid, EditCostsTable)
  6539. autoTable result = TextGrids_to_Table_textAlignmentment (me, targetTierNumber, you, sourceTierNumber, him);
  6540. CONVERT_COUPLE_AND_ONE_END (my name.get(), U"_", your name.get())
  6541. }
  6542. FORM (MODIFY_TextGrid_setTierName, U"TextGrid: Set tier name", U"TextGrid: Set tier name...") {
  6543. NATURAL (tierNUmber, U"Tier number:", U"1")
  6544. SENTENCE (name, U"Name", U"");
  6545. OK
  6546. DO
  6547. MODIFY_EACH (TextGrid)
  6548. TextGrid_setTierName (me, tierNUmber, name);
  6549. MODIFY_EACH_END
  6550. }
  6551. static void cb_publish (Editor /*editor*/, autoDaata publish) {
  6552. try {
  6553. praat_new (publish.move(), U"");
  6554. praat_updateSelection ();
  6555. } catch (MelderError) {
  6556. Melder_flushError ();
  6557. }
  6558. }
  6559. DIRECT (WINDOW_VowelEditor_create) {
  6560. if (theCurrentPraatApplication -> batch) {
  6561. Melder_throw (U"Cannot edit from batch.");
  6562. }
  6563. autoVowelEditor vowelEditor = VowelEditor_create (U"VowelEditor", nullptr);
  6564. Editor_setPublicationCallback (vowelEditor.get(), cb_publish);
  6565. vowelEditor.releaseToUser();
  6566. END }
  6567. static autoDaata cmuAudioFileRecognizer (integer nread, const char *header, MelderFile file) {
  6568. return nread < 12 || header [0] != 6 || header [1] != 0 ?
  6569. autoSound () : Sound_readFromCmuAudioFile (file);
  6570. }
  6571. void praat_CC_init (ClassInfo klas) {
  6572. praat_addAction1 (klas, 1, U"Paint...", nullptr, 1, GRAPHICS_CC_paint);
  6573. praat_addAction1 (klas, 1, U"Draw...", nullptr, 1, GRAPHICS_CC_drawC0);
  6574. praat_addAction1 (klas, 1, QUERY_BUTTON, nullptr, 0, 0);
  6575. praat_TimeFrameSampled_query_init (klas);
  6576. praat_addAction1 (klas, 1, U"Get number of coefficients...", nullptr, 1, INTEGER_CC_getNumberOfCoefficients);
  6577. praat_addAction1 (klas, 1, U"Get value in frame...", nullptr, 1, REAL_CC_getValueInFrame);
  6578. praat_addAction1 (klas, 1, U"Get c0 value in frame...", nullptr, 1, REAL_CC_getC0ValueInFrame);
  6579. praat_addAction1 (klas, 1, U"Get value...", nullptr, praat_HIDDEN + praat_DEPTH_1, REAL_CC_getValue);
  6580. praat_addAction1 (klas, 0, U"To Matrix", nullptr, 0, NEW_CC_to_Matrix);
  6581. praat_addAction1 (klas, 2, U"To DTW...", nullptr, 0, NEW1_CCs_to_DTW);
  6582. }
  6583. static void praat_Eigen_Matrix_project (ClassInfo klase, ClassInfo klasm); // deprecated 2014
  6584. static void praat_Eigen_Matrix_project (ClassInfo klase, ClassInfo klasm) {
  6585. praat_addAction2 (klase, 1, klasm, 1, U"Project...", nullptr, praat_HIDDEN, NEW1_Eigen_Matrix_projectColumns);
  6586. praat_addAction2 (klase, 1, klasm, 1, U"To Matrix (project columns)...", nullptr, praat_HIDDEN, NEW1_Eigen_Matrix_projectColumns);
  6587. }
  6588. static void praat_Eigen_Spectrogram_project (ClassInfo klase, ClassInfo klasm);
  6589. static void praat_Eigen_Spectrogram_project (ClassInfo klase, ClassInfo klasm) {
  6590. praat_addAction2 (klase, 1, klasm, 1, U"Project...", nullptr, praat_HIDDEN, NEW1_Eigen_Matrix_projectColumns);
  6591. praat_addAction2 (klase, 1, klasm, 1, U"To Matrix (project columns)...", nullptr, 0, NEW1_Eigen_Matrix_projectColumns);
  6592. }
  6593. static void praat_Eigen_query_init (ClassInfo klas) {
  6594. praat_addAction1 (klas, 1, U"Get eigenvalue...", nullptr, 1, REAL_Eigen_getEigenvalue);
  6595. praat_addAction1 (klas, 1, U"Get sum of eigenvalues...", nullptr, 1, REAL_Eigen_getSumOfEigenvalues);
  6596. praat_addAction1 (klas, 1, U"Get number of eigenvectors", nullptr, 1, INTEGER_Eigen_getNumberOfEigenvectors);
  6597. praat_addAction1 (klas, 1, U"Get eigenvector dimension", nullptr, 1, INTEGER_Eigen_getEigenvectorDimension);
  6598. praat_addAction1 (klas, 1, U"Get eigenvector element...", nullptr, 1, REAL_Eigen_getEigenvectorElement);
  6599. }
  6600. static void praat_Eigen_draw_init (ClassInfo klas) {
  6601. praat_addAction1 (klas, 0, U"Draw eigenvalues...", nullptr, 1,GRAPHICS_Eigen_drawEigenvalues);
  6602. praat_addAction1 (klas, 0, U"Draw eigenvalues (scree)...", U"*Draw eigenvalues...", praat_DEPRECATED_2010 | praat_DEPTH_1, GRAPHICS_Eigen_drawEigenvalues_scree);
  6603. praat_addAction1 (klas, 0, U"Draw eigenvector...", nullptr, 1, GRAPHICS_Eigen_drawEigenvector);
  6604. }
  6605. static void praat_Index_init (ClassInfo klas) {
  6606. praat_addAction1 (klas, 1, U"Get number of classes", nullptr, 0, INTEGER_Index_getNumberOfClasses);
  6607. praat_addAction1 (klas, 1, U"To Permutation...", nullptr, 0, NEW_Index_to_Permutation);
  6608. praat_addAction1 (klas, 1, U"Extract part...", nullptr, 0, NEW_Index_extractPart);
  6609. }
  6610. static void praat_BandFilterSpectrogram_draw_init (ClassInfo klas);
  6611. static void praat_BandFilterSpectrogram_draw_init (ClassInfo klas) {
  6612. praat_addAction1 (klas, 0, DRAW_BUTTON, nullptr, 0, nullptr);
  6613. // praat_addAction1 (klas, 0, U"Paint image...", nullptr, praat_DEPTH_1, DO_BandFilterSpectrogram_paintImage);
  6614. // praat_addAction1 (klas, 0, U"Draw filters...", nullptr, 1, DO_FilterBank_drawFilters);
  6615. // praat_addAction1 (klas, 0, U"Draw one contour...", nullptr, 1, DO_FilterBank_drawOneContour);
  6616. // praat_addAction1 (klas, 0, U"Draw contours...", nullptr, 1, DO_FilterBank_drawContours);
  6617. // praat_addAction1 (klas, 0, U"Paint contours...", nullptr, 1, DO_FilterBank_paintContours);
  6618. // praat_addAction1 (klas, 0, U"Paint cells...", nullptr, 1, DO_FilterBank_paintCells);
  6619. // praat_addAction1 (klas, 0, U"Paint surface...", nullptr, 1, DO_FilterBank_paintSurface);
  6620. praat_addAction1 (klas, 0, U"-- frequency scales --", nullptr, 1, nullptr);
  6621. praat_addAction1 (klas, 0, U"Draw frequency scale...", nullptr, 1, GRAPHICS_BandFilterSpectrogram_drawFrequencyScale);
  6622. }
  6623. static void praat_FilterBank_query_init (ClassInfo klas);
  6624. static void praat_FilterBank_query_init (ClassInfo klas) {
  6625. praat_addAction1 (klas, 0, QUERY_BUTTON, nullptr, 0, 0);
  6626. praat_TimeFrameSampled_query_init (klas);
  6627. praat_addAction1 (klas, 1, U"Get time from column...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, REAL_FilterBank_getTimeFromColumn);
  6628. praat_addAction1 (klas, 1, U"-- frequencies --", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, 0);
  6629. praat_addAction1 (klas, 1, U"Get lowest frequency", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, REAL_FilterBank_getLowestFrequency);
  6630. praat_addAction1 (klas, 1, U"Get highest frequency", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, REAL_FilterBank_getHighestFrequency);
  6631. praat_addAction1 (klas, 1, U"Get number of frequencies", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, INTEGER_FilterBank_getNumberOfFrequencies);
  6632. praat_addAction1 (klas, 1, U"Get frequency distance", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, REAL_FilterBank_getFrequencyDistance);
  6633. praat_addAction1 (klas, 1, U"Get frequency from row...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, REAL_FilterBank_getFrequencyFromRow);
  6634. praat_addAction1 (klas, 1, U"-- get value --", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, 0);
  6635. praat_addAction1 (klas, 1, U"Get value in cell...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, REAL_FilterBank_getValueInCell);
  6636. praat_addAction1 (klas, 0, U"-- frequency scales --", nullptr, praat_DEPTH_1, 0);
  6637. praat_addAction1 (klas, 1, U"Get frequency in Hertz...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, REAL_FilterBank_getFrequencyInHertz);
  6638. praat_addAction1 (klas, 1, U"Get frequency in Bark...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, REAL_FilterBank_getFrequencyInBark);
  6639. praat_addAction1 (klas, 1, U"Get frequency in mel...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, REAL_FilterBank_getFrequencyInMel);
  6640. }
  6641. static void praat_FilterBank_modify_init (ClassInfo klas);
  6642. static void praat_FilterBank_modify_init (ClassInfo klas) {
  6643. // praat_addAction1 (klas, 0, MODIFY_BUTTON, nullptr, 0, 0);
  6644. praat_addAction1 (klas, 0, U"Equalize intensities...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, MODIFY_FilterBank_equalizeIntensities);
  6645. }
  6646. static void praat_FilterBank_draw_init (ClassInfo klas);
  6647. static void praat_FilterBank_draw_init (ClassInfo klas) {
  6648. // praat_addAction1 (klas, 0, DRAW_BUTTON, 0, 0, 0);
  6649. praat_addAction1 (klas, 0, U"Draw filters...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, GRAPHICS_FilterBank_drawFilters);
  6650. praat_addAction1 (klas, 0, U"Draw one contour...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, GRAPHICS_FilterBank_drawOneContour);
  6651. praat_addAction1 (klas, 0, U"Draw contours...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, GRAPHICS_FilterBank_drawContours);
  6652. praat_addAction1 (klas, 0, U"Paint image...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, GRAPHICS_FilterBank_paintImage);
  6653. praat_addAction1 (klas, 0, U"Paint contours...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, GRAPHICS_FilterBank_paintContours);
  6654. praat_addAction1 (klas, 0, U"Paint cells...", nullptr,praat_DEPRECATED_2014 | praat_DEPTH_1, GRAPHICS_FilterBank_paintCells);
  6655. praat_addAction1 (klas, 0, U"Paint surface...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, GRAPHICS_FilterBank_paintSurface);
  6656. praat_addAction1 (klas, 0, U"-- frequency scales --", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, 0);
  6657. praat_addAction1 (klas, 0, U"Draw frequency scales...", nullptr, praat_DEPRECATED_2014 | praat_DEPTH_1, GRAPHICS_FilterBank_drawFrequencyScales);
  6658. }
  6659. static void praat_FilterBank_all_init (ClassInfo klas);
  6660. static void praat_FilterBank_all_init (ClassInfo klas) {
  6661. praat_FilterBank_draw_init (klas);
  6662. praat_FilterBank_query_init (klas);
  6663. praat_FilterBank_modify_init (klas);
  6664. praat_addAction1 (klas, 0, U"To Intensity", nullptr, praat_DEPRECATED_2014, NEW_FilterBank_to_Intensity);
  6665. praat_addAction1 (klas, 0, U"To Matrix", nullptr, praat_DEPRECATED_2014, NEW_FilterBank_to_Matrix);
  6666. praat_addAction1 (klas, 2, U"Cross-correlate...", nullptr, praat_DEPRECATED_2014, NEW1_FilterBanks_crossCorrelate);
  6667. praat_addAction1 (klas, 2, U"Convolve...", nullptr, praat_DEPRECATED_2014, NEW1_FilterBanks_convolve);
  6668. }
  6669. static void praat_FunctionTerms_init (ClassInfo klas) {
  6670. praat_addAction1 (klas, 0, DRAW_BUTTON, nullptr, 0, 0);
  6671. praat_addAction1 (klas, 0, U"Draw...", nullptr, 1, GRAPHICS_FunctionTerms_draw);
  6672. praat_addAction1 (klas, 0, U"Draw basis function...", nullptr, 1, GRAPHICS_FunctionTerms_drawBasisFunction);
  6673. praat_addAction1 (klas, 0, QUERY_BUTTON, nullptr, 0, 0);
  6674. praat_addAction1 (klas, 1, U"Get number of coefficients", nullptr, 1, INTEGER_FunctionTerms_getNumberOfCoefficients);
  6675. praat_addAction1 (klas, 1, U"Get coefficient...", nullptr, 1, REAL_FunctionTerms_getCoefficient);
  6676. praat_addAction1 (klas, 1, U"Get degree", nullptr, 1, INTEGER_FunctionTerms_getDegree);
  6677. praat_addAction1 (klas, 0, U"-- function specifics --", nullptr, 1, 0);
  6678. praat_addAction1 (klas, 1, U"Get value...", nullptr, 1, REAL_FunctionTerms_getValue);
  6679. praat_addAction1 (klas, 1, U"Get minimum...", nullptr, 1, REAL_FunctionTerms_getMinimum);
  6680. praat_addAction1 (klas, 1, U"Get x of minimum...", nullptr, 1, REAL_FunctionTerms_getXOfMinimum);
  6681. praat_addAction1 (klas, 1, U"Get maximum...", nullptr, 1, REAL_FunctionTerms_getMaximum);
  6682. praat_addAction1 (klas, 1, U"Get x of maximum...", nullptr, 1, REAL_FunctionTerms_getXOfMaximum);
  6683. praat_addAction1 (klas, 0, U"Modify -", nullptr, 0, 0);
  6684. praat_addAction1 (klas, 1, U"Set domain...", nullptr, 1, MODIFY_FunctionTerms_setDomain);
  6685. praat_addAction1 (klas, 1, U"Set coefficient...", nullptr, 1, MODIFY_FunctionTerms_setCoefficient);
  6686. praat_addAction1 (klas, 0, U"Analyse", nullptr, 0, 0);
  6687. }
  6688. /* Query buttons for frame-based frequency x time subclasses of matrix. */
  6689. void praat_BandFilterSpectrogram_query_init (ClassInfo klas) {
  6690. praat_TimeFrameSampled_query_init (klas);
  6691. praat_addAction1 (klas, 1, U"Get time from column...", nullptr, 1, REAL_BandFilterSpectrogram_getTimeFromColumn);
  6692. praat_addAction1 (klas, 1, U"-- frequencies --", nullptr, 1, 0);
  6693. praat_addAction1 (klas, 1, U"Get lowest frequency", nullptr, 1, REAL_BandFilterSpectrogram_getLowestFrequency);
  6694. praat_addAction1 (klas, 1, U"Get highest frequency", nullptr, 1, REAL_BandFilterSpectrogram_getHighestFrequency);
  6695. praat_addAction1 (klas, 1, U"Get number of frequencies", nullptr, 1, INTEGER_BandFilterSpectrogram_getNumberOfFrequencies);
  6696. praat_addAction1 (klas, 1, U"Get frequency distance", nullptr, 1, REAL_BandFilterSpectrogram_getFrequencyDistance);
  6697. praat_addAction1 (klas, 1, U"Get frequency from row...", nullptr, 1, REAL_BandFilterSpectrogram_getFrequencyFromRow);
  6698. praat_addAction1 (klas, 1, U"-- get value --", nullptr, 1, 0);
  6699. praat_addAction1 (klas, 1, U"Get value in cell...", nullptr, 1, REAL_BandFilterSpectrogram_getValueInCell);
  6700. }
  6701. static void praat_PatternList_query_init (ClassInfo klas) {
  6702. praat_addAction1 (klas, 0, QUERY_BUTTON, nullptr, 0, 0);
  6703. praat_addAction1 (klas, 1, U"Get number of patterns", nullptr, 1, INTEGER_PatternList_getNumberOfPatterns);
  6704. praat_addAction1 (klas, 1, U"Get pattern size", nullptr, 1, INTEGER_PatternList_getPatternSize);
  6705. praat_addAction1 (klas, 1, U"Get value...", nullptr, 1, REAL_PatternList_getValue);
  6706. }
  6707. static void praat_Spline_init (ClassInfo klas) {
  6708. praat_FunctionTerms_init (klas);
  6709. praat_addAction1 (klas, 0, U"Draw knots...", U"Draw basis function...", 1, GRAPHICS_Spline_drawKnots);
  6710. praat_addAction1 (klas, 1, U"Get order", U"Get degree", 1, INTEGER_Spline_getOrder);
  6711. praat_addAction1 (klas, 1, U"Scale x...", U"Analyse", 0, NEW_Spline_scaleX);
  6712. }
  6713. static void praat_SSCP_query_init (ClassInfo klas) {
  6714. praat_addAction1 (klas, 1, U"-- statistics --", U"Get value...", 1, 0);
  6715. praat_addAction1 (klas, 1, U"Get number of observations", U"-- statistics --", 1, INTEGER_SSCP_getNumberOfObservations);
  6716. praat_addAction1 (klas, 1, U"Get degrees of freedom", U"Get number of observations", 1, NUMBER_SSCP_getDegreesOfFreedom);
  6717. praat_addAction1 (klas, 1, U"Get centroid element...", U"Get degrees of freedom", 1, REAL_SSCP_getCentroidElement);
  6718. praat_addAction1 (klas, 1, U"Get ln(determinant)", U"Get centroid element...", 1, REAL_SSCP_getLnDeterminant);
  6719. }
  6720. static void praat_SSCP_extract_init (ClassInfo klas) {
  6721. praat_addAction1 (klas, 1, U"Extract centroid", EXTRACT_BUTTON, 1, NEW_SSCP_extractCentroid);
  6722. }
  6723. FORM (MODIFY_SSCP_setValue, U"Covariance: Set value", U"Covariance: Set value...") {
  6724. NATURAL (rowNumber, U"Row number", U"1")
  6725. NATURAL (columnNumber, U"Column number", U"1")
  6726. REAL (value, U"New value", U"1.0")
  6727. OK
  6728. DO
  6729. MODIFY_EACH (SSCP)
  6730. SSCP_setValue (me, rowNumber, columnNumber, value);
  6731. MODIFY_EACH_END
  6732. }
  6733. FORM (MODIFY_SSCP_setCentroid, U"", nullptr) {
  6734. NATURAL (elementNumber, U"Element number", U"1")
  6735. REAL (value, U"New value", U"1.0")
  6736. OK
  6737. DO
  6738. MODIFY_EACH (SSCP)
  6739. SSCP_setCentroid (me, elementNumber, value);
  6740. MODIFY_EACH_END
  6741. }
  6742. void praat_SSCP_as_TableOfReal_init (ClassInfo klas) {
  6743. praat_TableOfReal_init (klas);
  6744. praat_removeAction (klas, nullptr, nullptr, U"Set value...");
  6745. praat_addAction1 (klas, 1, U"Set centroid...", U"Formula...", 1, MODIFY_SSCP_setCentroid);
  6746. praat_addAction1 (klas, 1, U"Set value...", U"Formula...", 1, MODIFY_SSCP_setValue);
  6747. praat_addAction1 (klas, 0, U"To TableOfReal", U"To Matrix", 1, NEW_TableOfReal_to_TableOfReal);
  6748. }
  6749. void praat_TableOfReal_init2 (ClassInfo klas) {
  6750. praat_TableOfReal_init (klas);
  6751. praat_addAction1 (klas, 0, U"To TableOfReal", U"To Matrix", 1, NEW_TableOfReal_to_TableOfReal);
  6752. }
  6753. void praat_EditDistanceTable_as_TableOfReal_init (ClassInfo klas) {
  6754. praat_TableOfReal_init (klas);
  6755. praat_addAction1 (klas, 0, U"Set default costs...", U"Formula...", 1, MODIFY_EditDistanceTable_setDefaultCosts);
  6756. praat_removeAction (klas, nullptr, nullptr, U"Draw as numbers...");
  6757. praat_addAction1 (klas, 0, U"Draw...", U"Draw -", 1, GRAPHICS_EditDistanceTable_draw);
  6758. praat_addAction1 (klas, 0, U"Draw edit operations", U"Draw...", 1, GRAPHICS_EditDistanceTable_drawEditOperations);
  6759. praat_removeAction (klas, nullptr, nullptr, U"Draw as numbers if...");
  6760. praat_removeAction (klas, nullptr, nullptr, U"Draw as squares...");
  6761. praat_removeAction (klas, nullptr, nullptr, U"Draw vertical lines...");
  6762. praat_removeAction (klas, nullptr, nullptr, U"Draw horizontal lines...");
  6763. praat_removeAction (klas, nullptr, nullptr, U"Draw left and right lines...");
  6764. praat_removeAction (klas, nullptr, nullptr, U"Draw top and bottom lines...");
  6765. praat_removeAction (klas, nullptr, nullptr, U"-- draw lines --");
  6766. }
  6767. void praat_uvafon_David_init ();
  6768. void praat_uvafon_David_init () {
  6769. Data_recognizeFileType (TextGrid_TIMITLabelFileRecognizer);
  6770. Data_recognizeFileType (cmuAudioFileRecognizer);
  6771. Thing_recognizeClassesByName (classActivationList, classBarkFilter, classBarkSpectrogram,
  6772. classCategories, classCepstrum, classCCA,
  6773. classChebyshevSeries, classClassificationTable, classComplexSpectrogram, classConfusion,
  6774. classCorrelation, classCovariance, classDiscriminant, classDTW,
  6775. classEigen, classExcitationList, classEditCostsTable, classEditDistanceTable,
  6776. classFileInMemory, classFileInMemorySet, classFileInMemoryManager, classFormantFilter,
  6777. classIndex, classKlattTable,
  6778. classPermutation, classISpline, classLegendreSeries,
  6779. classMelFilter, classMelSpectrogram, classMSpline, classPatternList, classPCA, classPolynomial, classRoots,
  6780. classSimpleString, classStringsIndex, classSpeechSynthesizer, classSPINET, classSSCP,
  6781. classSVD, nullptr);
  6782. Thing_recognizeClassByOtherName (classExcitationList, U"Excitations");
  6783. Thing_recognizeClassByOtherName (classActivationList, U"Activation");
  6784. Thing_recognizeClassByOtherName (classPatternList, U"Pattern");
  6785. Thing_recognizeClassByOtherName (classFileInMemorySet, U"FilesInMemory");
  6786. VowelEditor_prefs ();
  6787. espeakdata_praat_init ();
  6788. praat_addMenuCommand (U"Objects", U"Technical", U"Report floating point properties", U"Report integer properties", 0, INFO_Praat_ReportFloatingPointProperties);
  6789. praat_addMenuCommand (U"Objects", U"Goodies", U"Get TukeyQ...", 0, praat_HIDDEN, REAL_Praat_getTukeyQ);
  6790. praat_addMenuCommand (U"Objects", U"Goodies", U"Get invTukeyQ...", 0, praat_HIDDEN, REAL_Praat_getInvTukeyQ);
  6791. praat_addMenuCommand (U"Objects", U"Goodies", U"Get incomplete gamma...", 0, praat_HIDDEN, COMPLEX_Praat_getIncompleteGamma);
  6792. // praat_addMenuCommand (U"Objects", U"New", U"Create Strings as espeak voices", U"Create Strings as directory list...", praat_DEPTH_1 + praat_HIDDEN, NEW1_Strings_createAsEspeakVoices);
  6793. praat_addMenuCommand (U"Objects", U"New", U"Create iris data set", U"Create TableOfReal...", 1, NEW1_CreateIrisDataset);
  6794. praat_addMenuCommand (U"Objects", U"New", U"Create Permutation...", nullptr, 0, NEW_Permutation_create);
  6795. praat_addMenuCommand (U"Objects", U"New", U"Polynomial", nullptr, 0, nullptr);
  6796. praat_addMenuCommand (U"Objects", U"New", U"Create Polynomial...", nullptr, 1, NEW1_Polynomial_create);
  6797. praat_addMenuCommand (U"Objects", U"New", U"Create Polynomial from product terms...", nullptr, 1, NEW1_Polynomial_createFromProductTerms);
  6798. praat_addMenuCommand (U"Objects", U"New", U"Create Polynomial from real zeros...", nullptr, 1, NEW1_Polynomial_createFromRealZeros);
  6799. praat_addMenuCommand (U"Objects", U"New", U"Create LegendreSeries...", nullptr, 1, NEW1_LegendreSeries_create);
  6800. praat_addMenuCommand (U"Objects", U"New", U"Create ChebyshevSeries...", nullptr, 1, NEW1_ChebyshevSeries_create);
  6801. praat_addMenuCommand (U"Objects", U"New", U"Create MSpline...", nullptr, 1, NEW_MSpline_create);
  6802. praat_addMenuCommand (U"Objects", U"New", U"Create ISpline...", nullptr, 1, NEW1_ISpline_create);
  6803. praat_addMenuCommand (U"Objects", U"New", U"Create Sound as gammatone...", U"Create Sound as tone complex...", 1, NEW1_Sound_createAsGammaTone);
  6804. praat_addMenuCommand (U"Objects", U"New", U"Create Sound from gammatone...", U"*Create Sound as gammatone...", praat_DEPTH_1 | praat_DEPRECATED_2016, NEW1_Sound_createAsGammaTone);
  6805. praat_addMenuCommand (U"Objects", U"New", U"Create Sound as Shepard tone...", U"Create Sound as gammatone...", praat_DEPTH_1, NEW_Sound_createAsShepardTone);
  6806. praat_addMenuCommand (U"Objects", U"New", U"Create Sound from Shepard tone...", U"*Create Sound as Shepard tone...", praat_DEPTH_1 | praat_DEPRECATED_2016, NEW_Sound_createAsShepardTone);
  6807. praat_addMenuCommand (U"Objects", U"New", U"Create Sound from VowelEditor...", U"Create Sound as Shepard tone...", praat_DEPTH_1 | praat_NO_API, WINDOW_VowelEditor_create);
  6808. praat_addMenuCommand (U"Objects", U"New", U"Create SpeechSynthesizer...", U"Create Sound from VowelEditor...", praat_DEPTH_1, NEW1_SpeechSynthesizer_create);
  6809. praat_addMenuCommand (U"Objects", U"New", U"Create formant table (Pols & Van Nierop 1973)", U"Create Table...", 1, NEW1_Table_create_polsVanNierop1973);
  6810. praat_addMenuCommand (U"Objects", U"New", U"Create formant table (Peterson & Barney 1952)", U"Create Table...", 1, NEW1_Table_create_petersonBarney1952);
  6811. praat_addMenuCommand (U"Objects", U"New", U"Create formant table (Weenink 1985)", U"Create formant table (Peterson & Barney 1952)", 1, NEW1_Table_create_weenink1983);
  6812. praat_addMenuCommand (U"Objects", U"New", U"Create H1H2 table (Esposito 2006)", U"Create formant table (Weenink 1985)", praat_DEPTH_1+ praat_HIDDEN, NEW_Table_create_esposito2006);
  6813. praat_addMenuCommand (U"Objects", U"New", U"Create Table (Ganong 1980)", U"Create H1H2 table (Esposito 2006)", praat_DEPTH_1+ praat_HIDDEN, NEW_Table_create_ganong1980);
  6814. praat_addMenuCommand (U"Objects", U"New", U"Create TableOfReal (Pols 1973)...", U"Create TableOfReal...", 1, NEW1_TableOfReal_create_pols1973);
  6815. praat_addMenuCommand (U"Objects", U"New", U"Create TableOfReal (Van Nierop 1973)...", U"Create TableOfReal (Pols 1973)...", 1, NEW_TableOfReal_create_vanNierop1973);
  6816. praat_addMenuCommand (U"Objects", U"New", U"Create TableOfReal (Weenink 1985)...", U"Create TableOfReal (Van Nierop 1973)...", 1, NEW_TableOfReal_create_weenink1983);
  6817. praat_addMenuCommand (U"Objects", U"New", U"Create TableOfReal (Sandwell 1987)", U"Create TableOfReal (Weenink 1985)...", praat_DEPTH_1+ praat_HIDDEN, NEW_Table_create_sandwell1987);
  6818. praat_addMenuCommand (U"Objects", U"New", U"Create simple Confusion...", U"Create TableOfReal (Weenink 1985)...", 1, NEW1_Confusion_createSimple);
  6819. praat_addMenuCommand (U"Objects", U"New", U"Create simple Covariance...", U"Create simple Confusion...", 1, NEW1_Covariance_createSimple);
  6820. praat_addMenuCommand (U"Objects", U"New", U"Create simple Correlation...", U"Create simple Covariance...", 1, NEW1_Correlation_createSimple);
  6821. praat_addMenuCommand (U"Objects", U"New", U"Create empty EditCostsTable...", U"Create simple Covariance...", 1, NEW_EditCostsTable_createEmpty);
  6822. praat_addMenuCommand (U"Objects", U"New", U"Create KlattTable example", U"Create TableOfReal (Weenink 1985)...", praat_DEPTH_1 + praat_HIDDEN, NEW1_KlattTable_createExample);
  6823. praat_addMenuCommand (U"Objects", U"New", U"Create Strings as tokens...", U"Create Strings as directory list...", 1, NEW1_Strings_createAsTokens);
  6824. praat_addMenuCommand (U"Objects", U"New", U"Create Strings as characters...", U"Create Strings as tokens...", praat_DEPTH_1 + praat_HIDDEN, NEW1_Strings_createAsCharacters);
  6825. praat_addMenuCommand (U"Objects", U"New", U"Create simple Polygon...", nullptr, praat_HIDDEN, NEW1_Polygon_createSimple);
  6826. praat_addMenuCommand (U"Objects", U"New", U"Create Polygon (random vertices)...", nullptr, praat_DEPRECATED_2016, NEW1_Polygon_createFromRandomPoints);
  6827. praat_addMenuCommand (U"Objects", U"New", U"Create Polygon (random points)...", nullptr, praat_HIDDEN, NEW1_Polygon_createFromRandomPoints);
  6828. praat_addMenuCommand (U"Objects", U"New", U"FileInMemoryManager", nullptr, praat_HIDDEN, nullptr);
  6829. praat_addMenuCommand (U"Objects", U"New", U"Create FileInMemoryManager", nullptr, praat_HIDDEN + praat_DEPTH_1, NEW1_FileInMemoryManager_create);
  6830. praat_addMenuCommand (U"Objects", U"New", U"Create FileInMemory...", nullptr, praat_HIDDEN + praat_DEPTH_1, READ1_FileInMemory_create);
  6831. praat_addMenuCommand (U"Objects", U"New", U"Create FileInMemorySet from directory contents...", nullptr, praat_HIDDEN + praat_DEPTH_1, NEW_FileInMemorySet_createFromDirectoryContents);
  6832. praat_addMenuCommand (U"Objects", U"New", U"Extract espeak data...", nullptr, praat_HIDDEN + praat_DEPTH_1, NEW1_ExtractEspeakData);
  6833. praat_addMenuCommand (U"Objects", U"Open", U"Read Sound from raw 16-bit Little Endian file...", U"Read from special sound file", 1, READ1_Sound_readFromRawFileLE);
  6834. praat_addMenuCommand (U"Objects", U"Open", U"Read Sound from raw 16-bit Big Endian file...", U"Read Sound from raw 16-bit Little Endian file...", 1, READ1_Sound_readFromRawFileBE);
  6835. praat_addMenuCommand (U"Objects", U"Open", U"Read KlattTable from raw text file...", U"Read Matrix from raw text file...", praat_HIDDEN, READ1_KlattTable_readFromRawTextFile);
  6836. praat_addAction1 (classActivationList, 0, U"Modify", nullptr, 0, nullptr);
  6837. praat_addAction1 (classActivationList, 0, U"Formula...", nullptr, 0, MODIFY_ActivationList_formula);
  6838. praat_addAction1 (classActivationList, 0, U"Hack", nullptr, 0, nullptr);
  6839. praat_addAction1 (classActivationList, 0, U"To Matrix", nullptr, 0, NEW_ActivationList_to_Matrix);
  6840. praat_addAction1 (classActivationList, 0, U"To PatternList", nullptr, 0, NEW_ActivationList_to_PatternList);
  6841. praat_addAction2 (classActivationList, 1, classCategories, 1, U"To TableOfReal", nullptr, 0, NEW1_ActivationList_Categories_to_TableOfReal);
  6842. praat_addAction1 (classBarkFilter, 0, U"BarkFilter help", nullptr, 0, HELP_BarkFilter_help);
  6843. praat_FilterBank_all_init (classBarkFilter); // deprecated 2014
  6844. praat_addAction1 (classBarkFilter, 0, U"Draw spectrum (slice)...", U"Draw filters...", praat_DEPRECATED_2014, GRAPHICS_BarkFilter_drawSpectrum); // deprecated 2014
  6845. praat_addAction1 (classBarkFilter, 1, U"Draw filter functions...", U"Draw filters...", praat_DEPRECATED_2014, GRAPHICS_BarkFilter_drawSekeyHansonFilterFunctions); // deprecated 2014
  6846. praat_addAction1 (classBarkFilter, 0, U"Paint...", U"Draw filters...", praat_DEPTH_1, GRAPHICS_BarkFilter_paint); // deprecated 2014
  6847. praat_addAction1 (classBarkFilter, 0, U"To BarkSpectrogram", nullptr, 0, NEW_BarkFilter_to_BarkSpectrogram);
  6848. praat_addAction1 (classBarkSpectrogram, 0, U"BarkSpectrogram help", nullptr, 0, HELP_BarkSpectrogram_help);
  6849. praat_BandFilterSpectrogram_draw_init (classBarkSpectrogram);
  6850. praat_addAction1 (classBarkSpectrogram, 0, U"Paint image...", nullptr, 1, GRAPHICS_BarkSpectrogram_paintImage);
  6851. praat_addAction1 (classBarkSpectrogram, 0, U"Draw Sekey-Hanson auditory filters...", nullptr, 1, GRAPHICS_BarkSpectrogram_drawSekeyHansonAuditoryFilters);
  6852. praat_addAction1 (classBarkSpectrogram, 0, U"Draw spectrum at nearest time slice...", nullptr, 1, GRAPHICS_BarkSpectrogram_drawSpectrumAtNearestTimeSlice);
  6853. praat_addAction1 (classBarkSpectrogram, 0, QUERY_BUTTON, nullptr, 0, nullptr);
  6854. praat_BandFilterSpectrogram_query_init (classBarkSpectrogram);
  6855. praat_addAction1 (classBarkSpectrogram, 0, U"Equalize intensities...", nullptr, 0, MODIFY_BandFilterSpectrogram_equalizeIntensities);
  6856. praat_addAction1 (classBarkSpectrogram, 0, U"To Intensity", nullptr, 0, NEW_BandFilterSpectrogram_to_Intensity);
  6857. praat_addAction1 (classBarkSpectrogram, 0, U"To Matrix...", nullptr, 0, NEW_BandFilterSpectrogram_to_Matrix);
  6858. praat_addAction1 (classBarkSpectrogram, 2, U"Cross-correlate...", nullptr, 0, NEW1_BandFilterSpectrograms_crossCorrelate);
  6859. praat_addAction1 (classBarkSpectrogram, 2, U"Convolve...", nullptr, 0, NEW1_BandFilterSpectrograms_convolve);
  6860. praat_addAction1 (classCategories, 0, U"View & Edit", nullptr, praat_NO_API, WINDOW_Categories_edit);
  6861. praat_addAction1 (classCategories, 0, U"Edit", U"*View & Edit", praat_DEPRECATED_2015 | praat_NO_API, WINDOW_Categories_edit);
  6862. praat_addAction1 (classCategories, 0, QUERY_BUTTON, nullptr, 0, nullptr);
  6863. praat_addAction1 (classCategories, 1, U"Get number of categories", QUERY_BUTTON, 1, INTEGER_Categories_getNumberOfCategories);
  6864. praat_addAction1 (classCategories, 2, U"Get number of differences", QUERY_BUTTON, 1, INTEGER_Categories_getNumberOfDifferences);
  6865. praat_addAction1 (classCategories, 2, U"Get fraction different", QUERY_BUTTON, 1, REAL_Categories_getFractionDifferent);
  6866. praat_addAction1 (classCategories, 0, MODIFY_BUTTON, nullptr, 0, nullptr);
  6867. praat_addAction1 (classCategories, 1, U"Append category...", MODIFY_BUTTON, 1, MODIFY_Categories_appendCategory);
  6868. praat_addAction1 (classCategories, 1, U"Append 1 category...", U"Append category...", praat_HIDDEN | praat_DEPTH_1, MODIFY_Categories_appendCategory);
  6869. praat_addAction1 (classCategories, 0, U"Extract", nullptr, 0, nullptr);
  6870. praat_addAction1 (classCategories, 0, U"To unique Categories", nullptr, 0, NEW_Categories_selectUniqueItems);
  6871. praat_addAction1 (classCategories, 0, U"Analyse", nullptr, 0, nullptr); // TODO name
  6872. praat_addAction1 (classCategories, 2, U"To Confusion", nullptr, 0, NEW_Categories_to_Confusion);
  6873. praat_addAction1 (classCategories, 0, U"Synthesize", nullptr, 0, nullptr);
  6874. praat_addAction1 (classCategories, 2, U"Join", nullptr, 0, NEW1_Categories_join);
  6875. praat_addAction1 (classCategories, 0, U"Permute items", nullptr, 0, NEW_Categories_permuteItems);
  6876. praat_addAction1 (classCategories, 0, U"To Strings", nullptr, 0, NEW_Categories_to_Strings);
  6877. praat_addAction1 (classChebyshevSeries, 0, U"ChebyshevSeries help", nullptr, 0, HELP_ChebyshevSeries_help);
  6878. praat_FunctionTerms_init (classChebyshevSeries);
  6879. praat_addAction1 (classChebyshevSeries, 0, U"To Polynomial", U"Analyse", 0, NEW_ChebyshevSeries_to_Polynomial);
  6880. praat_addAction1 (classCCA, 1, U"CCA help", nullptr, 0, HELP_CCA_help);
  6881. praat_addAction1 (classCCA, 1, U"Draw eigenvector...", nullptr, 0, GRAPHICS_CCA_drawEigenvector);
  6882. praat_addAction1 (classCCA, 1, U"Get number of correlations", nullptr, 0, INTEGER_CCA_getNumberOfCorrelations);
  6883. praat_addAction1 (classCCA, 1, U"Get correlation...", nullptr, 0, REAL_CCA_getCorrelation);
  6884. praat_addAction1 (classCCA, 1, U"Get eigenvector element...", nullptr, 0, REAL_CCA_getEigenvectorElement);
  6885. praat_addAction1 (classCCA, 1, U"Get zero correlation probability...", nullptr, 0, REAL_CCA_getZeroCorrelationProbability);
  6886. praat_addAction1 (classCCA, 1, U"Extract Eigen...", nullptr, 0, NEW_CCA_extractEigen);
  6887. praat_addAction2 (classCCA, 1, classTableOfReal, 1, U"To TableOfReal (scores)...", nullptr, 0, NEW_CCA_TableOfReal_to_TableOfReal_scores);
  6888. praat_addAction2 (classCCA, 1, classTableOfReal, 1, U"To TableOfReal (loadings)", nullptr, 0, NEW_CCA_TableOfReal_to_TableOfReal_loadings);
  6889. praat_addAction2 (classCCA, 1, classTableOfReal, 1, U"Predict...", nullptr, 0, NEW1_CCA_TableOfReal_predict);
  6890. praat_addAction2 (classCCA, 1, classCorrelation, 1, U"To TableOfReal (loadings)", nullptr, 0, NEW1_CCA_Correlation_to_TableOfReal_loadings);
  6891. praat_addAction2 (classCCA, 1, classCorrelation, 1, U"Get variance fraction...", nullptr, 0, REAL_CCA_Correlation_getVarianceFraction);
  6892. praat_addAction2 (classCCA, 1, classCorrelation, 1, U"Get redundancy (sl)...", nullptr, 0, REAL_CCA_Correlation_getRedundancy_sl);
  6893. praat_addAction1 (classComplexSpectrogram, 0, U"ComplexSpectrogram help", nullptr, 0, HELP_ComplexSpectrogram_help);
  6894. praat_addAction1 (classComplexSpectrogram, 0, DRAW_BUTTON, nullptr, 0, nullptr);
  6895. praat_addAction1 (classComplexSpectrogram, 0, U"To Sound...", nullptr, 0, NEW_ComplexSpectrogram_to_Sound);
  6896. praat_addAction1 (classComplexSpectrogram, 0, U"Down to Spectrogram", nullptr, 0, NEW_ComplexSpectrogram_downto_Spectrogram);
  6897. praat_addAction1 (classComplexSpectrogram, 0, U"To Spectrum (slice)...", nullptr, 0, NEW_ComplexSpectrogram_to_Spectrum_slice);
  6898. //praat_addAction1 (classComplexSpectrogram, 0, U"Paint...", 0, 1, DO_Spectrogram_paint);
  6899. praat_addAction1 (classConfusion, 0, U"Confusion help", nullptr, 0, HELP_Confusion_help);
  6900. praat_TableOfReal_init2 (classConfusion);
  6901. praat_removeAction (classConfusion, nullptr, nullptr, U"Draw as numbers...");
  6902. praat_removeAction (classConfusion, nullptr, nullptr, U"Sort by label...");
  6903. praat_removeAction (classConfusion, nullptr, nullptr, U"Sort by column...");
  6904. praat_addAction1 (classConfusion, 0, U"Draw as numbers...", U"Draw -", 1, GRAPHICS_Confusion_drawAsNumbers);
  6905. praat_addAction1 (classConfusion, 1, U"Get value (labels)...", U"Get value...", 1, REAL_Confusion_getValue_labels);
  6906. praat_addAction1 (classConfusion, 0, U"-- confusion statistics --", U"Get value (labels)...", 1, nullptr);
  6907. praat_addAction1 (classConfusion, 1, U"Get fraction correct", U"-- confusion statistics --", 1, REAL_Confusion_getFractionCorrect);
  6908. praat_addAction1 (classConfusion, 1, U"Get stimulus sum...", U"Get fraction correct", 1, REAL_Confusion_getStimulusSum);
  6909. praat_addAction1 (classConfusion, 1, U"Get row sum...", U"Get fraction correct", praat_DEPTH_1 | praat_HIDDEN, REAL_TableOfReal_getRowSum);
  6910. praat_addAction1 (classConfusion, 1, U"Get response sum...", U"Get stimulus sum...", 1, REAL_Confusion_getResponseSum);
  6911. praat_addAction1 (classConfusion, 1, U"Get column sum...", U"Get row sum...", praat_DEPTH_1 | praat_HIDDEN, REAL_TableOfReal_getColumnSum);
  6912. praat_addAction1 (classConfusion, 1, U"Get grand sum", U"Get response sum...", 1, REAL_TableOfReal_getGrandSum);
  6913. praat_addAction1 (classConfusion, 0, U"Increase...", U"Formula...", 1, MODIFY_Confusion_increase);
  6914. praat_addAction1 (classConfusion, 0, U"To TableOfReal (marginals)", U"To TableOfReal", 0, NEW_Confusion_to_TableOfReal_marginals);
  6915. praat_addAction1 (classConfusion, 0, U"Analyse", nullptr, 0, nullptr);
  6916. praat_addAction1 (classConfusion, 0, U"Condense...", nullptr, praat_HIDDEN, NEW_Confusion_condense);
  6917. praat_addAction1 (classConfusion, 0, U"Group...", nullptr, 0, NEW_Confusion_group);
  6918. praat_addAction1 (classConfusion, 0, U"Group stimuli...", nullptr, 0, NEW_Confusion_groupStimuli);
  6919. praat_addAction1 (classConfusion, 0, U"Group responses...", nullptr, 0, NEW_Confusion_groupResponses);
  6920. praat_addAction1 (classConfusion, 2, U"To difference matrix", nullptr, 0, NEW1_Confusion_difference); // TODO to_Matrix_difference ?
  6921. praat_addAction2 (classConfusion, 1, classClassificationTable, 1, U"Increase confusion count", nullptr, 0, MODIFY_Confusion_ClassificationTable_increaseConfusionCount);
  6922. praat_addAction2 (classConfusion, 1, classMatrix, 1, U"Draw", nullptr, 0, nullptr);
  6923. praat_addAction2 (classConfusion, 1, classMatrix, 1, U"Draw confusion...", nullptr, 0, GRAPHICS_Confusion_Matrix_draw);
  6924. praat_addAction1 (classCovariance, 0, U"Covariance help", nullptr, 0, HELP_Covariance_help);
  6925. praat_SSCP_as_TableOfReal_init (classCovariance);
  6926. praat_SSCP_query_init (classCovariance);
  6927. praat_SSCP_extract_init (classCovariance);
  6928. praat_addAction1 (classCovariance, 1, U"Get probability at position...", U"Get value...", 1, REAL_Covariance_getProbabilityAtPosition);
  6929. praat_addAction1 (classCovariance, 1, U"Get diagonality (bartlett)...", U"Get ln(determinant)", 1, REAL_SSCP_getDiagonality_bartlett);
  6930. praat_addAction1 (classCovariance, 1, U"Get significance of one mean...", U"Get diagonality (bartlett)...", 1, REAL_Covariance_getSignificanceOfOneMean);
  6931. praat_addAction1 (classCovariance, 1, U"Get significance of means difference...", U"Get significance of one mean...", 1, REAL_Covariance_getSignificanceOfMeansDifference);
  6932. praat_addAction1 (classCovariance, 1, U"Get significance of one variance...", U"Get significance of means difference...", 1, REAL_Covariance_getSignificanceOfOneVariance);
  6933. praat_addAction1 (classCovariance, 1, U"Get significance of variances ratio...", U"Get significance of one variance...", 1, REAL_Covariance_getSignificanceOfVariancesRatio);
  6934. praat_addAction1 (classCovariance, 1, U"Get fraction variance...", U"Get significance of variances ratio...", 1, REAL_Covariance_getFractionVariance);
  6935. praat_addAction1 (classCovariance, 2, U"Report multivariate mean difference...", U"Get fraction variance...", 1, INFO_Covariances_reportMultivariateMeanDifference);
  6936. praat_addAction1 (classCovariance, 2, U"Difference", U"Report multivariate mean difference...", praat_DEPTH_1 | praat_HIDDEN, INFO_Covariances_reportEquality);
  6937. praat_addAction1 (classCovariance, 0, U"Report equality of covariances", U"Report multivariate mean difference...", praat_DEPTH_1 | praat_HIDDEN, INFO_Covariances_reportEquality);
  6938. praat_addAction1 (classCovariance, 0, U"To TableOfReal (random sampling)...", nullptr, 0, NEW_Covariance_to_TableOfReal_randomSampling);
  6939. praat_addAction1 (classCovariance, 0, U"To Correlation", nullptr, 0, NEW_Covariance_to_Correlation);
  6940. praat_addAction1 (classCovariance, 0, U"To PCA", nullptr, 0, NEW_Covariance_to_PCA);
  6941. praat_addAction1 (classCovariance, 0, U"Pool", nullptr, 0, NEW1_Covariances_pool);
  6942. praat_addAction2 (classCovariance, 1, classTableOfReal, 1, U"To TableOfReal (mahalanobis)...", nullptr, 0, NEW1_Covariance_TableOfReal_mahalanobis);
  6943. praat_addAction1 (classClassificationTable, 0, U"ClassificationTable help", nullptr, 0, HELP_ClassificationTable_help);
  6944. praat_TableOfReal_init (classClassificationTable);
  6945. praat_addAction1 (classClassificationTable, 0, U"Get class index at maximum in row...", U"Get column index...", 1, INTEGER_ClassificationTable_getClassIndexAtMaximumInRow);
  6946. praat_addAction1 (classClassificationTable, 0, U"Get class label at maximum in row...", U"Get class index at maximum in row...", 1, INTEGER_ClassificationTable_getClassLabelAtMaximumInRow);
  6947. praat_addAction1 (classClassificationTable, 0, U"To Confusion", U"*To Confusion...", praat_DEPRECATED_2014, NEW_ClassificationTable_to_Confusion_old); // deprecated 2014
  6948. praat_addAction1 (classClassificationTable, 0, U"To Confusion...", nullptr, 0, NEW_ClassificationTable_to_Confusion);
  6949. praat_addAction1 (classClassificationTable, 0, U"To Correlation (columns)", nullptr, 0, NEW_ClassificationTable_to_Correlation_columns);
  6950. praat_addAction1 (classClassificationTable, 0, U"To Strings (max. prob.)", nullptr, 0, NEW_ClassificationTable_to_Strings_maximumProbability); // TODO name?
  6951. praat_addAction1 (classCorrelation, 0, U"Correlation help", nullptr, 0, HELP_Correlation_help);
  6952. praat_TableOfReal_init2 (classCorrelation);
  6953. praat_SSCP_query_init (classCorrelation);
  6954. praat_SSCP_extract_init (classCorrelation);
  6955. praat_addAction1 (classCorrelation, 1, U"Get diagonality (bartlett)...", U"Get ln(determinant)", 1, REAL_Correlation_getDiagonality_bartlett);
  6956. praat_addAction1 (classCorrelation, 0, U"Confidence intervals...", nullptr, 0, NEW_Correlation_confidenceIntervals);
  6957. praat_addAction1 (classCorrelation, 0, U"To PCA", nullptr, 0, NEW_Correlation_to_PCA);
  6958. praat_addAction1 (classDiscriminant, 0, U"Discriminant help", 0, 0, HELP_Discriminant_help);
  6959. praat_addAction1 (classDiscriminant, 0, DRAW_BUTTON, nullptr, 0, 0);
  6960. praat_addAction1 (classDiscriminant, 0, U"Draw eigenvalues...", nullptr, 1, GRAPHICS_Discriminant_drawEigenvalues);
  6961. praat_addAction1 (classDiscriminant, 0, U"Draw eigenvalues (scree)...", nullptr, praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_Eigen_drawEigenvalues_scree);
  6962. praat_addAction1 (classDiscriminant, 0, U"Draw eigenvector...", nullptr, 1, GRAPHICS_Discriminant_drawEigenvector);
  6963. praat_addAction1 (classDiscriminant, 0, U"-- sscps --", 0, 1, 0);
  6964. praat_addAction1 (classDiscriminant, 0, U"Draw sigma ellipses...", 0, 1, GRAPHICS_Discriminant_drawSigmaEllipses);
  6965. praat_addAction1 (classDiscriminant, 0, U"Draw one sigma ellipse...", 0, 1, GRAPHICS_Discriminant_drawOneSigmaEllipse);
  6966. praat_addAction1 (classDiscriminant, 0, U"Draw confidence ellipses...", 0, 1, GRAPHICS_Discriminant_drawConfidenceEllipses);
  6967. praat_addAction1 (classDiscriminant, 1, QUERY_BUTTON, nullptr, 0, 0);
  6968. praat_addAction1 (classDiscriminant, 1, U"-- eigen structure --", nullptr, 1, 0);
  6969. praat_addAction1 (classDiscriminant, 1, U"Get eigenvalue...", nullptr, 1, REAL_Discriminant_getEigenvalue);
  6970. praat_addAction1 (classDiscriminant, 1, U"Get sum of eigenvalues...", nullptr, 1, REAL_Discriminant_getSumOfEigenvalues);
  6971. praat_addAction1 (classDiscriminant, 1, U"Get number of eigenvectors", nullptr, 1, INTEGER_Discriminant_getNumberOfEigenvectors);
  6972. praat_addAction1 (classDiscriminant, 1, U"Get eigenvector dimension", nullptr, 1, INTEGER_Discriminant_getEigenvectorDimension);
  6973. praat_addAction1 (classDiscriminant, 1, U"Get eigenvector element...", nullptr, 1, REAL_Discriminant_getEigenvectorElement);
  6974. praat_addAction1 (classDiscriminant, 1, U"-- discriminant --", 0, 1, 0);
  6975. praat_addAction1 (classDiscriminant, 1, U"Get number of functions", 0, 1, INTEGER_Discriminant_getNumberOfFunctions);
  6976. praat_addAction1 (classDiscriminant, 1, U"Get dimension of functions", 0, 1, INTEGER_Discriminant_getDimensionOfFunctions);
  6977. praat_addAction1 (classDiscriminant, 1, U"Get number of groups", 0, 1, INTEGER_Discriminant_getNumberOfGroups);
  6978. praat_addAction1 (classDiscriminant, 1, U"Get number of observations...", 0, 1, INTEGER_Discriminant_getNumberOfObservations);
  6979. praat_addAction1 (classDiscriminant, 1, U"-- tests --", 0, 1, 0);
  6980. praat_addAction1 (classDiscriminant, 1, U"Get Wilks lambda...", 0, 1, REAL_Discriminant_getWilksLambda);
  6981. praat_addAction1 (classDiscriminant, 1, U"Get cumulative contribution of components...", 0, 1, REAL_Discriminant_getCumulativeContributionOfComponents);
  6982. praat_addAction1 (classDiscriminant, 1, U"Get partial discrimination probability...", 0, 1, REAL_Discriminant_getPartialDiscriminationProbability);
  6983. praat_addAction1 (classDiscriminant, 1, U"Get homogeneity of covariances (box)", 0, praat_DEPTH_1 | praat_HIDDEN, REAL_Discriminant_getHomegeneityOfCovariances_box);
  6984. praat_addAction1 (classDiscriminant, 1, U"Report equality of covariance matrices", 0, 1, INFO_Discriminant_reportEqualityOfCovarianceMatrices);
  6985. praat_addAction1 (classDiscriminant, 1, U"-- ellipses --", 0, 1, 0);
  6986. praat_addAction1 (classDiscriminant, 1, U"Get sigma ellipse area...", 0, 1, REAL_Discriminant_getSigmaEllipseArea);
  6987. praat_addAction1 (classDiscriminant, 1, U"Get confidence ellipse area...", 0, 1, REAL_Discriminant_getConfidenceEllipseArea);
  6988. praat_addAction1 (classDiscriminant, 1, U"Get ln(determinant_group)...", 0, 1, REAL_Discriminant_getLnDeterminant_group);
  6989. praat_addAction1 (classDiscriminant, 1, U"Get ln(determinant_total)", 0, 1, REAL_Discriminant_getLnDeterminant_total);
  6990. praat_addAction1 (classDiscriminant, 0, MODIFY_BUTTON, nullptr, 0, 0);
  6991. praat_addAction1 (classDiscriminant, 1, U"Invert eigenvector...", nullptr, 1, MODIFY_Discriminant_invertEigenvector);
  6992. praat_addAction1 (classDiscriminant, 0, U"Align eigenvectors", nullptr, 1, MODIFY_Eigens_alignEigenvectors);
  6993. praat_addAction1 (classDiscriminant, 0, U"Extract -", nullptr, 0, 0);
  6994. praat_addAction1 (classDiscriminant, 0, U"Extract pooled within-groups SSCP", nullptr, 1, NEW_Discriminant_extractPooledWithinGroupsSSCP);
  6995. praat_addAction1 (classDiscriminant, 0, U"Extract within-group SSCP...", nullptr, 1, NEW_Discriminant_extractWithinGroupSSCP);
  6996. praat_addAction1 (classDiscriminant, 0, U"Extract between-groups SSCP", nullptr, 1, NEW_Discriminant_extractBetweenGroupsSSCP);
  6997. praat_addAction1 (classDiscriminant, 0, U"Extract group centroids", nullptr, 1, NEW_Discriminant_extractGroupCentroids);
  6998. praat_addAction1 (classDiscriminant, 0, U"Extract group standard deviations", nullptr, 1, NEW_Discriminant_extractGroupStandardDeviations);
  6999. praat_addAction1 (classDiscriminant, 0, U"Extract group labels", nullptr, 1, NEW_Discriminant_extractGroupLabels);
  7000. praat_addAction1 (classDiscriminant, 0, U"Extract Eigen", nullptr, 1, NEW_Discriminant_extractEigen);
  7001. praat_addAction1 (classDiscriminant , 0, U"& TableOfReal: To ClassificationTable?", nullptr, 0, hint_Discriminant_TableOfReal_to_ClassificationTable);
  7002. /* praat_addAction1 (classDiscriminant, 1, U"Extract coefficients...", nullptr, 1, DO_Discriminant_extractCoefficients);*/
  7003. //praat_addAction2 (classDiscriminant, 1, classMatrix, 1, U"To Matrix (pc)...", nullptr, 0, DO_Discriminant_Matrix_to_Matrix_pc);
  7004. praat_Eigen_Spectrogram_project (classDiscriminant, classSpectrogram);
  7005. praat_Eigen_Spectrogram_project (classDiscriminant, classBarkSpectrogram);
  7006. praat_Eigen_Spectrogram_project (classDiscriminant, classMelSpectrogram);
  7007. praat_Eigen_Matrix_project (classDiscriminant, classFormantFilter); // deprecated 2014
  7008. praat_Eigen_Matrix_project (classDiscriminant, classBarkFilter); // deprecated 2014
  7009. praat_Eigen_Matrix_project (classDiscriminant, classMelFilter); // deprecated 2014
  7010. praat_addAction2 (classDiscriminant, 1, classPatternList, 1, U"To Categories...", nullptr, 0, NEW1_Discriminant_PatternList_to_Categories);
  7011. praat_addAction2 (classDiscriminant, 1, classSSCP, 1, U"Project", nullptr, 0, NEW1_Eigen_SSCP_project);
  7012. praat_addAction2 (classDiscriminant, 1, classStrings, 1, U"Modify Discriminant", nullptr, 0, 0);
  7013. praat_addAction2 (classDiscriminant, 1, classStrings, 1, U"Set group labels", nullptr, 0, MODIFY_Discriminant_setGroupLabels);
  7014. praat_addAction2 (classDiscriminant, 1, classTableOfReal, 1, U"To Configuration...", nullptr, 0, NEW1_Discriminant_TableOfReal_to_Configuration);
  7015. praat_addAction2 (classDiscriminant, 1, classTableOfReal, 1,U"To ClassificationTable...", nullptr, 0, NEW1_Discriminant_TableOfReal_to_ClassificationTable);
  7016. praat_addAction2 (classDiscriminant, 1, classTableOfReal, 1, U"To TableOfReal (mahalanobis)...", nullptr, 0, NEW1_Discriminant_TableOfReal_mahalanobis);
  7017. praat_addAction1 (classDTW, 0, U"DTW help", nullptr, 0, HELP_DTW_help);
  7018. praat_addAction1 (classDTW, 0, DRAW_BUTTON, nullptr, 0, 0);
  7019. praat_addAction1 (classDTW, 0, U"Draw path...", nullptr, 1, GRAPHICS_DTW_drawPath);
  7020. praat_addAction1 (classDTW, 0, U"Paint distances...", nullptr, 1, GRAPHICS_DTW_paintDistances);
  7021. praat_addAction1 (classDTW, 0, U"Draw warp (x)...", nullptr, 1, GRAPHICS_DTW_drawWarp_x);
  7022. praat_addAction1 (classDTW, 0, U"Draw warp (y)...", nullptr, 1, GRAPHICS_DTW_drawWarp_y);
  7023. praat_addAction1 (classDTW, 0, QUERY_BUTTON, nullptr, 0, 0);
  7024. praat_addAction1 (classDTW, 1, U"Query time domains", nullptr, 1, 0);
  7025. praat_addAction1 (classDTW, 1, U"Get start time (x)", nullptr, 2, REAL_DTW_getStartTime_x);
  7026. praat_addAction1 (classDTW, 1, U"Get end time (x)", nullptr, 2, REAL_DTW_getEndTime_x);
  7027. praat_addAction1 (classDTW, 1, U"Get total duration (x)", nullptr, 2, REAL_DTW_getTotalDuration_x);
  7028. praat_addAction1 (classDTW, 1, U"-- time domain x from y separator --", nullptr, 2, 0);
  7029. praat_addAction1 (classDTW, 1, U"Get start time (y)", nullptr, 2, REAL_DTW_getStartTime_y);
  7030. praat_addAction1 (classDTW, 1, U"Get end time (y)", nullptr, 2, REAL_DTW_getEndTime_y);
  7031. praat_addAction1 (classDTW, 1, U"Get total duration (y)", nullptr, 2, REAL_DTW_getTotalDuration_y);
  7032. praat_addAction1 (classDTW, 1, U"Query time samplings", nullptr, 1, 0);
  7033. praat_addAction1 (classDTW, 1, U"Get number of frames (x)", nullptr, 2, INTEGER_DTW_getNumberOfFrames_x);
  7034. praat_addAction1 (classDTW, 1, U"Get time step (x)", nullptr, 2, REAL_DTW_getTimeStep_x);
  7035. praat_addAction1 (classDTW, 1, U"Get time from frame number (x)...", nullptr, 2, REAL_DTW_getTimeFromFrameNumber_x);
  7036. praat_addAction1 (classDTW, 1, U"Get frame number from time (x)...", nullptr, 2, INTEGER_DTW_getFrameNumberFromTime_x);
  7037. praat_addAction1 (classDTW, 1, U"-- time sampling x from y separator --", nullptr, 2, 0);
  7038. praat_addAction1 (classDTW, 1, U"Get number of frames (y)", nullptr, 2, INTEGER_DTW_getNumberOfFrames_y);
  7039. praat_addAction1 (classDTW, 1, U"Get time step (y)", nullptr, 2, REAL_DTW_getTimeStep_y);
  7040. praat_addAction1 (classDTW, 1, U"Get time from frame number (y)...", nullptr, 2, REAL_DTW_getTimeFromFrameNumber_y);
  7041. praat_addAction1 (classDTW, 1, U"Get frame number from time (y)...", nullptr, 2, INTEGER_DTW_getFrameNumberFromTime_y);
  7042. praat_addAction1 (classDTW, 1, U"Get y time from x time...", nullptr, 1, REAL_DTW_getYTimeFromXTime);
  7043. praat_addAction1 (classDTW, 1, U"Get x time from y time...", nullptr, 1, REAL_DTW_getXTimeFromYTime);
  7044. praat_addAction1 (classDTW, 1, U"Get y time...", nullptr, praat_HIDDEN + praat_DEPTH_1, REAL_DTW_getYTimeFromXTime);
  7045. praat_addAction1 (classDTW, 1, U"Get x time...", nullptr, praat_HIDDEN + praat_DEPTH_1, REAL_DTW_getXTimeFromYTime);
  7046. praat_addAction1 (classDTW, 1, U"Get maximum consecutive steps...", nullptr, 1, INTEGER_DTW_getMaximumConsecutiveSteps);
  7047. praat_addAction1 (classDTW, 1, U"Get time along path...", nullptr, praat_DEPTH_1 | praat_HIDDEN, REAL_DTW_getPathY);
  7048. praat_addAction1 (classDTW, 1, U"-- distance queries --", nullptr, 1, 0);
  7049. praat_addAction1 (classDTW, 1, U"Get distance value...", nullptr, 1, REAL_DTW_getDistanceValue);
  7050. praat_addAction1 (classDTW, 1, U"Get minimum distance", nullptr, 1, REAL_DTW_getMinimumDistance);
  7051. praat_addAction1 (classDTW, 1, U"Get maximum distance", nullptr, 1, REAL_DTW_getMaximumDistance);
  7052. praat_addAction1 (classDTW, 1, U"Get distance (weighted)", nullptr, 1, REAL_DTW_getDistance_weighted);
  7053. praat_addAction1 (classDTW, 0, MODIFY_BUTTON, nullptr, 0, 0);
  7054. praat_addAction1 (classDTW, 0, U"Formula (distances)...", nullptr, 1, MODIFY_DTW_formula_distances);
  7055. praat_addAction1 (classDTW, 0, U"Set distance value...", nullptr, 1, MODIFY_DTW_setDistanceValue);
  7056. praat_addAction1 (classDTW, 0, U"Analyse", nullptr, 0, 0);
  7057. praat_addAction1 (classDTW, 0, U"Find path...", nullptr, praat_HIDDEN, MODIFY_DTW_findPath);
  7058. praat_addAction1 (classDTW, 0, U"Find path (band & slope)...", nullptr, 0, MODIFY_DTW_findPath_bandAndSlope);
  7059. praat_addAction1 (classDTW, 0, U"To Polygon...", nullptr, 1, NEW_DTW_to_Polygon);
  7060. praat_addAction1 (classDTW, 0, U"To Matrix (distances)", nullptr, 0, NEW_DTW_to_Matrix_distances);
  7061. praat_addAction1 (classDTW, 0, U"To Matrix (cum. distances)...", nullptr, 0, NEW_DTW_to_Matrix_cumulativeDistances);
  7062. praat_addAction1 (classDTW, 0, U"Swap axes", nullptr, 0, NEW_DTW_swapAxes);
  7063. praat_addAction2 (classDTW, 1, classMatrix, 1, U"Replace matrix", nullptr, 0, MODIFY_DTW_Matrix_replace);
  7064. praat_addAction2 (classDTW, 1, classTextGrid, 1, U"To TextGrid (warp times)", nullptr, 0, NEW1_DTW_TextGrid_to_TextGrid);
  7065. praat_addAction2 (classDTW, 1, classIntervalTier, 1, U"To Table (distances)", nullptr, 0, NEW1_DTW_IntervalTier_to_Table);
  7066. praat_addAction2 (classDTW, 1, classPolygon, 1, U"Find path inside...", nullptr, 0, MODIFY_DTW_Polygon_findPathInside);
  7067. praat_addAction2 (classDTW, 1, classPolygon, 1, U"To Matrix (cum. distances)...", nullptr, 0, NEW1_DTW_Polygon_to_Matrix_cumulativeDistances);
  7068. praat_addAction2 (classDTW, 1, classSound, 2, U"Draw...", nullptr, 0, GRAPHICS_DTW_Sounds_draw);
  7069. praat_addAction2 (classDTW, 1, classSound, 2, U"Draw warp (x)...", nullptr, 0, GRAPHICS_DTW_Sounds_drawWarp_x);
  7070. praat_addAction1 (classEditDistanceTable, 1, U"EditDistanceTable help", nullptr, 0, HELP_EditDistanceTable_help);
  7071. praat_EditDistanceTable_as_TableOfReal_init (classEditDistanceTable);
  7072. praat_addAction1 (classEditDistanceTable, 1, U"To TableOfReal (directions)...", nullptr, praat_HIDDEN, NEW_EditDistanceTable_to_TableOfReal_directions);
  7073. praat_addAction2 (classEditDistanceTable, 1, classEditCostsTable, 1, U"Set edit costs", nullptr, 0, MODIFY_EditDistanceTable_setEditCosts);
  7074. praat_addAction2 (classEditDistanceTable, 1, classEditCostsTable, 1, U"Set new edit costs", nullptr, praat_DEPRECATED_2017, MODIFY_EditDistanceTable_setEditCosts);
  7075. praat_addAction1 (classEditCostsTable, 1, U"EditCostsTable help", nullptr, 0, HELP_EditCostsTable_help);
  7076. praat_addAction1 (classEditCostsTable, 0, QUERY_BUTTON, nullptr, 0, 0);
  7077. praat_addAction1 (classEditCostsTable, 1, U"Get target index...", nullptr, 1, INTEGER_EditCostsTable_getTargetIndex);
  7078. praat_addAction1 (classEditCostsTable, 1, U"Get source index...", nullptr, 1, INTEGER_EditCostsTable_getSourceIndex);
  7079. praat_addAction1 (classEditCostsTable, 1, U"Get insertion costs...", nullptr, 1, REAL_EditCostsTable_getInsertionCosts);
  7080. praat_addAction1 (classEditCostsTable, 1, U"Get insertion cost...", nullptr, praat_DEPRECATED_2017, REAL_EditCostsTable_getInsertionCosts);
  7081. praat_addAction1 (classEditCostsTable, 1, U"Get deletion costs...", nullptr, 1, REAL_EditCostsTable_getDeletionCost);
  7082. praat_addAction1 (classEditCostsTable, 1, U"Get deletion cost...", nullptr, praat_DEPRECATED_2017, REAL_EditCostsTable_getDeletionCost);
  7083. praat_addAction1 (classEditCostsTable, 1, U"Get substitution costs...", nullptr, 1, REAL_EditCostsTable_getSubstitutionCost);
  7084. praat_addAction1 (classEditCostsTable, 1, U"Get substitution cost...", nullptr, praat_DEPRECATED_2017, REAL_EditCostsTable_getSubstitutionCost);
  7085. praat_addAction1 (classEditCostsTable, 1, U"Get costs (others)...", nullptr, 1, REAL_EditCostsTable_getCosts_others);
  7086. praat_addAction1 (classEditCostsTable, 1, U"Get cost (others)...", nullptr, praat_DEPRECATED_2017, REAL_EditCostsTable_getCosts_others);
  7087. praat_addAction1 (classEditCostsTable, 0, MODIFY_BUTTON, nullptr, 0, 0);
  7088. praat_addAction1 (classEditCostsTable, 1, U"Set target symbol (index)...", nullptr, 1, MODIFY_EditCostsTable_setTargetSymbol_index);
  7089. praat_addAction1 (classEditCostsTable, 1, U"Set source symbol (index)...", nullptr, 1, MODIFY_EditCostsTable_setSourceSymbol_index);
  7090. praat_addAction1 (classEditCostsTable, 1, U"Set insertion costs...", nullptr, 1, MODIFY_EditCostsTable_setInsertionCosts);
  7091. praat_addAction1 (classEditCostsTable, 1, U"Set insertion cost...", nullptr, praat_DEPRECATED_2017, MODIFY_EditCostsTable_setInsertionCosts);
  7092. praat_addAction1 (classEditCostsTable, 1, U"Set deletion costs...", nullptr, 1, MODIFY_EditCostsTable_setDeletionCosts);
  7093. praat_addAction1 (classEditCostsTable, 1, U"Set substitution costs...", nullptr, 1, MODIFY_EditCostsTable_setSubstitutionCosts);
  7094. praat_addAction1 (classEditCostsTable, 1, U"Set costs (others)...", nullptr, 1, MODIFY_EditCostsTable_setCosts_others);
  7095. praat_addAction1 (classEditCostsTable, 1, U"To TableOfReal", nullptr, 0, NEW_EditCostsTable_to_TableOfReal);
  7096. praat_Index_init (classStringsIndex);
  7097. praat_addAction1 (classIndex, 0, U"Index help", nullptr, 0, HELP_Index_help);
  7098. praat_addAction1 (classStringsIndex, 1, U"Get class label...", nullptr, 0, INFO_StringsIndex_getClassLabelFromClassIndex);
  7099. praat_addAction1 (classStringsIndex, 1, U"Get class index...", nullptr, 0, INTEGER_StringsIndex_getClassIndex);
  7100. praat_addAction1 (classStringsIndex, 1, U"Get label...", nullptr, 0, INFO_StringsIndex_getItemLabelFromItemIndex);
  7101. praat_addAction1 (classStringsIndex, 1, U"Get class index from item index...", nullptr, 0, INTEGER_StringsIndex_getClassIndexFromItemIndex);
  7102. praat_addAction1 (classIndex, 1, U"Get index...", nullptr, 0, INTEGER_Index_getIndex);
  7103. praat_addAction1 (classStringsIndex, 1, U"To Strings", nullptr, 0, NEW_StringsIndex_to_Strings);
  7104. praat_addAction1 (classEigen, 0, U"Eigen help", nullptr, 0, HELP_Eigen_help);
  7105. praat_addAction1 (classEigen, 0, U"Draw -", nullptr, 0, nullptr);
  7106. praat_addAction1 (classEigen, 0, U"Draw eigenvalues (scree)...", nullptr, praat_DEPTH_1 | praat_DEPRECATED_2010, GRAPHICS_Eigen_drawEigenvalues_scree);
  7107. praat_addAction1 (classEigen, 0, U"Draw eigenvalues...", nullptr, 1, GRAPHICS_Eigen_drawEigenvalues);
  7108. praat_addAction1 (classEigen, 0, U"Draw eigenvector...", nullptr, 1, GRAPHICS_Eigen_drawEigenvector);
  7109. praat_addAction1 (classEigen, 0, QUERY_BUTTON, nullptr, 0, nullptr);
  7110. praat_addAction1 (classEigen, 1, U"Get number of eigenvalues", nullptr, 1, INTEGER_Eigen_getNumberOfEigenvalues);
  7111. praat_addAction1 (classEigen, 1, U"Get eigenvalue...", nullptr, 1, REAL_Eigen_getEigenvalue);
  7112. praat_addAction1 (classEigen, 1, U"Get sum of eigenvalues...", nullptr, 1, REAL_Eigen_getSumOfEigenvalues);
  7113. praat_addAction1 (classEigen, 1, U"-- eigenvectors --", nullptr, 1, 0);
  7114. praat_addAction1 (classEigen, 1, U"Get number of eigenvectors", nullptr, 1, INTEGER_Eigen_getNumberOfEigenvectors);
  7115. praat_addAction1 (classEigen, 1, U"Get eigenvector dimension", nullptr, 1, INTEGER_Eigen_getEigenvectorDimension);
  7116. praat_addAction1 (classEigen, 1, U"Get eigenvector element...", nullptr, 1, REAL_Eigen_getEigenvectorElement);
  7117. praat_addAction1 (classEigen, 0, U"Modify -", nullptr, 0, nullptr);
  7118. praat_addAction1 (classEigen, 1, U"Invert eigenvector...", nullptr, 1, MODIFY_Eigen_invertEigenvector);
  7119. praat_addAction1 (classExcitation, 0, U"Synthesize", U"To Formant...", 0, 0);
  7120. praat_addAction1 (classExcitation, 0, U"To ExcitationList", U"Synthesize", 0, NEW1_Excitations_to_ExcitationList);
  7121. praat_addAction1 (classExcitation, 0, U"To Excitations", U"Synthesize", praat_DEPRECATED_2015, NEW1_Excitations_to_ExcitationList);
  7122. praat_addAction1 (classExcitationList, 0, U"Modify", nullptr, 0, 0);
  7123. praat_addAction1 (classExcitationList, 0, U"Formula...", nullptr, 0, MODIFY_ExcitationList_formula);
  7124. praat_addAction1 (classExcitationList, 0, U"Extract", nullptr, 0, 0);
  7125. praat_addAction1 (classExcitationList, 0, U"Extract Excitation...", nullptr, 0, NEW_ExcitationList_extractItem);
  7126. praat_addAction1 (classExcitationList, 0, U"Synthesize", nullptr, 0, 0);
  7127. praat_addAction1 (classExcitationList, 2, U"Append", nullptr, 0, NEW1_ExcitationList_append);
  7128. praat_addAction1 (classExcitationList, 0, U"Convert", nullptr, 0, 0);
  7129. praat_addAction1 (classExcitationList, 0, U"To PatternList...", nullptr, 0, NEW_ExcitationList_to_PatternList);
  7130. praat_addAction1 (classExcitationList, 0, U"To Pattern...", nullptr, praat_HIDDEN, NEW_ExcitationList_to_PatternList);
  7131. praat_addAction1 (classExcitationList, 0, U"To TableOfReal", nullptr, 0, NEW_ExcitationList_to_TableOfReal);
  7132. praat_addAction2 (classExcitationList, 1, classExcitation, 0, U"Add to ExcitationList", nullptr, 0, MODIFY_ExcitationList_addItem);
  7133. praat_addAction2 (classExcitationList, 1, classExcitation, 0, U"Add to Excitations", nullptr, praat_HIDDEN, MODIFY_ExcitationList_addItem);
  7134. praat_addAction1 (classFileInMemory, 1, U"Show as code...", nullptr, 0, INFO_FileInMemory_showAsCode);
  7135. praat_addAction1 (classFileInMemory, 1, U"Set id...", nullptr, 0, MODIFY_FileInMemory_setId);
  7136. praat_addAction1 (classFileInMemory, 0, U"To FileInMemorySet", nullptr, 0, NEW1_FilesInMemory_to_FileInMemorySet);
  7137. praat_addAction1 (classFileInMemory, 0, U"To FilesInMemory", nullptr, praat_DEPRECATED_2015, NEW1_FilesInMemory_to_FileInMemorySet);
  7138. praat_addAction1 (classFileInMemorySet, 1, QUERY_BUTTON, nullptr, 0, nullptr);
  7139. praat_addAction1 (classFileInMemorySet, 1, U"Get number of files", nullptr, 1, INFO_FileInMemorySet_getNumberOfFiles);
  7140. praat_addAction1 (classFileInMemorySet, 1, U"Has directory?", nullptr, 1, INFO_FileInMemorySet_hasDirectory);
  7141. praat_addAction1 (classFileInMemorySet, 1, U"Show as code...", nullptr, 0, INFO_FileInMemorySet_showAsCode);
  7142. praat_addAction1 (classFileInMemorySet, 1, U"Show one file as code...", nullptr, 0, INFO_FileInMemorySet_showOneFileAsCode);
  7143. praat_addAction1 (classFileInMemorySet, 0, U"Merge", nullptr, 0, NEW1_FileInMemorySets_merge);
  7144. praat_addAction1 (classFileInMemorySet, 0, U"To Strings (id)", nullptr, 0, NEW_FileInMemorySet_to_Strings_id);
  7145. praat_addAction1 (classFileInMemorySet, 0, U"Extract files...", nullptr, 0, NEW1_FileInMemorySet_extractFiles);
  7146. praat_addAction2 (classFileInMemorySet, 1, classFileInMemory, 0, U"Add items to set", nullptr, 0, MODIFY_FileInMemorySet_addItemsToSet);
  7147. praat_addAction1 (classFileInMemoryManager, 1, QUERY_BUTTON, nullptr, 0, nullptr);
  7148. praat_addAction1 (classFileInMemoryManager, 1, U"Get number of files", nullptr, 1, INFO_FileInMemoryManager_getNumberOfFiles);
  7149. praat_addAction1 (classFileInMemoryManager, 1, U"Get number of open files", nullptr, 1, INFO_FileInMemoryManager_getNumberOfOpenFiles);
  7150. praat_addAction1 (classFileInMemoryManager, 1, U"Has directory?", nullptr, 1, INFO_FileInMemoryManager_hasDirectory);
  7151. praat_addAction1 (classFileInMemoryManager, 0, U"Extract files...", nullptr, 0, NEW1_FileInMemoryManager_extractFiles);
  7152. praat_addAction1 (classFileInMemoryManager, 0, U"Down to Table...", nullptr, 0, NEW1_FileInMemoryManager_downto_Table);
  7153. praat_addAction1 (classFormantFilter, 0, U"FormantFilter help", nullptr, praat_DEPRECATED_2015, HELP_FormantFilter_help);
  7154. praat_FilterBank_all_init (classFormantFilter);
  7155. praat_addAction1 (classFormantFilter, 0, U"Draw spectrum (slice)...", U"Draw filters...", praat_DEPTH_1 | praat_DEPRECATED_2014, GRAPHICS_FormantFilter_drawSpectrum_slice);
  7156. praat_addAction1 (classFormantFilter, 0, U"Draw filter functions...", U"Draw filters...", praat_DEPTH_1 | praat_DEPRECATED_2014, GRAPHICS_FormantFilter_drawFilterFunctions);
  7157. praat_addAction1 (classFormantFilter, 0, U"To Spectrogram", nullptr, 0, NEW_FormantFilter_to_Spectrogram);
  7158. praat_addAction1 (classFormantGrid, 0, U"Draw...", U"Edit", praat_DEPTH_1 + praat_HIDDEN, GRAPHICS_FormantGrid_draw);
  7159. praat_addAction1 (classIntensity, 0, U"To TextGrid (silences)...", U"To IntensityTier (valleys)", 0, NEW_Intensity_to_TextGrid_silences);
  7160. praat_addAction1 (classIntensityTier, 0, U"To TextGrid (silences)...", nullptr, 0, NEW_IntensityTier_to_TextGrid_silences);
  7161. praat_addAction1 (classIntensityTier, 0, U"To Intensity...", nullptr, praat_HIDDEN, NEW_IntensityTier_to_Intensity);
  7162. praat_addAction1 (classISpline, 0, U"ISpline help", nullptr, 0, HELP_ISpline_help);
  7163. praat_Spline_init (classISpline);
  7164. praat_addAction1 (classKlattTable, 0, U"KlattTable help", nullptr, 0, HELP_KlattTable_help);
  7165. praat_addAction1 (classKlattTable, 0, U"To Sound...", nullptr, 0, NEW_KlattTable_to_Sound);
  7166. praat_addAction1 (classKlattTable, 0, U"To KlattGrid...", nullptr, 0, NEW_KlattTable_to_KlattGrid);
  7167. praat_addAction1 (classKlattTable, 0, U"To Table", nullptr, 0, NEW_KlattTable_to_Table);
  7168. praat_addAction1 (classLegendreSeries, 0, U"LegendreSeries help", nullptr, 0, HELP_LegendreSeries_help);
  7169. praat_FunctionTerms_init (classLegendreSeries);
  7170. praat_addAction1 (classLegendreSeries, 0, U"To Polynomial", U"Analyse", 0, NEW_LegendreSeries_to_Polynomial);
  7171. praat_addAction1 (classLongSound, 0, U"Append to existing sound file...", nullptr, 0, READ1_LongSounds_appendToExistingSoundFile);
  7172. praat_addAction1 (classSound, 0, U"Append to existing sound file...", nullptr, 0, READ1_LongSounds_appendToExistingSoundFile);
  7173. praat_addAction2 (classLongSound, 0, classSound, 0, U"Append to existing sound file...", nullptr, 0, READ1_LongSounds_appendToExistingSoundFile);
  7174. praat_addAction1 (classLongSound, 2, U"Save as stereo AIFF file...", U"Save as NIST file...", 1, SAVE_LongSounds_saveAsStereoAIFFFile);
  7175. praat_addAction1 (classLongSound, 2, U"Write to stereo AIFF file...", U"Write to NIST file...", praat_HIDDEN + praat_DEPTH_1, SAVE_LongSounds_saveAsStereoAIFFFile);
  7176. praat_addAction1 (classLongSound, 2, U"Save as stereo AIFC file...", U"Save as stereo AIFF file...", 1, SAVE_LongSounds_saveAsStereoAIFCFile);
  7177. praat_addAction1 (classLongSound, 2, U"Write to stereo AIFC file...", U"Write to stereo AIFF file...", praat_HIDDEN + praat_DEPTH_1, SAVE_LongSounds_saveAsStereoAIFCFile);
  7178. praat_addAction1 (classLongSound, 2, U"Save as stereo WAV file...", U"Save as stereo AIFC file...", 1, SAVE_LongSounds_saveAsStereoWAVFile);
  7179. praat_addAction1 (classLongSound, 2, U"Write to stereo WAV file...", U"Write to stereo AIFC file...", praat_HIDDEN + praat_DEPTH_1, SAVE_LongSounds_saveAsStereoWAVFile);
  7180. praat_addAction1 (classLongSound, 2, U"Save as stereo NeXt/Sun file...", U"Save as stereo WAV file...", 1, SAVE_LongSounds_saveAsStereoNeXtSunFile);
  7181. praat_addAction1 (classLongSound, 2, U"Write to stereo NeXt/Sun file...", U"Write to stereo WAV file...", praat_HIDDEN + praat_DEPTH_1, SAVE_LongSounds_saveAsStereoNeXtSunFile);
  7182. praat_addAction1 (classLongSound, 2, U"Save as stereo NIST file...", U"Save as stereo NeXt/Sun file...", 1, SAVE_LongSounds_saveAsStereoNISTFile);
  7183. praat_addAction1 (classLongSound, 2, U"Write to stereo NIST file...", U"Write to stereo NeXt/Sun file...", praat_HIDDEN + praat_DEPTH_1, SAVE_LongSounds_saveAsStereoNISTFile);
  7184. praat_addAction1 (classLtas, 0, U"Report spectral tilt...", U"Get slope...", 1, INFO_Ltas_reportSpectralTilt);
  7185. praat_addAction1 (classMatrix, 0, U"Scatter plot...", U"Paint cells...", 1, GRAPHICS_Matrix_scatterPlot);
  7186. praat_addAction1 (classMatrix, 0, U"Draw as squares...", U"Scatter plot...", 1, GRAPHICS_Matrix_drawAsSquares);
  7187. praat_addAction1 (classMatrix, 0, U"Draw distribution...", U"Draw as squares...", 1, GRAPHICS_Matrix_drawDistribution);
  7188. praat_addAction1 (classMatrix, 0, U"Draw cumulative distribution...", U"Draw distribution...", 1, GRAPHICS_Matrix_drawCumulativeDistribution);
  7189. praat_addAction1 (classMatrix, 0, U"Get mean...", U"Get sum", 1, REAL_Matrix_getMean);
  7190. praat_addAction1 (classMatrix, 0, U"Get standard deviation...", U"Get mean...", 1, REAL_Matrix_getStandardDeviation);
  7191. praat_addAction1 (classMatrix, 0, U"Transpose", U"Synthesize", 0, NEW_Matrix_transpose);
  7192. praat_addAction1 (classMatrix, 0, U"Solve equation...", U"Analyse", 0, NEW_Matrix_solveEquation);
  7193. praat_addAction1 (classMatrix, 0, U"To PCA (by rows)", U"Solve equation...", 0, NEW_Matrix_to_PCA_byRows);
  7194. praat_addAction1 (classMatrix, 0, U"To PCA (by columns)", U"To PCA (by rows)", 0, NEW_Matrix_to_PCA_byColumns);
  7195. praat_addAction1 (classMatrix, 0, U"To PatternList...", U"To VocalTract", 1, NEW_Matrix_to_PatternList);
  7196. praat_addAction1 (classMatrix, 0, U"To Pattern...", U"*To PatternList...", praat_DEPRECATED_2016, NEW_Matrix_to_PatternList);
  7197. praat_addAction1 (classMatrix, 0, U"To ActivationList", U"To PatternList...", 1, NEW_Matrix_to_ActivationList);
  7198. praat_addAction1 (classMatrix, 0, U"To Activation", U"*To ActivationList", praat_DEPRECATED_2016, NEW_Matrix_to_ActivationList);
  7199. praat_addAction1 (classMatrix, 0, U"To Eigen", U"Eigen", praat_HIDDEN, NEW_Matrix_to_Eigen);
  7200. praat_addAction1 (classMatrix, 0, U"Eigen (complex)", U"Eigen", praat_HIDDEN, NEWTIMES2_Matrix_eigen_complex);
  7201. praat_addAction1 (classMatrix, 2, U"To DTW...", U"To ParamCurve", 1, NEW1_Matrices_to_DTW);
  7202. praat_addAction2 (classMatrix, 1, classCategories, 1, U"To TableOfReal", nullptr, 0, NEW1_Matrix_Categories_to_TableOfReal);
  7203. praat_addAction1 (classMelSpectrogram, 0, U"MelSpectrogram help", nullptr, 0, HELP_MelSpectrogram_help);
  7204. praat_BandFilterSpectrogram_draw_init (classMelSpectrogram);
  7205. praat_addAction1 (classMelSpectrogram, 0, U"Paint image...", nullptr, 1, GRAPHICS_MelSpectrogram_paintImage);
  7206. praat_addAction1 (classMelSpectrogram, 0, U"Draw triangular filter functions...", nullptr, 1, GRAPHICS_MelSpectrogram_drawTriangularFilterFunctions);
  7207. praat_addAction1 (classMelSpectrogram, 0, U"Draw spectrum at nearest time slice...", nullptr, 1, GRAPHICS_MelSpectrogram_drawSpectrumAtNearestTimeSlice);
  7208. praat_addAction1 (classMelSpectrogram, 0, QUERY_BUTTON, nullptr, 0, 0);
  7209. praat_BandFilterSpectrogram_query_init (classMelSpectrogram);
  7210. praat_addAction1 (classMelSpectrogram, 0, U"Equalize intensities...", nullptr, 0, MODIFY_BandFilterSpectrogram_equalizeIntensities);
  7211. praat_addAction1 (classMelSpectrogram, 0, U"To MFCC...", nullptr, 0, NEW_MelSpectrogram_to_MFCC);
  7212. praat_addAction1 (classMelSpectrogram, 0, U"To Intensity", nullptr, 0, NEW_BandFilterSpectrogram_to_Intensity);
  7213. praat_addAction1 (classMelSpectrogram, 0, U"To Matrix...", nullptr, 0, NEW_BandFilterSpectrogram_to_Matrix);
  7214. praat_addAction1 (classMelSpectrogram, 2, U"Cross-correlate...", nullptr, 0, NEW1_BandFilterSpectrograms_crossCorrelate);
  7215. praat_addAction1 (classMelSpectrogram, 2, U"Convolve...", nullptr, 0, NEW1_BandFilterSpectrograms_convolve);
  7216. praat_addAction1 (classMelFilter, 0, U"MelFilter help", U"*MelSpectrogram help", 0, HELP_MelFilter_help);
  7217. praat_FilterBank_all_init (classMelFilter); // deprecated 2014
  7218. praat_addAction1 (classMelFilter, 0, U"Draw spectrum (slice)...", U"Draw filters...", praat_DEPTH_1 | praat_DEPRECATED_2014, GRAPHICS_MelFilter_drawSpectrum);
  7219. praat_addAction1 (classMelFilter, 0, U"Draw filter functions...", U"Draw filters...", praat_DEPTH_1 | praat_DEPRECATED_2014, GRAPHICS_MelFilter_drawFilterFunctions);
  7220. praat_addAction1 (classMelFilter, 0, U"Paint...", U"Draw filter functions...", praat_DEPTH_1 | praat_DEPRECATED_2014, GRAPHICS_MelFilter_paint);
  7221. praat_addAction1 (classMelFilter, 0, U"To MFCC...", nullptr, praat_DEPRECATED_2014, NEW_MelFilter_to_MFCC); // deprecated 2014
  7222. praat_addAction1 (classMelFilter, 0, U"To MelSpectrogram", nullptr, 0, NEW_MelFilter_to_MelSpectrogram);
  7223. praat_addAction1 (classMFCC, 0, U"MFCC help", nullptr, 0, HELP_MFCC_help);
  7224. praat_CC_init (classMFCC);
  7225. praat_addAction1 (classMFCC, 0, U"To MelFilter...", nullptr, praat_DEPRECATED_2014, NEW_MFCC_to_MelFilter);
  7226. praat_addAction1 (classMFCC, 0, U"To MelSpectrogram...", nullptr, 0, NEW_MFCC_to_MelSpectrogram);
  7227. praat_addAction1 (classMFCC, 0, U"To TableOfReal...", nullptr, 0, NEW_MFCC_to_TableOfReal);
  7228. praat_addAction1 (classMFCC, 0, U"To Matrix (features)...", nullptr, praat_HIDDEN, NEW_MFCC_to_Matrix_features);
  7229. praat_addAction1 (classMFCC, 0, U"To Sound", nullptr, praat_HIDDEN, NEW_MFCC_to_Sound);
  7230. praat_addAction1 (classMFCC, 2, U"Cross-correlate...", nullptr, 0, NEW1_MFCCs_crossCorrelate);
  7231. praat_addAction1 (classMFCC, 2, U"Convolve...", nullptr, 0, NEW1_MFCCs_convolve);
  7232. praat_addAction1 (classMSpline, 0, U"MSpline help", nullptr, 0, HELP_MSpline_help);
  7233. praat_Spline_init (classMSpline);
  7234. praat_addAction1 (classPatternList, 0, U"Draw", nullptr, 0, 0);
  7235. praat_addAction1 (classPatternList, 0, U"Draw...", nullptr, 0, GRAPHICS_PatternList_draw);
  7236. praat_PatternList_query_init (classPatternList);
  7237. praat_addAction1 (classPatternList, 0, MODIFY_BUTTON, nullptr, 0, 0);
  7238. praat_addAction1 (classPatternList, 0, U"Formula...", nullptr, 1, MODIFY_PatternList_formula);
  7239. praat_addAction1 (classPatternList, 0, U"Set value...", nullptr, 1, MODIFY_PatternList_setValue);
  7240. praat_addAction1 (classPatternList, 0, U"To Matrix", nullptr, 0, NEW_PatternList_to_Matrix);
  7241. praat_addAction2 (classPatternList, 1, classCategories, 1, U"To TableOfReal", nullptr, 0, NEW1_Matrix_Categories_to_TableOfReal);
  7242. praat_addAction2 (classPatternList, 1, classCategories, 1, U"To Discriminant", nullptr, 0, NEW1_PatternList_Categories_to_Discriminant);
  7243. praat_addAction1 (classPCA, 0, U"PCA help", nullptr, 0, HELP_PCA_help);
  7244. praat_addAction1 (classPCA, 0, DRAW_BUTTON, nullptr, 0, 0);
  7245. praat_Eigen_draw_init (classPCA);
  7246. praat_addAction1 (classPCA, 0, QUERY_BUTTON, nullptr, 0, 0);
  7247. praat_Eigen_query_init (classPCA);
  7248. praat_addAction1 (classPCA, 1, U"-- pca --", nullptr, 1, 0);
  7249. praat_addAction1 (classPCA, 1, U"Get centroid element...", nullptr, 1, REAL_PCA_getCentroidElement);
  7250. praat_addAction1 (classPCA, 1, U"Get equality of eigenvalues...", nullptr, 1, REAL_PCA_getEqualityOfEigenvalues);
  7251. praat_addAction1 (classPCA, 1, U"Get fraction variance accounted for...", nullptr, 1, REAL_PCA_getFractionVAF);
  7252. praat_addAction1 (classPCA, 1, U"Get number of components (VAF)...", nullptr, 1, INTEGER_PCA_getNumberOfComponents_VAF);
  7253. praat_addAction1 (classPCA, 2, U"Get angle between pc1-pc2 planes", nullptr, 1, REAL_PCAs_getAngleBetweenPc1Pc2Plane_degrees);
  7254. praat_addAction1 (classPCA, 0, MODIFY_BUTTON, nullptr, 0, 0);
  7255. praat_addAction1 (classPCA, 1, U"Invert eigenvector...", nullptr, 1, MODIFY_PCA_invertEigenvector);
  7256. praat_addAction1 (classPCA, 0, U"Align eigenvectors", nullptr, 1, MODIFY_Eigens_alignEigenvectors);
  7257. praat_addAction1 (classPCA, 0, U"Extract -", nullptr, 0, 0);
  7258. praat_addAction1 (classPCA, 0, U"Extract eigenvector...", nullptr, 1, NEW_PCA_extractEigenvector);
  7259. praat_addAction1 (classPCA, 0, U"Extract Eigen", nullptr, 1, NEW_PCA_extractEigen);
  7260. praat_addAction1 (classPCA, 2, U"To Procrustes...", nullptr, 0, NEW1_PCAs_to_Procrustes);
  7261. praat_addAction1 (classPCA, 0, U"To TableOfReal (reconstruct 1)...", nullptr, 0, NEW_PCA_to_TableOfReal_reconstruct1);
  7262. praat_addAction1 (classPCA, 0, U"& TableOfReal: To Configuration?", nullptr, praat_NO_API, HINT_hint_PCA_TableOfReal_to_Configuration);
  7263. praat_addAction1 (classPCA, 0, U"& Configuration (reconstruct)?", nullptr, praat_NO_API, HINT_hint_PCA_Configuration_to_TableOfReal_reconstruct);
  7264. praat_addAction1 (classPCA, 0, U"& Covariance: Project?", nullptr, praat_NO_API, HINT_hint_PCA_Covariance_Project);
  7265. praat_addAction2 (classPCA, 1, classConfiguration, 1, U"To TableOfReal (reconstruct)", nullptr, 0, NEW_PCA_Configuration_to_TableOfReal_reconstruct);
  7266. praat_addAction2 (classPCA, 1, classMatrix, 1, U"To Matrix (pc)...", nullptr, praat_HIDDEN, NEW1_PCA_Matrix_to_Matrix_projectColumns);
  7267. praat_addAction2 (classPCA, 1, classMatrix, 1, U"To Matrix (project rows)...", nullptr, 0, NEW1_PCA_Matrix_to_Matrix_projectRows);
  7268. praat_addAction2 (classPCA, 1, classMatrix, 1, U"To Matrix (project columns)...", nullptr, 0, NEW1_PCA_Matrix_to_Matrix_projectColumns);
  7269. praat_addAction2 (classPCA, 1, classPatternList, 1, U"To Matrix (project rows)...", nullptr, 0, NEW1_PCA_Matrix_to_Matrix_projectRows);
  7270. praat_addAction2 (classPCA, 1, classSSCP, 1, U"Project", nullptr, 0, NEW1_Eigen_SSCP_project);
  7271. praat_addAction2 (classPCA, 1, classTableOfReal, 1, U"To TableOfReal (project rows)...", nullptr, 0, NEW1_PCA_TableOfReal_to_TableOfReal_projectRows);
  7272. praat_addAction2 (classPCA, 1, classTableOfReal, 1, U"To TableOfReal...", U"*To TableOfReal (project rows)...", praat_DEPRECATED_2016, NEW1_PCA_TableOfReal_to_TableOfReal_projectRows);
  7273. praat_addAction2 (classPCA, 1, classTableOfReal, 1, U"To Configuration...", nullptr, 0, NEW1_PCA_TableOfReal_to_Configuration);
  7274. praat_addAction2 (classPCA, 1, classTableOfReal, 1, U"To TableOfReal (z-scores)...", nullptr, 0, NEW1_PCA_TableOfReal_to_TableOfReal_zscores);
  7275. praat_addAction2 (classPCA, 1, classTableOfReal, 1, U"Get fraction variance...", nullptr, 0, REAL_PCA_TableOfReal_getFractionVariance);
  7276. praat_addAction2 (classPCA, 1, classCovariance, 1, U"Project", nullptr, 0, NEW1_Eigen_Covariance_project);
  7277. praat_Eigen_Spectrogram_project (classPCA, classSpectrogram);
  7278. praat_Eigen_Spectrogram_project (classPCA, classBarkSpectrogram);
  7279. praat_Eigen_Spectrogram_project (classPCA, classMelSpectrogram);
  7280. praat_Eigen_Matrix_project (classPCA, classFormantFilter); // deprecated 2014
  7281. praat_Eigen_Matrix_project (classPCA, classBarkFilter); // deprecated 2014
  7282. praat_Eigen_Matrix_project (classPCA, classMelFilter); // deprecated 2014
  7283. praat_addAction1 (classPermutation, 0, U"Permutation help", nullptr, 0, HELP_Permutation_help);
  7284. praat_addAction1 (classPermutation, 0, QUERY_BUTTON, 0, 0, 0);
  7285. praat_addAction1 (classPermutation, 1, U"Get number of elements", nullptr, 1, INTEGER_Permutation_getNumberOfElements);
  7286. praat_addAction1 (classPermutation, 1, U"Get value...", nullptr, 1, INTEGER_Permutation_getValueAtIndex);
  7287. praat_addAction1 (classPermutation, 1, U"Get index...", nullptr, 1, INTEGER_Permutation_getIndexAtValue);
  7288. praat_addAction1 (classPermutation, 0, MODIFY_BUTTON, 0, 0, 0);
  7289. praat_addAction1 (classPermutation, 1, U"Jump...", nullptr, 1, MODIFY_Permutation_tableJump);
  7290. praat_addAction1 (classPermutation, 1, U"Sort", nullptr, 1, MODIFY_Permutation_sort);
  7291. praat_addAction1 (classPermutation, 1, U"Swap blocks...", nullptr, 1, MODIFY_Permutation_swapBlocks);
  7292. praat_addAction1 (classPermutation, 1, U"Swap numbers...", nullptr, 1, MODIFY_Permutation_swapNumbers);
  7293. praat_addAction1 (classPermutation, 1, U"Swap positions...", nullptr, 1, MODIFY_Permutation_swapPositions);
  7294. praat_addAction1 (classPermutation, 1, U"Swap one from range...", nullptr, 1, MODIFY_Permutation_swapOneFromRange);
  7295. praat_addAction1 (classPermutation, 0, U"-- sequential permutations --", nullptr, 1, 0);
  7296. praat_addAction1 (classPermutation, 0, U"Next", nullptr, 1, MODIFY_Permutations_next);
  7297. praat_addAction1 (classPermutation, 0, U"Previous", nullptr, 1, MODIFY_Permutations_previous);
  7298. praat_addAction1 (classPermutation, 1, U"Permute randomly...", nullptr, 0, NEW_Permutation_permuteRandomly);
  7299. praat_addAction1 (classPermutation, 1, U"Permute randomly (blocks)...", nullptr, 0, NEW_Permutation_permuteBlocksRandomly);
  7300. praat_addAction1 (classPermutation, 1, U"Interleave...", nullptr, 0, NEW_Permutation_interleave);
  7301. praat_addAction1 (classPermutation, 1, U"Rotate...", nullptr, 0, NEW_Permutation_rotate);
  7302. praat_addAction1 (classPermutation, 1, U"Reverse...", nullptr, 0, NEW_Permutation_reverse);
  7303. praat_addAction1 (classPermutation, 1, U"Invert", nullptr, 0, NEW_Permutation_invert);
  7304. praat_addAction1 (classPermutation, 0, U"Multiply", nullptr, 0, NEW1_Permutations_multiply);
  7305. praat_addAction1 (classPitch, 2, U"To DTW...", U"To PointProcess", praat_HIDDEN, NEW1_Pitches_to_DTW);
  7306. praat_addAction1 (classPitchTier, 0, U"To Pitch...", U"To Sound (sine)...", 1, NEW_PitchTier_to_Pitch);
  7307. praat_addAction1 (classPitchTier, 0, U"Modify interval...", U"Add point...", 1, MODIFY_PitchTier_modifyInterval);
  7308. praat_addAction1 (classPitchTier, 0, U"Modify interval (tone levels)...", U"Modify interval...", 1, MODIFY_PitchTier_modifyInterval_toneLevels);
  7309. praat_addAction1 (classPolygon, 0, QUERY_BUTTON, U"Paint circles...", 0, 0);
  7310. praat_addAction1 (classPolygon, 0, U"Get number of points", QUERY_BUTTON, 1, INTEGER_Polygon_getNumberOfPoints);
  7311. praat_addAction1 (classPolygon, 0, U"Get point (x)...", U"Get number of points", 1, REAL_Polygon_getPointX);
  7312. praat_addAction1 (classPolygon, 0, U"Get point (y)...", U"Get point (x)...", 1, REAL_Polygon_getPointY);
  7313. praat_addAction1 (classPolygon, 0, U"-- other queries --", U"Get point (y)...", 1, 0);
  7314. praat_addAction1 (classPolygon, 0, U"Get location of point...", U"-- other queries --", 1, INFO_Polygon_getLocationOfPoint);
  7315. praat_addAction1 (classPolygon, 0, U"Get area of convex hull...", U"Get location of point...", praat_DEPTH_1 + praat_HIDDEN, REAL_Polygon_getAreaOfConvexHull);
  7316. praat_addAction1 (classPolygon, 0, U"Translate...", MODIFY_BUTTON, 1, MODIFY_Polygon_translate);
  7317. praat_addAction1 (classPolygon, 0, U"Rotate...", U"Translate...", 1, MODIFY_Polygon_rotate);
  7318. praat_addAction1 (classPolygon, 0, U"Scale...", U"Rotate...", 1, MODIFY_Polygon_scale);
  7319. praat_addAction1 (classPolygon, 0, U"Reverse X", U"Scale...", 1, MODIFY_Polygon_reverseX);
  7320. praat_addAction1 (classPolygon, 0, U"Reverse Y", U"Reverse X", 1, MODIFY_Polygon_reverseY);
  7321. praat_addAction1 (classPolygon, 0, U"Simplify", nullptr, praat_HIDDEN, NEW_Polygon_simplify);
  7322. praat_addAction1 (classPolygon, 0, U"Convex hull", nullptr, 0, NEW_Polygon_convexHull);
  7323. praat_addAction1 (classPolygon, 0, U"Circular permutation...", nullptr, praat_HIDDEN, NEW_Polygon_circularPermutation);
  7324. praat_addAction2 (classPolygon, 1, classCategories, 1, U"Draw...", nullptr, 0, GRAPHICS_Polygon_Categories_draw);
  7325. praat_addAction1 (classPolynomial, 0, U"Polynomial help", nullptr, 0, HELP_Polynomial_help);
  7326. praat_FunctionTerms_init (classPolynomial);
  7327. praat_addAction1 (classPolynomial, 0, U"-- area --", U"Get x of maximum...", 1, 0);
  7328. praat_addAction1 (classPolynomial, 1, U"Get area...", U"-- area --", 1, REAL_Polynomial_getArea);
  7329. praat_addAction1 (classPolynomial, 1, U"Get remainder after division...", U"Get area...", 1, REAL_Polynomial_getRemainderAfterDivision);
  7330. praat_addAction1 (classPolynomial, 1, U"Get remainder...", U"*Get remainder after division...", praat_DEPRECATED_2016, REAL_Polynomial_getRemainderAfterDivision);
  7331. praat_addAction1 (classPolynomial, 0, U"-- monic --", U"Set coefficient...", 1, 0);
  7332. praat_addAction1 (classPolynomial, 0, U"Scale coefficients (monic)", U"-- monic --", 1, MODIFY_Polynomial_scaleCoefficients_monic);
  7333. praat_addAction1 (classPolynomial, 1, U"Divide (second order factor)...", U"Scale coefficients (monic)", 1, MODIFY_Polynomial_divide_secondOrderFactor);
  7334. praat_addAction1 (classPolynomial, 1, U"Get value (complex)...", U"Get value...", 1, INFO_Polynomial_evaluate_z);
  7335. praat_addAction1 (classPolynomial, 1, U"Get derivatives at X...", U"Get value (complex)...", 1, INFO_Polynomial_getDerivativesAtX);
  7336. praat_addAction1 (classPolynomial, 1, U"Get one real root...", U"Get derivatives at X...", 1, REAL_Polynomial_getOneRealRoot);
  7337. praat_addAction1 (classPolynomial, 0, U"To Spectrum...", U"Analyse", 0, NEW_Polynomial_to_Spectrum);
  7338. praat_addAction1 (classPolynomial, 0, U"To Roots", nullptr, 0, NEW_Polynomial_to_Roots);
  7339. praat_addAction1 (classPolynomial, 0, U"To Polynomial (derivative)", nullptr, 0, NEW_Polynomial_getDerivative);
  7340. praat_addAction1 (classPolynomial, 0, U"To Polynomial (primitive)...", nullptr, 0, NEW_Polynomial_getPrimitive);
  7341. praat_addAction1 (classPolynomial, 0, U"Scale x...", nullptr, 0, NEW_Polynomial_scaleX);
  7342. praat_addAction1 (classPolynomial, 2, U"Multiply", nullptr, 0, NEW_Polynomials_multiply);
  7343. praat_addAction1 (classPolynomial, 2, U"Divide...", nullptr, 0, NEWMANY_Polynomials_divide);
  7344. praat_addAction1 (classRoots, 1, U"Roots help", nullptr, 0, HELP_Roots_help);
  7345. praat_addAction1 (classRoots, 1, U"Draw...", nullptr, 0, GRAPHICS_Roots_draw);
  7346. praat_addAction1 (classRoots, 1, QUERY_BUTTON, nullptr, 0, 0);
  7347. praat_addAction1 (classRoots, 1, U"Get number of roots", nullptr, 1, INTEGER_Roots_getNumberOfRoots);
  7348. praat_addAction1 (classRoots, 1, U"-- roots --", nullptr, 1, 0);
  7349. praat_addAction1 (classRoots, 1, U"Get root...", nullptr, 1, COMPLEX_Roots_getRoot);
  7350. praat_addAction1 (classRoots, 1, U"Get real part of root...", nullptr, 1, REAL_Roots_getRealPartOfRoot);
  7351. praat_addAction1 (classRoots, 1, U"Get imaginary part of root...", nullptr, 1, REAL_Roots_getImaginaryPartOfRoot);
  7352. praat_addAction1 (classRoots, 1, MODIFY_BUTTON, nullptr, 0, 0);
  7353. praat_addAction1 (classRoots, 1, U"Set root...", nullptr, 1, MODIFY_Roots_setRoot);
  7354. praat_addAction1 (classRoots, 0, U"Analyse", nullptr, 0, 0);
  7355. praat_addAction1 (classRoots, 0, U"To Spectrum...", nullptr, 0, NEW_Roots_to_Spectrum);
  7356. praat_addAction2 (classRoots, 1, classPolynomial, 1, U"Polish roots", nullptr, 0, MODIFY_Roots_Polynomial_polish);
  7357. praat_addAction1 (classSound, 0, U"To TextGrid (silences)...", U"To IntervalTier", 1, NEW_Sound_to_TextGrid_detectSilences);
  7358. praat_addAction1 (classSound, 0, U"Play one channel...", U"Play", praat_HIDDEN, PLAY_Sound_playOneChannel);
  7359. praat_addAction1 (classSound, 0, U"Play as frequency shifted...", U"Play", praat_HIDDEN, PLAY_Sound_playAsFrequencyShifted);
  7360. praat_addAction1 (classSound, 0, U"Draw where...", U"Draw...", 1, GRAPHICS_Sound_drawWhere);
  7361. // praat_addAction1 (classSound, 0, U"Paint where...", U"Draw where...", praat_DEPTH_1 | praat_HIDDEN, DO_Sound_paintWhere);
  7362. praat_addAction1 (classSound, 0, U"Paint where...", U"Draw where...", 1, GRAPHICS_Sound_paintWhere);
  7363. // praat_addAction1 (classSound, 2, U"Paint enclosed...", U"Paint where...", praat_DEPTH_1 | praat_HIDDEN, DO_Sounds_paintEnclosed);
  7364. praat_addAction1 (classSound, 2, U"Paint enclosed...", U"Paint where...", 1, GRAPHICS_Sounds_paintEnclosed);
  7365. praat_addAction1 (classSound, 0, U"To Pitch (shs)...", U"To Pitch (cc)...", 1, NEW_Sound_to_Pitch_shs);
  7366. praat_addAction1 (classSound, 0, U"Fade in...", U"Multiply by window...", praat_HIDDEN + praat_DEPTH_1, MODIFY_Sound_fadeIn);
  7367. praat_addAction1 (classSound, 0, U"Fade out...", U"Fade in...", praat_HIDDEN + praat_DEPTH_1, MODIFY_Sound_fadeOut);
  7368. praat_addAction1 (classSound, 0, U"To Pitch (SPINET)...", U"To Pitch (cc)...", 1, NEW_Sound_to_Pitch_SPINET);
  7369. praat_addAction1 (classSound, 0, U"To FormantFilter...", U"To Cochleagram (edb)...", praat_DEPRECATED_2014 | praat_DEPTH_1, NEW_Sound_to_FormantFilter);
  7370. praat_addAction1 (classSound, 0, U"To Spectrogram (pitch-dependent)...", U"To Cochleagram (edb)...", 1, NEW_Sound_to_Spectrogram_pitchDependent);
  7371. praat_addAction1 (classSound, 0, U"To BarkFilter...", U"To FormantFilter...", praat_DEPRECATED_2014 | praat_DEPTH_1, NEW_Sound_to_BarkFilter);
  7372. praat_addAction1 (classSound, 0, U"To BarkSpectrogram...", U"To FormantFilter...", praat_DEPTH_1, NEW_Sound_to_BarkSpectrogram);
  7373. praat_addAction1 (classSound, 0, U"To MelFilter...", U"To BarkFilter...", praat_DEPRECATED_2014 | praat_DEPTH_1, NEW_Sound_to_MelFilter);
  7374. praat_addAction1 (classSound, 0, U"To MelSpectrogram...", U"To BarkSpectrogram...", praat_DEPTH_1, NEW_Sound_to_MelSpectrogram);
  7375. praat_addAction1 (classSound, 0, U"To ComplexSpectrogram...", U"To MelSpectrogram...", praat_DEPTH_1 + praat_HIDDEN, NEW_Sound_to_ComplexSpectrogram);
  7376. praat_addAction1 (classSound, 0, U"To Polygon...", U"Down to Matrix", praat_DEPTH_1 | praat_HIDDEN, NEW_Sound_to_Polygon);
  7377. praat_addAction1 (classSound, 2, U"To Polygon (enclosed)...", U"Cross-correlate...", praat_DEPTH_1 | praat_HIDDEN, NEW1_Sounds_to_Polygon_enclosed);
  7378. praat_addAction1 (classSound, 2, U"To DTW...", U"Cross-correlate...", praat_DEPTH_1, NEW1_Sounds_to_DTW);
  7379. praat_addAction1 (classSound, 1, U"Filter (gammatone)...", U"Filter (de-emphasis)...", 1, NEW_Sound_filterByGammaToneFilter4);
  7380. praat_addAction1 (classSound, 0, U"Remove noise...", U"Filter (formula)...", 1, NEW_Sound_removeNoise);
  7381. praat_addAction1 (classSound, 0, U"Change gender...", U"Deepen band modulation...", 1, NEW_Sound_changeGender);
  7382. praat_addAction1 (classSound, 0, U"Change speaker...", U"Deepen band modulation...", praat_DEPTH_1 | praat_HIDDEN, NEW_Sound_changeSpeaker);
  7383. praat_addAction1 (classSound, 0, U"Copy channel ranges...", U"Extract all channels", praat_DEPTH_1 | praat_HIDDEN, NEW_Sound_copyChannelRanges);
  7384. praat_addAction1 (classSound, 0 /* TODO produces 2N objects */, U"Trim silences...", U"Resample...", praat_DEPTH_1 | praat_HIDDEN, NEWMANY_Sound_trimSilences);
  7385. praat_addAction1 (classSound, 0, U"To KlattGrid (simple)...", U"To Manipulation...", 1, NEW_Sound_to_KlattGrid_simple);
  7386. praat_addAction2 (classSound, 1, classPitch, 1, U"To FormantFilter...", nullptr, praat_DEPRECATED_2014, NEW1_Sound_Pitch_to_FormantFilter);
  7387. praat_addAction2 (classSound, 1, classPitch, 1, U"To Spectrogram (pitch-dependent)...", nullptr, 0,NEW1_Sound_Pitch_to_Spectrogram);
  7388. praat_addAction2 (classSound, 1, classPitch, 1, U"Change gender...", nullptr, 0, NEW1_Sound_Pitch_changeGender);
  7389. praat_addAction2 (classSound, 1, classPitch, 1, U"Change speaker...", nullptr, praat_HIDDEN, NEW1_Sound_Pitch_changeSpeaker);
  7390. praat_addAction2 (classSound, 1, classIntervalTier, 1, U"Cut parts matching label...", nullptr, 0, NEW1_Sound_IntervalTier_cutPartsMatchingLabel);
  7391. praat_addAction1 (classSpectrogram, 2, U"To DTW...", U"To Spectrum (slice)...", 1, NEW1_Spectrograms_to_DTW);
  7392. praat_addAction1 (classSpectrum, 0, U"Draw phases...", U"Draw (log freq)...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_Spectrum_drawPhases);
  7393. praat_addAction1 (classSpectrum, 0, U"Set real value in bin...", U"Formula...", praat_HIDDEN | praat_DEPTH_1, MODIFY_Spectrum_setRealValueInBin);
  7394. praat_addAction1 (classSpectrum, 0, U"Set imaginary value in bin...", U"Formula...", praat_HIDDEN | praat_DEPTH_1, MODIFY_Spectrum_setImaginaryValueInBin);
  7395. praat_addAction1 (classSpectrum, 0, U"Conjugate", U"Formula...", praat_HIDDEN | praat_DEPTH_1, MODIFY_Spectrum_conjugate);
  7396. praat_addAction1 (classSpectrum, 2, U"Multiply", U"To Sound (fft)", praat_HIDDEN, NEW_Spectra_multiply);
  7397. praat_addAction1 (classSpectrum, 0, U"To Matrix (unwrap)", U"To Matrix", praat_HIDDEN, NEW_Spectrum_unwrap);
  7398. praat_addAction1 (classSpectrum, 0, U"Shift frequencies...", U"To Matrix", praat_HIDDEN, NEW_Spectrum_shiftFrequencies);
  7399. praat_addAction1 (classSpectrum, 0, U"Compress frequency domain...", U"Shift frequencies...", praat_HIDDEN, NEW_Spectrum_compressFrequencyDomain);
  7400. praat_addAction1 (classSpectrum, 0, U"Resample...", U"Compress frequency domain...", praat_HIDDEN, NEW_Spectrum_resample);
  7401. praat_addAction1 (classSpectrum, 0, U"To Cepstrum", U"To Spectrogram", 1, NEW_Spectrum_to_Cepstrum);
  7402. praat_addAction1 (classSpectrum, 0, U"To PowerCepstrum", U"To Cepstrum", 1, NEW_Spectrum_to_PowerCepstrum);
  7403. praat_addAction1 (classSpeechSynthesizer, 0, U"SpeechSynthesizer help", nullptr, 0, HELP_SpeechSynthesizer_help);
  7404. praat_addAction1 (classSpeechSynthesizer, 0, U"Play text...", nullptr, 0, PLAY_SpeechSynthesizer_playText);
  7405. praat_addAction1 (classSpeechSynthesizer, 0, U"To Sound...", nullptr, 0, NEWMANY_SpeechSynthesizer_to_Sound);
  7406. praat_addAction1 (classSpeechSynthesizer, 0, QUERY_BUTTON, nullptr, 0, 0);
  7407. praat_addAction1 (classSpeechSynthesizer, 1, U"Get language name", nullptr, 1, INFO_SpeechSynthesizer_getLanguageName);
  7408. praat_addAction1 (classSpeechSynthesizer, 1, U"Get voice name", nullptr, 1, INFO_SpeechSynthesizer_getVoiceName);
  7409. praat_addAction1 (classSpeechSynthesizer, 1, U"Get phoneme set name", nullptr, 1, INFO_SpeechSynthesizer_getPhonemeSetName);
  7410. praat_addAction1 (classSpeechSynthesizer, 1, U"Get voice variant", nullptr, praat_DEPRECATED_2017, INFO_SpeechSynthesizer_getVoiceName);
  7411. praat_addAction1 (classSpeechSynthesizer, 0, MODIFY_BUTTON, nullptr, 0, 0);
  7412. praat_addAction1 (classSpeechSynthesizer, 0, U"Modify phoneme set...", nullptr, praat_DEPTH_1, MODIFY_SpeechSynthesizer_modifyPhonemeSet);
  7413. praat_addAction1 (classSpeechSynthesizer, 0, U"Set text input settings...", nullptr, 1, MODIFY_SpeechSynthesizer_setTextInputSettings);
  7414. praat_addAction1 (classSpeechSynthesizer, 0, U"Speech output settings...", nullptr, 1, MODIFY_SpeechSynthesizer_speechOutputSettings);
  7415. praat_addAction1 (classSpeechSynthesizer, 0, U"Estimate speech rate from speech...", nullptr, 1, MODIFY_SpeechSynthesizer_estimateSpeechRateFromSpeech);
  7416. praat_addAction1 (classSpeechSynthesizer, 0, U"Set speech output settings...", nullptr, praat_DEPTH_1 |praat_DEPRECATED_2017, MODIFY_SpeechSynthesizer_setSpeechOutputSettings);
  7417. praat_addAction2 (classSpeechSynthesizer, 1, classTextGrid, 1, U"To Sound...", nullptr, 0, NEWMANY_SpeechSynthesizer_TextGrid_to_Sound);
  7418. praat_addAction3 (classSpeechSynthesizer, 1, classSound, 1, classTextGrid, 1, U"To TextGrid (align)...", nullptr, 0, NEW1_SpeechSynthesizer_Sound_TextGrid_align);
  7419. praat_addAction3 (classSpeechSynthesizer, 1, classSound, 1, classTextGrid, 1, U"To TextGrid (align,trim)...", nullptr, 0, NEW1_SpeechSynthesizer_Sound_TextGrid_align2);
  7420. praat_addAction1 (classSSCP, 0, U"SSCP help", nullptr, 0, HELP_SSCP_help);
  7421. praat_TableOfReal_init2 (classSSCP);
  7422. praat_removeAction (classSSCP, nullptr, nullptr, U"Append");
  7423. praat_addAction1 (classSSCP, 0, U"Draw sigma ellipse...", DRAW_BUTTON, 1, GRAPHICS_SSCP_drawSigmaEllipse);
  7424. praat_addAction1 (classSSCP, 0, U"Draw confidence ellipse...", DRAW_BUTTON, 1, GRAPHICS_SSCP_drawConfidenceEllipse);
  7425. praat_SSCP_query_init (classSSCP);
  7426. praat_addAction1 (classSSCP, 1, U"Get diagonality (bartlett)...", U"Get ln(determinant)", 1, REAL_SSCP_getDiagonality_bartlett);
  7427. praat_addAction1 (classSSCP, 1, U"Get total variance", U"Get diagonality (bartlett)...", 1, REAL_SSCP_getTotalVariance);
  7428. praat_addAction1 (classSSCP, 1, U"Get sigma ellipse area...", U"Get total variance", 1, REAL_SSCP_getConcentrationEllipseArea);
  7429. praat_addAction1 (classSSCP, 1, U"Get confidence ellipse area...", U"Get sigma ellipse area...", 1, REAL_SSCP_getConfidenceEllipseArea);
  7430. praat_addAction1 (classSSCP, 1, U"Get fraction variation...", U"Get confidence ellipse area...", 1, REAL_SSCP_getFractionVariation);
  7431. praat_SSCP_extract_init (classSSCP);
  7432. praat_addAction1 (classSSCP, 0, U"To PCA", nullptr, 0, NEW_SSCP_to_PCA);
  7433. praat_addAction1 (classSSCP, 0, U"To Correlation", nullptr, 0, NEW_SSCP_to_Correlation);
  7434. praat_addAction1 (classSSCP, 0, U"To Covariance...", nullptr, 0, NEW_SSCP_to_Covariance);
  7435. praat_addAction1 (classStrings, 0, U"To Categories", nullptr, 0, NEW_Strings_to_Categories);
  7436. praat_addAction1 (classStrings, 0, U"Append", nullptr, 0, NEW1_Strings_append);
  7437. praat_addAction1 (classStrings, 0, U"Change...", U"Replace all...", praat_HIDDEN, NEW_Strings_change);
  7438. praat_addAction1 (classStrings, 0, U"Extract part...", U"Replace all...", 0, NEW_Strings_extractPart);
  7439. praat_addAction1 (classStrings, 0, U"To Permutation...", U"To Distributions", 0, NEW_Strings_to_Permutation);
  7440. praat_addAction1 (classStrings, 2, U"To EditDistanceTable", U"To Distributions", 0, NEW_Strings_to_EditDistanceTable);
  7441. praat_addAction1 (classSVD, 0, U"SVD help", nullptr, 0, HELP_SVD_help);
  7442. praat_addAction1 (classSVD, 0, QUERY_BUTTON, nullptr, 0, 0);
  7443. praat_addAction1 (classSVD, 1, U"Get number of rows", nullptr, 1, INTEGER_SVD_getNumberOfRows);
  7444. praat_addAction1 (classSVD, 1, U"Get number of columns", nullptr, 1, INTEGER_SVD_getNumberOfColumns);
  7445. praat_addAction1 (classSVD, 1, U"Get condition number", nullptr, 1, REAL_SVD_getConditionNumber);
  7446. praat_addAction1 (classSVD, 0, U"-- singular values ---", nullptr, 1, nullptr);
  7447. praat_addAction1 (classSVD, 1, U"Get singular value...", nullptr, 1, REAL_SVD_getSingularValue);
  7448. praat_addAction1 (classSVD, 1, U"Get sum of singular values...", nullptr, 1, REAL_SVD_getSumOfSingularValues);
  7449. praat_addAction1 (classSVD, 1, U"Get sum of singular values (fraction)...", nullptr, 1, REAL_SVD_getSumOfSingularValuesAsFractionOfTotal);
  7450. praat_addAction1 (classSVD, 1, U"Get minimum number of singular values...", nullptr, 1, INTEGER_SVD_getMinimumNumberOfSingularValues);
  7451. praat_addAction1 (classSVD, 0, U"To TableOfReal...", nullptr, 0, NEW_SVD_to_TableOfReal);
  7452. praat_addAction1 (classSVD, 0, U"Extract left singular vectors", nullptr, 0, NEW_SVD_extractLeftSingularVectors);
  7453. praat_addAction1 (classSVD, 0, U"Extract right singular vectors", nullptr, 0, NEW_SVD_extractRightSingularVectors);
  7454. praat_addAction1 (classSVD, 0, U"Extract singular values", nullptr, 0, NEW_SVD_extractSingularValues);
  7455. praat_addAction1 (classTable, 0, U"Draw ellipses...", U"Draw ellipse (standard deviation)...", praat_DEPTH_1, GRAPHICS_Table_drawEllipses);
  7456. praat_addAction1 (classTable, 0, U"Box plots...", U"Draw ellipses...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_Table_boxPlots);
  7457. praat_addAction1 (classTable, 0, U"Normal probability plot...", U"Box plots...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_Table_normalProbabilityPlot);
  7458. praat_addAction1 (classTable, 0, U"Quantile-quantile plot...", U"Normal probability plot...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_Table_quantileQuantilePlot);
  7459. praat_addAction1 (classTable, 0, U"Quantile-quantile plot (between levels)...", U"Quantile-quantile plot...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_Table_quantileQuantilePlot_betweenLevels);
  7460. praat_addAction1 (classTable, 0, U"Lag plot...", U"Quantile-quantile plot (between levels)...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_Table_lagPlot);
  7461. praat_addAction1 (classTable, 0, U"Horizontal error bars plot...", U"Scatter plot (mark)...", praat_DEPTH_1, GRAPHICS_Table_horizontalErrorBarsPlot);
  7462. praat_addAction1 (classTable, 0, U"Vertical error bars plot...", U"Scatter plot (mark)...", praat_DEPTH_1, GRAPHICS_Table_verticalErrorBarsPlot);
  7463. praat_addAction1 (classTable, 0, U"Distribution plot...", U"Quantile-quantile plot...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_Table_distributionPlot);
  7464. praat_addAction1 (classTable, 1, U"Draw where", U"Lag plot...", 1 , 0);
  7465. praat_addAction1 (classTable, 0, U"Scatter plot where...", U"Draw where", 2, GRAPHICS_Table_scatterPlotWhere);
  7466. praat_addAction1 (classTable, 0, U"Scatter plot where (mark)...", U"Scatter plot where...", 2, GRAPHICS_Table_scatterPlotMarkWhere);
  7467. praat_addAction1 (classTable, 0, U"Horizontal error bars plot where...", U"Scatter plot where (mark)...", praat_DEPTH_2, GRAPHICS_Table_horizontalErrorBarsPlotWhere);
  7468. praat_addAction1 (classTable, 0, U"Vertical error bars plot where...", U"Scatter plot where (mark)...", praat_DEPTH_2, GRAPHICS_Table_verticalErrorBarsPlotWhere);
  7469. praat_addAction1 (classTable, 0, U"Distribution plot where...", U"Scatter plot where (mark)...", 2, GRAPHICS_Table_distributionPlotWhere);
  7470. praat_addAction1 (classTable, 0, U"Draw ellipse where (standard deviation)...", U"Distribution plot where...", 2, GRAPHICS_Table_drawEllipseWhere);
  7471. praat_addAction1 (classTable, 0, U"Box plots where...", U"Draw ellipse where (standard deviation)...", 2, GRAPHICS_Table_boxPlotsWhere);
  7472. praat_addAction1 (classTable, 0, U"Normal probability plot where...", U"Box plots where...", 2, GRAPHICS_Table_normalProbabilityPlotWhere);
  7473. praat_addAction1 (classTable, 0, U"Bar plot where...", U"Normal probability plot where...", 2, GRAPHICS_Table_barPlotWhere);
  7474. praat_addAction1 (classTable, 0, U"Line graph where...", U"Bar plot where...", 2, GRAPHICS_Table_LineGraphWhere);
  7475. praat_addAction1 (classTable, 0, U"Lag plot where...", U"Line graph where...", 2, GRAPHICS_Table_lagPlotWhere);
  7476. praat_addAction1 (classTable, 0, U"Draw ellipses where...", U"Lag plot where...", 2, GRAPHICS_Table_drawEllipsesWhere);
  7477. praat_addAction1 (classTable, 1, U"Get number of rows where...", U"Get number of rows", praat_DEPTH_1 | praat_HIDDEN, INTEGER_Table_getNumberOfRowsWhere);
  7478. praat_addAction1 (classTable, 1, U"Report one-way anova...", U"Report group difference (Wilcoxon rank sum)...", praat_DEPTH_1 | praat_HIDDEN, INFO_Table_reportOneWayAnova);
  7479. praat_addAction1 (classTable, 1, U"Report one-way Kruskal-Wallis...", U"Report one-way anova...", praat_DEPTH_1 | praat_HIDDEN, INFO_Table_reportOneWayKruskalWallis);
  7480. praat_addAction1 (classTable, 1, U"Report two-way anova...", U"Report one-way Kruskal-Wallis...", praat_DEPTH_1 | praat_HIDDEN, INFO_Table_reportTwoWayAnova);
  7481. praat_addAction1 (classTable, 0, U"Extract rows where...", U"Extract rows where column (text)...", praat_DEPTH_1, NEW_Table_extractRowsWhere);
  7482. praat_addAction1 (classTable, 0, U"Extract rows where (mahalanobis)...", U"Extract rows where...", praat_DEPTH_1| praat_HIDDEN, NEW_Table_extractRowsMahalanobisWhere);
  7483. praat_addAction1 (classTable, 0, U"-- Extract columns ----", U"Extract rows where (mahalanobis)...", praat_DEPTH_1| praat_HIDDEN, 0);
  7484. praat_addAction1 (classTable, 0, U"Extract column ranges...", U"-- Extract columns ----", praat_DEPTH_1| praat_HIDDEN, NEW_Table_extractColumnRanges);
  7485. praat_addAction1 (classTable, 0, U"To KlattTable", nullptr, praat_HIDDEN, NEW_Table_to_KlattTable);
  7486. praat_addAction1 (classTable, 1, U"Get median absolute deviation...", U"Get standard deviation...", 1, REAL_Table_getMedianAbsoluteDeviation);
  7487. praat_addAction1 (classTable, 0, U"To StringsIndex (column)...", nullptr, praat_HIDDEN, NEW_Table_to_StringsIndex_column);
  7488. praat_addAction1 (classTableOfReal, 1, U"Report multivariate normality...", U"Get column stdev (label)...", praat_DEPTH_1 | praat_HIDDEN, INFO_TableOfReal_reportMultivariateNormality);
  7489. praat_addAction1 (classTableOfReal, 0, U"Append columns", U"Append", 1, NEW1_TableOfReal_appendColumns);
  7490. praat_addAction1 (classTableOfReal, 0, U"Multivariate statistics -", nullptr, 0, 0);
  7491. praat_addAction1 (classTableOfReal, 0, U"To Discriminant", nullptr, 1, NEW_TableOfReal_to_Discriminant);
  7492. praat_addAction1 (classTableOfReal, 0, U"To PCA", nullptr, 1, NEW_TableOfReal_to_PCA_byRows);
  7493. praat_addAction1 (classTableOfReal, 0, U"To SSCP...", nullptr, 1, NEW_TableOfReal_to_SSCP);
  7494. praat_addAction1 (classTableOfReal, 0, U"To Covariance", nullptr, 1, NEW_TableOfReal_to_Covariance);
  7495. praat_addAction1 (classTableOfReal, 0, U"To Correlation", nullptr, 1, NEW_TableOfReal_to_Correlation);
  7496. praat_addAction1 (classTableOfReal, 0, U"To Correlation (rank)", nullptr, 1, NEW_TableOfReal_to_Correlation_rank);
  7497. praat_addAction1 (classTableOfReal, 0, U"To CCA...", nullptr, 1, NEW_TableOfReal_to_CCA);
  7498. praat_addAction1 (classTableOfReal, 0, U"To TableOfReal (means by row labels)...", nullptr, 1, NEW_TableOfReal_meansByRowLabels);
  7499. praat_addAction1 (classTableOfReal, 0, U"To TableOfReal (medians by row labels)...", nullptr, 1, NEW_TableOfReal_mediansByRowLabels);
  7500. praat_addAction1 (classTableOfReal, 0, U"-- configurations --", nullptr, 1, 0);
  7501. praat_addAction1 (classTableOfReal, 0, U"To Configuration (pca)...", nullptr, 1, NEW_TableOfReal_to_Configuration_pca);
  7502. praat_addAction1 (classTableOfReal, 0, U"To Configuration (lda)...", nullptr, 1, NEW_TableOfReal_to_Configuration_lda);
  7503. praat_addAction1 (classTableOfReal, 2, U"-- between tables --", U"To Configuration (lda)...", 1, 0);
  7504. praat_addAction1 (classTableOfReal, 2, U"To TableOfReal (cross-correlations)...", nullptr, praat_HIDDEN + praat_DEPTH_1, NEW1_TableOfReal_TableOfReal_crossCorrelations);
  7505. praat_addAction1 (classTableOfReal, 1, U"To PatternList and Categories...", U"To Matrix", 1, NEWMANY_TableOfReal_to_PatternList_and_Categories);
  7506. praat_addAction1 (classTableOfReal, 1, U"To Pattern and Categories...", U"*To PatternList and Categories...", praat_DEPTH_1 | praat_DEPRECATED_2015, NEWMANY_TableOfReal_to_PatternList_and_Categories);
  7507. praat_addAction1 (classTableOfReal, 1, U"Split into Pattern and Categories...", U"*To PatternList and Categories...", praat_DEPTH_1 | praat_DEPRECATED_2015, NEWMANY_TableOfReal_to_PatternList_and_Categories);
  7508. praat_addAction1 (classTableOfReal, 0, U"To Permutation (sort row labels)", U"To Matrix", 1, NEW_TableOfReal_to_Permutation_sortRowlabels);
  7509. praat_addAction1 (classTableOfReal, 1, U"To SVD", nullptr, praat_HIDDEN, NEW_TableOfReal_to_SVD);
  7510. praat_addAction1 (classTableOfReal, 2, U"To GSVD", nullptr, praat_HIDDEN, NEW1_TablesOfReal_to_GSVD);
  7511. praat_addAction1 (classTableOfReal, 2, U"To Eigen (gsvd)", nullptr, praat_HIDDEN, NEW1_TablesOfReal_to_Eigen_gsvd);
  7512. praat_addAction1 (classTableOfReal, 0, U"To TableOfReal (cholesky)...", nullptr, praat_HIDDEN, NEW_TableOfReal_choleskyDecomposition);
  7513. praat_addAction1 (classTableOfReal, 0, U"Draw as scalable squares...", U"Draw as squares...", 1, GRAPHICS_TableOfReal_drawAsScalableSquares);
  7514. praat_addAction1 (classTableOfReal, 0, U"-- scatter plots --", U"Draw top and bottom lines...", 1, 0);
  7515. praat_addAction1 (classTableOfReal, 0, U"Draw scatter plot...", U"-- scatter plots --", 1, GRAPHICS_TableOfReal_drawScatterPlot);
  7516. praat_addAction1 (classTableOfReal, 0, U"Draw scatter plot matrix...", U"Draw scatter plot...", 1, GRAPHICS_TableOfReal_drawScatterPlotMatrix);
  7517. praat_addAction1 (classTableOfReal, 0, U"Draw box plots...", U"Draw scatter plot matrix...", 1, GRAPHICS_TableOfReal_drawBoxPlots);
  7518. praat_addAction1 (classTableOfReal, 0, U"Draw biplot...", U"Draw box plots...", 1, GRAPHICS_TableOfReal_drawBiplot);
  7519. praat_addAction1 (classTableOfReal, 0, U"Draw vectors...", U"Draw box plots...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_TableOfReal_drawVectors);
  7520. praat_addAction1 (classTableOfReal, 1, U"Draw row as histogram...", U"Draw biplot...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_TableOfReal_drawRowAsHistogram);
  7521. praat_addAction1 (classTableOfReal, 1, U"Draw rows as histogram...", U"Draw row as histogram...", praat_DEPTH_1 | praat_HIDDEN, GRAPHICS_TableOfReal_drawRowsAsHistogram);
  7522. praat_addAction1 (classTableOfReal, 1, U"Draw column as distribution...", U"Draw rows as histogram...", praat_DEPTH_1, GRAPHICS_TableOfReal_drawColumnAsDistribution);
  7523. praat_addAction2 (classStrings, 1, classPermutation, 1, U"Permute strings", nullptr, 0, NEW1_Strings_Permutation_permuteStrings);
  7524. praat_addAction2 (classTableOfReal, 1, classPermutation, 1, U"Permute rows", nullptr, 0, NEW1_TableOfReal_Permutation_permuteRows);
  7525. praat_addAction1 (classTextGrid, 1, U"Get total duration of intervals where...", U"Count intervals where...", 2, REAL_TextGrid_getTotalDurationOfIntervalsWhere);
  7526. praat_addAction1 (classTextGrid, 0, U"Extend time...", U"Scale times...", 2, MODIFY_TextGrid_extendTime);
  7527. praat_addAction1 (classTextGrid, 1, U"Set tier name...", U"Remove tier...", 1, MODIFY_TextGrid_setTierName);
  7528. praat_addAction1 (classTextGrid, 0, U"Replace interval text...", U"Set interval text...", 2, MODIFY_TextGrid_replaceIntervalTexts);
  7529. praat_addAction1 (classTextGrid, 0, U"Replace point text...", U"Set point text...", 2, MODIFY_TextGrid_replacePointTexts);
  7530. praat_addAction1 (classTextGrid, 2, U"To Table (text alignment)...", U"Extract part...", 0, NEW1_TextGrids_to_Table_textAlignmentment);
  7531. praat_addAction1 (classTextGrid, 0, U"To DurationTier...", U"Concatenate", 0, NEW_TextGrid_to_DurationTier);
  7532. praat_addAction2 (classTextGrid, 1, classDurationTier, 1, U"To TextGrid (scale times)", nullptr, 0, NEW_TextGrid_DurationTier_to_TextGrid);
  7533. praat_addAction2 (classTextGrid, 2, classEditCostsTable, 1, U"To Table (text alignment)...", nullptr, 0, NEW1_TextGrids_EditCostsTable_to_Table_textAlignmentment);
  7534. INCLUDE_MANPAGES (manual_dwtools_init)
  7535. INCLUDE_MANPAGES (manual_Permutation_init)
  7536. INCLUDE_LIBRARY (praat_uvafon_MDS_init)
  7537. INCLUDE_LIBRARY (praat_KlattGrid_init)
  7538. INCLUDE_LIBRARY (praat_HMM_init)
  7539. INCLUDE_LIBRARY (praat_BSS_init)
  7540. }
  7541. /* End of file praat_David.cpp */