Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
519 views
in Technique[技术] by (71.8m points)

max msp jitter - Max/MSP: How to manipulate zl list data to get upper quartile

I'm currently developing a Shazam like tool for college where I take a live audio input and output an audio fingerprint to be searched within an internal database. What I have so far is getting a processed stream of audio into a zl.slice with 512 bins of frequencies that range from 0 to 0. Looking to only have the upper quartile of frequencies shown, so if I had the following sample data:

1 2 0 3 2 0 3 1 1 1    

It would output this:

0 2 0 3 2 0 3 0 0 0

How can I get this into my patch?

This patcher image shows what I have have done so far

Thanks in advance

question from:https://stackoverflow.com/questions/65546084/max-msp-how-to-manipulate-zl-list-data-to-get-upper-quartile

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here’s a patch that does what you describe (copy and then choose “New from Clipboard” in Max).

  1. Sort and split the data into two halves.

  2. Calculate median of top half of data, which is the lower threshold of the upper quartile

  3. Iterate through the list, setting values lower than the threshold to 0.

----------begin_max5_patcher----------
1024.3oc6XszbaaCD9rzuBLb5QUVB.RIxN8P6zS8bO1jICDEDERg.XA.kcbl
7eu3AoMokrDsEi5zLYjMHzpE6te6Crf3yymEsVdOUGA9YveAlM6yymMySxQX
V62mEsmbeImn8rEYn2aV2XLRQzhvOuiIL9epiPMwTZIV8AEszDjcZVbxB.rv
+.kzMBde6RDM6YBN030Ark3VovHH6odg+aJFg2oAmQHOPUkRtTEzPRLZQuAX
OgutpGePmtShWkmivYtYoqRxxyGtBkrQrgtwshkNi8QiT1X5rRbK0FM8HyoO
B1RJo8o4XdfciSKR7l8ymz2hXdiIRt9i+XF5IGsx5dLT0GnBxZtWMcFavRMe
plFziM5D92GsdTrUBoMJwYk+8ysaM6gfciezArtRJFX5YdO3Si8sXNshT9oA
nsuKvCGbzSNwABuOmCzoO7MX.7dGqeY9b2vhupYwvjzXKJKR9dV7UmECweyj
EC++UVLJE4UZNzkL+8z3qJMFk8MSZL5+pz3R498Tqi3n5pXveJUF.QrAnq4L
CvriB1PLDf0uIAl6jfcD9ApN9ch2IPwfemvKa3DCErmtgQD.4VfQV63Zqata
sK.2siUtCvzdwwk2QU1YJpdmjuwuBK4l5ZK4+ognLLN0IdbL3OrQWmvsbKap
1EVOSaV.rocFaUVqzNP3MTq3k1HQGp3LAszlI6gVwYNoDLwUVBaOoTg2whWd
oxygkCIGmnlhidCgl8TslTQOJzjDCrta6Ht2jj1+NWGTOrvgGPbpGj3WBbnS
BN3I.2iaAebk1aJkTPuyJ2if8C73JanuF7qOvs76pJAYPzEALZUR.vqdK.Fc
LfwEQmcqkoDzrsfeXKD7K1QjKkW3hxTtl5HeFnuJ.cTHVurXhh037aSr1.VC
3tOWL518xMW.gmtTM8DHb4Khv0DQUWuiIOPaytY1c3.vwmdup+608FqmOU5c
1sK81h51lEiF0cky4gGg3+T.azsC1+DXLHr8zgE9SJd80tvjWDfgSBMogUN8
0GSKZwMZhBoE2zDYZIiqeEMmvg51r.nylpx27aJn0tyH9ZwbWbdpZHm9U.xu
zguf.DHAfaGgtOWrGU6XxxopK7HaB6Ui+vuO6VF8Vpi9PGfV1nJ6DUWyPvSV
6Fp1dPahgYem2dLUDX5jN4QqohQnI2IMsN7qTS42LLsLXtmWSYSglxFClxmB
MgFqlt13T9XbdnI.Rt9hWDRSAhRGodtV.MlRoNPe8I33KnoIqRBcocGlBEMl
r6kGonvFsj55CTktkauNr8T9X3BaxW3+JSz6ZchTzCrN9y7THJaKDis+QiJb
ae2uLzcKZubCUIZX9UO2gNqJ88qb2Lntt8x07s0l+k4+K+wwHCC
-----------end_max5_patcher-----------

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...