Skip to main content
Topic: ConcertPitch.fso (version 1.1) (Read 6382 times) previous topic - next topic

ConcertPitch.fso (version 1.1)

This plugin modifies the 'Concert Pitch' during playback.
It could be useful for those who easily want to playback music in other tunings, different from A=440Hz.

Some examples:
  • Standard Pitch → A=440Hz
  • French Pitch → A=435Hz
  • Scientific Pitch → A=430.5Hz
  • Mozart's Pitch → A=423Hz
  • 19th Century Old Philharmonic Pitch → A=452Hz
  • 19th Century New Philharmonic Pitch → A=439Hz
  • Modern european orchestras → A=443Hz
  • Modern baroque music ensembles → A=415Hz
  • Modern european marimba & vibraphone → A=442Hz
  • Modern USA marimba & vibraphone → A=440Hz

To make the plugin run, insert an instance at the beginning of the staff and select one of the concert pitches in the list. The selected pitch will be visible in the plugin anchor. The pitch change is applied to the MIDI Channel, so all staves configured at the same MIDI Channel will be affected by the plugin instance.

This plugin doesn't add a real 'tuning function', it only approaches to it, and while most of the VSTi's have an option to change the 'tuning' of the VSTi itself, I strongly recommend to use VSTi functions instead of this plugin. Meanwhile, it would be useful for those who doesn't use VSTi or those who can't change the tuning in other way and want to playback music in other pitches.

Copy and paste the next clip in a new NWC 2.75 file and install the User Object from Tools/Manage Objects.
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.75,Single)
|User|ConcertPitch.fso|Pos:-1|Tuning:"435 Hz"
|Clef|Type:Treble
|TimeSig|Signature:4/4
|Note|Dur:Half|Pos:-1
|Note|Dur:Half|Pos:-1
|Bar|Style:Double
|User|ConcertPitch.fso|Pos:-1
|Note|Dur:Half|Pos:-1
|Note|Dur:Half|Pos:-1
!NoteWorthyComposerClip-End

As always, let me know if something went wrong, and... enjoy music :D
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: ConcertPitch.fso (version 1.0)

Reply #1
Hi lloyd,

I notice in your code that you are sending MIDI pitch bend commands to effectively change the concert pitch, which is probably why you say that this isn't a real 'tuning function'. I also noticed that the values you are sending for the various concert pitches are often non-integer values. I assume you realize that the API will convert those floating point values to the nearest integer, since MIDI can only send integer values from 0-127 for each of the two parameters.

Also, any scores that use a Noteworthy multi-point controller to send pitch bend information will of course override the results of your object.

Re: ConcertPitch.fso (version 1.0)

Reply #2
Hi Mike. First, thanks for feedback :))

well, I suposed that those non-integer values will be converted... it could be better if the MIDI command can send values between -8192 and 8191, like in MPC, but I'm affraid there's nothing to do with this  :'( ... and about the MPC, well, it's true that they will override the plugin... I know there's lots of 'holes' in this object (in fact, it's almost useless  ::) ), but as I said in the first post, it is only an approach... there's lots of better ways to play scores in a different concert pitches. This object is only a simple way to listen to a simple score in other pitch.

lloyd.
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: ConcertPitch.fso (version 1.0)

Reply #3
... it could be better if the MIDI command can send values between -8192 and 8191, like in MPC
Actually, you should be able to do that:
Quote
nwcplay.midi(#offsetSPP,'Command',#midiData1,[#midiData2])
You should be able to use both midiData1 and midiData2 to construct a 14 bit value. However, I don't know how that would help, since you still need relatively small pitch bend amounts to simulate a slightly different concert pitch.

Mike

Re: ConcertPitch.fso (version 1.0)

Reply #4
Quote
You should be able to use both midiData1 and midiData2 to construct a 14 bit value.
Really :o ?? it would be great if you could explain it a little more.

Quote
I don't know how that would help
In a range of 0~127, [64= no pitch], [127= +1 tone] and [0= -1 tone]. For modifying the pitch only a cent I'd have to change values in +-0'32 (up or down) but 64.32 will be converted to the nearest integer as you said (64, in this case) so it's impossible. Using MPC range, which is much larger (-8192= -1 tone, 0= no pitch, 8191= +1 tone), a cent would be near 41, so in this case the change seems possible because this value wouldn't be converted. At least, using Noteworthy MPC it's possible, that's because I said that a larger range sould be better.

But of course, this won't solve the problem with other MPC in the same score, so it won't make a big difference

lloyd.
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: ConcertPitch.fso (version 1.0)

Reply #5
You should be able to use both midiData1 and midiData2 to construct a 14 bit value
Really :o ?? it would be great if you could explain it a little more.
Code: (Lua) [Select · Download]
-- PitchBend.rgtest.nwcuser.lua Version 1.00
local method = {}
method.spec = {
{ id='v', type='int', default=0, min=-8192, max=8191 },
}
method.play = function(t)
local b14 = t.v + 8192
local midiData1 = bit32.extract(b14, 0, 7)
local midiData2 = bit32.extract(b14, 7, 7)
nwcplay.midi(0, 'pitchBend', midiData1, midiData2)
end
return method
Registered user since 1996

 

Re: ConcertPitch.fso (version 1.0)

Reply #6
...and once more RickG. brings the solution  :D  Thanks a lot!
I'm affraid that code is a little advanced for my beginner skills, but I'll try to use it to make the pitch more accurate.
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: ConcertPitch.fso (version 1.0)

Reply #7
Two observations:

"19th Century Old Philharmonic Pitch → A=452Hz" ???
452Hz seems highly unlikely. Maybe 425HZ ?

".fso" looks like the file extension of a language.
If it's intended to identify the author, may I suggest  naming it:
"fso_ConcertPitch"
(This would be in the same style as many "rg_....." )

Re: ConcertPitch.fso (version 1.0)

Reply #8
Quote
452Hz seems highly unlikely. Maybe 425HZ ?
There's lots of concert pitch in 19th century because at this time there wasn't any standard. In the 19th century orchestras started to rise the concert pitch, searching a brighter sound and arrived to more than 450Hz. Of course singers were the most affected, that's because, in 1859, French government stablished a law setting the A pitch at 435 Hz.

Quote
".fso" looks like the file extension of a language.
User Objects have a standard name and extension: <UserObjectName>.ID.nwcuser.lua. Each user (creator) has his/her own ID, in my case, fso,thats because my plugins are ".fso.nwcuser.lua".
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: ConcertPitch.fso (version 1.0)

Reply #9
Thank you for enlightening me

Re: ConcertPitch.fso (version 1.0)

Reply #10
User Object updated to v1.1:
  • Some code fixes using RickG.'s suggestion (thanks again  :D ) which provides a little more accurate results.
  • The behavior of the object with MPC's is now a little different: it adds the ConcertPitch.fso effect considering (if exists) the value of the previous pitch MPC.
  • The object itself now alerts the user displaying a dialog box when it finds any Pitch Bend MPC:
    "Any Multi-Point Controller sending pitch information will override the effect of this plugin. A new instance of ConcertPitch.fso can be inserted after an MPC to re-enable the plugin, but during the pitch bending the effects will be null."
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.