Changing standard 440 Hz pitch [SOLVED]

Hi,

I am playing in a band with real instruments :slight_smile:
Our pitch is at 442 Hz.
I wonder if it is possible to change zynthian’s pitch.
I reckon, every application has its own mechanism?
Or is it possible to have a midi filter that changes the pitch wheel values constantly?
I found a logarithmic function in the internet.

"The relation between the Hz value and the Pitchwheel value isn’t a linear function, but rather a logarithmic function.

For a tuning in [A = x Hz] the Pitchwheel value is
8192 * ln(x/440) / ln(2)
For [A = 420 Hz] you get a Pitchwheel value of -550."

Kind regards,
Markus

Hi @mheidt!

It’s not an easy task what you want. If you only want to offset the scale, then the “Pitch Bending” method could be implemented, but there are other tempering systems, different from logarithmic, and here the things get a little bit more complex, as it depends strongly on every synth engine:

Regards!

@mheidt

I can only say this for Dexed: Yes - it has a tune LV2 controller.

The idea with pitch-bend manipulation is really nice. In MOD-UI you can try to use the several MIDI utilities. Perhaps they will work?

Regards, Holger

Hi Holger,

I didn’t find a midi transpose for micro pitching.
But AM pitchshifter does the job. There is a little bug though. If I want to pitch to 442, I have to enter 1.005, the pitch is changed, but the number that is displayed is 1.00.
steve@plugin.org.uk is not available anymore, who was responsible for the plugin.
I hope, we can do the numberformat change ourselves.

regards,
Markus

Maybe this link helps
http://www.hermode.com/downloads/Apple_Logic_Tuning_Data.pdf

@mheidt

Ahh - that looks nice. But every (tone-generator-)plugin has to understand and react to this MIDI message. I think it’s not implemented in the most plugins…

Regards, Holger

When playing with flautists & violins and that kind of low life it’s really a must…
I’ve sat throu’ too many concerts with the classical guitars at 440 & and orchestra off oboe at 442 . . .

It’s probably as much as a standard as we’ll see so it makes a good starting point.
at least its the start of a single choke point for the concept until something better comes along.

How would it be presented in the ui…?

@jofemodo
How would we implement a midi filter in zynthian? Is there something already?

Or could this help?
http://das.nasophon.de/mididings/

@wyleu
we planned sth like this

Hz between 351 and 449

Regards,
Markus

2 Likes

Hi @mheidt,

mididings seems to be a very interesting module for using inside Zynthian! Thanks for pointing to!!!

Regards, Holger

I am still stunningly reading the documentation as well :slight_smile:

Hi @all!

mididings is really great!! Now that the “Maker Faires season” have finished, i can dedicate some neurons to think about how to implement the MIDI router … but first, i need 2-3 days of home-working and family-caring :wink:

Kind Regards!

4 Likes

Hi @Zynthianers!

I just uploaded the changes for the new “MIDI-tuning” feature. You only have to “Update Software” from the admin menu.
You can adjust the tuning of your Zynthian Box in the webconf tool, setting the frecuency for the middle A from 392 to 492 Hz (+/- 1 tone). This is not a “scale transposing” feature but a “fine tuning” feature. Some people love to play with middle A in 432 Hz … jejeje! :wink:

As discussed in this thread, the trick is done by using “Pitch Bending” messages. One pitchbending message is sent after every note-on. Perhaps is more than needed, but it works very well :wink:

The feature works perfectly in the next engines:

  • ZynAddSubFX
  • FluidSynth
  • LinuxSampler

But it doesn’t work in these others:

  • setBfree => This engine doesn’t capture pitchbending messages. I will try other way …
  • MOD-UI => I’ve to figure how to inject the pitchbending message into MOD-UI flow …

Regarding the maths, i used this expression to calculate the PitchBending:

PitchBend=int(8192 * (1+6*(ln(Freq/440) / ln(2)))

It’s slighty different that the expression proposed by @mheidt. I toke it from here:

Enjoy!

1 Like

I love you man :heart_eyes:

First measurement is ok. not 100%, but this could be due to the samples.
Do we you have a pure sinus wave? One I found in ZynAddSubFX, is not pure.

1 Like

Hi @mheidt!

If you create a ZynAddSubFX layer and try to play in the “MIDI channel” screen, before selecting a bank/preset, it should have a pure sine wave :wink:

Regards!

Hi @mheidt!

Could you repeat your measurements with sine wae? Do you think that the pitchbend calculation must be “adjusted” or it’s OK?

Yes, 100% correct :slight_smile:

Hi @jofemodo, @mheidt,

just a short question:
Why is the fine tuning located inside zyncoder? Is ttymidi not a better place for manipulating MIDI things?

Regards, Holger

Hi @C0d3man!

First, ttymidi is only for standard MIDI-IN. USB-MIDI doesn’t flow thru ttymidi.
Second, ttymidi is 3rd party code and we should fork it. I prefer to avoid this.

Zyncoder is not a bad place, although currently, the name “zyncoder” doesn’t fit, and the code should be splited/modularized.

Regards,

Ahh, yep - I forgot…

Thanks!

Holger