Detecting within fractional note range.
I’m working on some pitch-matching magic and I’d like to check whether my sample frequency is, say an eighth tone of a target frequency.
My target tones are arriving from a midi file via seq, through a midiparse, stripnote and mtof.
Should I simply run a function on my mtof’d frequencies to determine what my range for a quarter note in each direction should be, perhaps add a pitchbend into the chain that the midi level and then sample that or leverage some other method that is lurking in the toolkit that I have yet to bump into?
I’m looking at using splits to determine whether my sample frequency lies between an eighth below and an eighth above the target frequency but I obviously need to accurately synthesise these frequency values in order to make this work.
Any pointers would be very much appreciated.
Where is the sample frequency coming from? Are you planning on doing some sort of pitch analysis on the sample?
That’s right Chris, but obviously the permissable deviation would vary depending on target pitch.
Well, leaving aside the pitch analysis for now, you could drive mtof with a floating point number and get back a floating point frequency. If your target was C (MIDI 60) you could hit it with notes of 59.75 and 60.25 to find a permissible frequency range.
is this something like what you need?
----------begin_max5_patcher---------- 716.3oc0WtsiaBCDF9ZxSgEWmFgMGBTobQeNpVUQ.SV2B1YMltIc09tWe.ZH cCrvRDkdiUhwY7+7wuGO4kUV16Ymvk1fOC9Jvx5kUVV5oTSXU+cK6h3SI4wk 5kYmvJJvTg8ZyyD3SB87bbFlioIXvQhH4wlmejiKkKOVPXzuwwIBydg1FswY M.4qFcpG.OT+inUEDZNVn2QXSjhkgkPOzNJAH0OMxSMB80wAF0JPjTs1X6+9 mf9MRJiQEz3Br9QegShysururJQyF6zZ8kjeoWODtwQM6qqVoFVOQnkwwOUI g1Y.KCDSiyOWhSAkjCMqLmPwIrJpd4n9YZnFFHzjPpgnnspQS.cQc.TuEHPE 3RAHiwARtR9YbtxP9dVQejw2LMvA8B0jywYHlQ2EH6f6.OSDxzRl+PjuxRd4 PMkIv8ZJGLm7CLNLTKN0oGCs.4DWl5o.AC7TULWf4xORwejCrPnovUvzbdQZ fB8zAHredBWf7rfjRz9qKGZE2GqlqAL5ClAd8BFm+gfQvNbHGaOxrKr9FTS1 gZFuU1Ec6TnI3loDmOhMQ1ln38CefLgheVteu8ZNAqPZsGcFpuEJR6n875qd Z3Xe60Ypa+mveGdw1ANDf8frwBCnCzPflC39ciisiEGntvw9XprWD4avbVrX NXytccYTP8XTLW8hzEBcC5yoDb2bJlCI2OfHQrbmemlU7bqOGrcZMNqAFzzq X+sp3e27RFOz5ZS0L3kLWT6rA4OZCkwCA0kXCb6iOdKyROW6lFbE2VWU1usv 8+.awOJyIoX9Xe4CCgsNc3Zpm361QiCiLaUUMVeiaX0wV2tye8uw0BTM+0IZ IqhmzDz5BafKJLU9+fHTc0iVqI5p07HIMESa2KirSriLozpkPGs.LTEsc.JJ XVUj2hSQJFAGfhfylhfCfQamUF4N.EENqJJb.JxawoH+InH4Wdc0us2vvpK -----------end_max5_patcher-----------
Ha! I completely overlooked the possibility of converting my input frequency into the MIDI realm. For some reason I figured that fractions of notes would just be quantized out.
So good call there Chris.
Thanks for the patch Terry. I’m probably being a bit stupid but how does the bounds comparison work? I understand rounding the input frequency MIDI value to the nearest quarter note but the equivalence operator appears to only have a reference note as input and the comparison appears to be equal or not equal. How is the accuracy +/- 0.125 specified?
Thanks again everyone.
Edit – Scratch that – it was just too simple for me to see it. Excellently elegant solution!
Just one more thing before I shut up Terry: :)
If I wanted to attach something to the underside of the toggle which would constantly add into an accumulator all the the toggle was ‘ON’, say at a certain quantity per second, where might I look for such a component?
Many thanks for all the marvelous help.
Rob, try using the [toggle] to turn on a [metro] set to the rate you want to run at driving something like [counter] or [accum]. You can then use [sel 0] attached to the [toggle] to reset either of these objects when the input goes out of range again.
Forums > MaxMSP