# Convert a list of local properties to a list of criteria in AudioIntervals?

Posted 2 years ago
3228 Views
|
2 Replies
|
2 Total Likes
|
 The criteria function of the AudioIntervals only accepts #prop arguments. How can I convert a list of local properties to a list of criteria? I already have tried prop={"RMSAmplitude" ,"Power", "Loudness"}; audio = ExampleData[{"Sound", "AltoFluteScale"}, "Audio"]; intervals = Table[AudioIntervals[audio, Slot[prop[[propId]]]< .01 &],{propId,1,3,1}]; 
2 Replies
Sort By:
Posted 2 years ago
 Hey Luis:You basically have it…1) AudioInterval[] already dumps intervals without Table, so your construction will produce 3 sets of intervals.2) I got it to look like you want (and produce output) by typing the command like this: int2 = AudioIntervals[a, Slot[prop[[3]]] < 0.1 &] (* same as you had above *) Then select the (entire) Slot[] invocation.Use the menu item Evaluation>>Evaluate in Place. That produces this:I have never understood how to use Front-End tokens, but you can probably use the Evaluate front-end token (i.e. ref/frontendobject/Evaluate) to automate this with Table[]. Attachments:
 The solution from the Wolfram Premier Support: a= ExampleData[{"Sound", "AltoFluteScale"}, "Audio"]; Function[prop, AudioIntervals[a, (Slot[prop] < .01) &]] /@ {"RMSAmplitude", "Power", "Loudness"}