Hopped pitch to frequency... here it is

Sound synthesis techniques, DSP and related mathematics

Moderators: electrogear, exonerate

Hopped pitch to frequency... here it is

Postby datsound on Mon Oct 25, 2010 6:02 pm

here is hopped P-F stream, thanks to the info from MBenjamin and Oddson and all
it is about 1/10th efficiency

i am very chuffed because i do maths like a monkey. i get the figures and multiplications that people give me, wire them about 100 different ways until one combination works. it took me a while.
Attachments
2010-10-25_202220.jpg
2010-10-25_202220.jpg (108.32 KiB) Viewed 1965 times
hopped P-F.osm
(28.94 KiB) Downloaded 114 times
User avatar
datsound
essemist
 
Posts: 115
Joined: Sun Sep 05, 2010 5:52 pm

Re: Hopped pitch to frequency... here it is

Postby exonerate on Mon Oct 25, 2010 6:46 pm

Nice one :)

It surprises me that it is so much faster.

By the way you may as well leave the hop off, it makes no real difference. Hop are only beneficial on large code segments that take up a fair bit of CPU. There's no benefit to hopping a multiply! in fact it may increase CPU usage because the hop has a bit of overhead it's self.

Also the float "c" is not needed you can write directly to the output "f = a * b;"

Cheers ;)

Exo
The Developer Toolkit -- A collection of over 150 modules and counting. Available from the Registered Users forum.
User avatar
exonerate
smaniac
 
Posts: 1487
Joined: Sat Dec 30, 2006 1:57 pm
Location: England, West Yorkshire, Huddersfield

Re: Hopped pitch to frequency... here it is

Postby datsound on Mon Oct 25, 2010 7:13 pm

Oh right i get it. ty.

here is a second version, much more precise (on 48khz) at the mid and top end and this time it is some of the bass notes that are off by .02%, if i had an asio card i would try to figure out a totally equivalent version.

here is the figure that makes it more precise. depending on sr, i dont know. here it is at 48khz.
Attachments
2010-10-25_211353.jpg
2010-10-25_211353.jpg (20.18 KiB) Viewed 1938 times
hopped P-F 2.osm
(28.84 KiB) Downloaded 90 times
Last edited by datsound on Mon Oct 25, 2010 7:16 pm, edited 1 time in total.
User avatar
datsound
essemist
 
Posts: 115
Joined: Sun Sep 05, 2010 5:52 pm

Re: Hopped pitch to frequency... here it is

Postby aliasant on Mon Oct 25, 2010 7:14 pm

Heres mine :)

Slightly faster and more precise.
This one is hoped at 4 but larger hops can be used an it still sounds great.
Attachments
Faster P2F.osm
(30.58 KiB) Downloaded 108 times
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Hopped pitch to frequency... here it is

Postby datsound on Mon Oct 25, 2010 7:19 pm

oh thankyou aliasant. very amazing. it is even good for FM which my one wouldnt do:)

EDIT - i am having issues with both new versions of p.f ... i cant import alaiasant 1 very easity, it crashes, although i did manage to import it and it only half crashed, synthmaker overloaded on something.

with my one i managed to import it and put it in the synth, and then it crashed after a while and every time i reloaded and pressed a button it crashed so i have to re import it and try again to see what the bug is.
edit- it seems to work okay, good idea is to close and reload SM sometimes when it bugs for no obvious reason.
Last edited by datsound on Wed Oct 27, 2010 3:37 pm, edited 1 time in total.
User avatar
datsound
essemist
 
Posts: 115
Joined: Sun Sep 05, 2010 5:52 pm

Re: Hopped pitch to frequency... here it is

Postby MichaelBenjamin on Mon Oct 25, 2010 8:49 pm

heres the one modded with mhz exellent mod of shifrins stream power, gives exact the same results as the stock module and runs ~75%faster at samplerate.

edit: i was wrong, the last two places are sometimes a tiny bit different. i wonder if this comes from the 1/x precalculation. i guess its better to do the sample rate inversion with a real div and try and if not, then also the 1/12 if one needs super exact precision. i think it doesnt matter much since the actual difference is for example 466.62271 hz vs 466.6228 hz, which would be a total phase difference if played together with the length of, if my calculations are correct (1/(9*10^-5))/60= 185.185185 minutes, or ~3hours.
Attachments
fastP2F.by.shifrin.mhz.mb.osm
(28.79 KiB) Downloaded 108 times
Last edited by MichaelBenjamin on Mon Oct 25, 2010 9:01 pm, edited 1 time in total.
User avatar
MichaelBenjamin
smaniac
 
Posts: 1439
Joined: Thu Jul 12, 2007 3:26 pm

Re: Hopped pitch to frequency... here it is

Postby aliasant on Mon Oct 25, 2010 8:57 pm

datsound wrote:oh thankyou oddson. very amazing. it is even good for FM which my one wouldnt do:)

EDIT - i am having issues with both new versions of p.f ... i cant import oddsons one very easity, it crashes, although i did manage to import it and it only half crashed, and the the synced modules and the sound output were all bugged.

with my one i managed to import it and put it in the synth, and then it crashed after a while and every time i reloaded and pressed a button it crashed so i have to re import it and try again to see what the bug is.



Not sure what Oddson has to do with my module but heres a clue.

It uses a wavetable and the table is pretty large. I suggest you remove the after load prim inside the purgable module before saving it to he toolbox. Or even remove the pugable module al together or atleast make sure the loop cant start.
The loop is only needed needed when deciding on how high the pitch should go. I did set it to 150 for this one and that should be high enough for most. You might want to keep the module for the future but click the trigger input on the last Float Array S&H to clear it.
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Hopped pitch to frequency... here it is

Postby aliasant on Mon Oct 25, 2010 9:05 pm

Just tested the Shifrin version.
Mine uses about half of that one but it isnt as exact.
Something I kind of like. Te slight differences in freq might make some nice music :)
Mine migt be a bt tricker to use though. You need to keep an eye on that huge loop it creates for the array.
Saving a schematic with that loop in without clearing the last s&h inside the purgable module will add about 5Mb to the osm. Also clear it before dragging it into the toolbox. And of course after dragging it in from the toolbox the loop eeds a trigger to recalculate. But once you have it the way you want it you can just delete that module al together. The array wil still be saved inside the Waveread Module.
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Hopped pitch to frequency... here it is

Postby datsound on Tue Oct 26, 2010 1:17 am

sweet thanks for the info. So if you had an lfo going into the array, it would make almost infinite values? so you would have to quantize to like 512 / 1024 values per octave then it would probably not be audible? i dunno. it seems really good i will have a go at some point tomorrow. i confused you with oddson for some reason, i think it is from the neurosis of having my 1tb hdd enclosure die from a wind electricity interruption. thanks aliasant
User avatar
datsound
essemist
 
Posts: 115
Joined: Sun Sep 05, 2010 5:52 pm

Re: Hopped pitch to frequency... here it is

Postby infuzion on Sun Dec 26, 2010 5:12 am

Thanks guys!
There is a very slight difference between SM's P-F, but that may be rounding difference. Happens alot when I ASM a set of SM's primitives.

Late Christmas Present:
Faster (by 1 cycle, 15% on Intel C2D) & sexier
Merry Christmas :)
Attachments
fastP2F.by.shifrin.mhz.mb.infuzion Stream Pitch to Frequency.osm
faster & skinned
(12.54 KiB) Downloaded 140 times
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Re: Hopped pitch to frequency... here it is

Postby MegaHurtz on Sun Jan 16, 2011 8:33 pm

Props mates! I was yust working on a project seeking the minimum amount of math for this, so now I know.
Thanks MB and Infuzion!
Visit my website at: http://www.schlukhash.nl
User avatar
MegaHurtz
smaniac
 
Posts: 1502
Joined: Mon Aug 11, 2008 5:29 pm
Location: Eindhoven/Netherlands

Re: Hopped pitch to frequency... here it is

Postby infuzion on Mon Jan 17, 2011 2:54 am

MegaHurtz wrote:Props mates! I was just working on a project seeking the minimum amount of math for this, so now I know. Thanks MB and Infuzion!
Welcome O:)
You do have to test alot using this. I tried my version out in 2 places a OSM I was hired to optimize. The first module I put it in, it actually increased CPU% using SM's CPU readout by alot from the stock SM version. The 2nd place I replaced the SM version worked at reducing overall CPU%
test test test!
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver


Return to Sound

Who is online

Users browsing this forum: No registered users and 0 guests