I turned MTransformer into Pitchmap/reTune

Official support for: meldaproduction.com
Ogundimu
KVRer
Topic Starter
7 posts since 16 Apr, 2022

Post Tue May 10, 2022 1:02 pm

I had some fun with MTransformer and Excel. The result:
I transformed the frequency spectrum of the c chromatic scale into the major and minor scales.
This leads to an effect similar to the sound of zynapitq's pitchmap or zplane's reTune

The code is an example and transforms your audio input into the scale of f minor.
Turn atonal content into harmonic :D
If you lower the buffer size in the spectral settings you preserve more transients, higher buffer size for a shimmer effect.
Turning smearing up while keeping smearing length very short, will bring up a resonator like effect.

Feel free to try it out :)

Code: Select all

$eNql2k1v20YQBuC7fwXBXFNrZ3f2YwBJQZrYaIA4FSIjObP2xiZAkwZJp3EO-e0FNUvGaVJAs7nZFB+a77tjWtB6-eLLXVN8jv1Qd+2mhFNVFrG96q7r9mZTPoyffgvli+3J+uKyr9rhU9ffxX6I41i3N0PxbFNCWTw7P7-c11-jpgRTFs-ex6FrHsbD5dSpmk7Y38Wqr9ubV13TVPdDvGa3v49XY181+3S9719evrt4aMZ6V-XV3dvzP3dVG5tNqabX27Hvmib2w1lb-dVMbDr80PexHXd9HOL45vWm3HXN4-1t19ZXxUXddn2xJKmmm-zn-KeHy+Lsuh67PgUDi8+9Dk+PnlXD46YEZei501gWb9-v75t6HOPhVdiUXrv-HtWbUgcsi4s3r9-s+u6mr+5e3VbtTeQEhwDfHX9VjfGm6+uvsT+8+GFeKArGWl1u1y+vxvpz5Lhz+KfH3lV3cVM+WT3OMFW8mtY1jrEf9Hb9sb4eby+263330F-FYtfHT3Uzxv4wB6pcbder+ZTVjE7Wy3W3611Xt2Nx3lQ3w++bEqwri8vH+7gp92NV90NZfJnGyyhQpiwev329OpqCocUioEYvwCZQoBk7RCABdqi8zcWBwEHCFtAKbEqZrCHnnQAbMsbkYk6ZcKCAQYADWYWZmCti61ApSdcpZSZ26J2eMSkgEGBOydiD1V4wnA6QlpUSY46ZsLOIgszOWVA2F3NHjANYp4+3KWWyqLwSDKdHZZzJxZwyYVLBC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RfpHHkfg==

User avatar
ericzang
KVRian
637 posts since 7 May, 2002 from Phoenix, Arizona, USA

Post Wed May 11, 2022 3:10 pm

very cool and interesting, thanks!

User avatar
Held
KVRian
657 posts since 3 Jan, 2020

Post Wed May 11, 2022 9:43 pm

This sounds great. I would love to know how you created the transformation curve in Excel, if you don't mind sharing your secrets

Ogundimu
KVRer
Topic Starter
7 posts since 16 Apr, 2022

Post Thu May 12, 2022 1:45 pm

Thanks! It was no fancy mathematical transformation, more like a lot of manual labor.
I copied the frequencies of all musical notes from 20hz to 20khz into excel. Next i converted the units hertz to log10, because otherwise you can't properly import the csv table into MTransformer.
To tranform for example c chromatic scale into f minor, i took the note c and assigned it to the f above it. Same with the rest of the notes, so it looks like this:
  • C0 -> F0
  • C#0 -> F0
  • D0 -> G0
  • D#0 -> G#0
  • E0 -> G#0
  • F0 -> A#0
  • F#0 -> A#0
  • G0 -> C1
  • G#0 -> C#1
  • A0 -> C#1
  • A#0 -> D#1
  • B0 -> D#1
... and so on.

User avatar
Held
KVRian
657 posts since 3 Jan, 2020

Post Thu May 12, 2022 11:39 pm

I see. Thanks. So you had one pair of values per note. Looking at the result, it seems like A# - 1cent is mapped to A. So you could shift all the points down by 50 cent to get a more balanced result.

I'll try playing around with this and if I come up with something usable, I'll share it here.

vanerio
KVRist
52 posts since 9 Dec, 2014

Post Fri May 13, 2022 1:30 am

Ogundimu wrote: Thu May 12, 2022 1:45 pm Thanks! It was no fancy mathematical transformation, more like a lot of manual labor.
I copied the frequencies of all musical notes from 20hz to 20khz into excel. Next i converted the units hertz to log10, because otherwise you can't properly import the csv table into MTransformer.
To tranform for example c chromatic scale into f minor, i took the note c and assigned it to the f above it. Same with the rest of the notes, so it looks like this:
  • C0 -> F0
  • C#0 -> F0
  • D0 -> G0
  • D#0 -> G#0
  • E0 -> G#0
  • F0 -> A#0
  • F#0 -> A#0
  • G0 -> C1
  • G#0 -> C#1
  • A0 -> C#1
  • A#0 -> D#1
  • B0 -> D#1
... and so on.
Could you please share the formula for converting Hz to a 0to1 value?

Ogundimu
KVRer
Topic Starter
7 posts since 16 Apr, 2022

Post Fri May 13, 2022 4:44 am

Held wrote: Thu May 12, 2022 11:39 pm I see. Thanks. So you had one pair of values per note. Looking at the result, it seems like A# - 1cent is mapped to A. So you could shift all the points down by 50 cent to get a more balanced result.

I'll try playing around with this and if I come up with something usable, I'll share it here.
I have to admit i didnt quite understand what you explained. Maybe you can get into detail? In my example A# is mapped to D# and shifting all points down by 50 cent would result in A# being mapped between D and D#. That would be a microtonal experiment. :D

To get a more balanced result i changed something else. So basically tried to optimize the transformation and i converted F Chromatic scale into F Minor, instead of C Chromatic into F Minor. Therefor the pairs of mapped notes aren't that far away from each other frequency wise.
If you A B compare both, you hear the difference, because it is now more balanced and overall not so high pitched.
Here is the result:

Code: Select all

$eNqd2k1v2zgQBuB7foWgXrsxhxx+DGC76KYJtkBTBHXQnrUJmwhQpEBSsk0P+9sXsoZq0naBMW98ZT+yyBnbipn1m293TfEY+6Hu2k0Jx6osYnvVXdftzaZ8GL-+Eco326P1+WVftcPXrr+L-RDHsW5vhuLVpoSyeHV2drmrv8dNCaYsXn2KQ9c8jPvTqWM1PWF3F6u+bm9Ouqap7od4Pbvdfbwa+6rZ8flePnzStWPfNU3sh9O2+ruZDquyOHno+9iOF30c4vj+3aa86Jqn+9uura+K87rt+mK50mq6iH-Pfnu4LE6v67Hr+cLB4muvw-Ojp9XwtClBGXrtNJbFh0+7+6Yex7h-FDal1+7no3pT6oBlcf7+3fuLvrvpq7uT26q9ifMM9hN4cfykGuNN19ffY79-8HMqBAVjrS6367dXY-0Y5+mmyT8-9rG6i5vyWXXmOUxLuJrqFsfYD3q7-lJfj7fn2-Wue+ivYnHRx691M8Z+X2dVrrbrVXrKKqGj9XLe7fqiq9uxOGuqm+HPTQnWlcXl033clLuxqvuhLL5N7WMUKFMWTz-GKzEFQy+sJiLr3AFnMIECpTPMQY4dKm9zcSBwkPAcxBgBNXrGHOTYkDEmFztESAvGQY4D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uL9MbrrhXjZk-38jlZ-26xxfnvzthSqWTfj9O2aVLnt7tF795p8Dhu3Rf5An1js=
vanerio wrote: Fri May 13, 2022 1:30 am Could you please share the formula for converting Hz to a 0to1 value?
I used the logarithm with base 10, so actually i converted from Hz to a value between 1 and 5. Because that is what you get, if you put 20Hz up to 20.000Hz into the function log10(x). :wink:

User avatar
vectorwarrior
KVRian
1021 posts since 23 Sep, 2006

Post Fri May 13, 2022 5:32 am

Thanks for sharing, I had considered doing this myself, must have taken some time...

User avatar
Held
KVRian
657 posts since 3 Jan, 2020

Post Fri May 13, 2022 7:18 am

Ogundimu wrote: Fri May 13, 2022 4:44 am
Held wrote: Thu May 12, 2022 11:39 pm I see. Thanks. So you had one pair of values per note. Looking at the result, it seems like A# - 1cent is mapped to A. So you could shift all the points down by 50 cent to get a more balanced result.

I'll try playing around with this and if I come up with something usable, I'll share it here.
I have to admit i didnt quite understand what you explained. Maybe you can get into detail? In my example A# is mapped to D# and shifting all points down by 50 cent would result in A# being mapped between D and D#. That would be a microtonal experiment. :D
At the moment, G to G+99cents (G#-1) is mapped to the same frequency. It would make more sense to map G-50cents to G+49cents to the same frequency, right?

I should have said shift all points to the left since we're talking about the graph and not frequencies. Is that clearer? Or maybe I'm misunderstanding something here.

Ogundimu
KVRer
Topic Starter
7 posts since 16 Apr, 2022

Post Fri May 13, 2022 8:28 am

Oh, i see! Thanks for your explanation.
This totally makes sense. I will optimize it later, it shouldn't be too much work.

edit: Here it is. Thanks for your suggestion. I can't hear much of a difference, but in theory this makes the transformation more stable for notes that are slightly off. So it depends on the input sound, if you can hear a difference.

Code: Select all

$eNqdmstuG0cWhvd+CqK9zVDnfgFIBR5HxhiIA8EykpnZcey2TIAihSbtsb3Isw+KYrXpJAOoeicUuz-V+c9fp+u2+PHz3Wb2qR-269122eEculm-fbt7t97eLruPh-d-i+7HyyeLV2+G1Xb-fjfc9cO+PxzW29v97Omyw2729MWLNzfrr-2yQ+5mT1-3+93m4+GIgzmUB27u+tWw3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rT867uWEvnZRYI-6VAOqMZrAf--JP-02J-l+B7+7Bpm41WQ4yi8qBFePllc-MUVlf3lk-8B1d1cQw==

User avatar
Schopenhauer
KVRist
31 posts since 11 Feb, 2020

Post Sat May 14, 2022 3:01 pm

On a long sweeping bass that is just quite beautiful. Well done and thanks for the upload. Appreciate it.

jan-sandahl
KVRist
47 posts since 17 Apr, 2013 from Sverige

Post Mon May 16, 2022 4:56 am

Ouououou... Very Pretty and cool! Thanks.

Right now I don't have a clue how this works, but I'll look into it! :)

Return to “MeldaProduction”