Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pitch adjustment #90

Open
cannam opened this issue Mar 1, 2024 · 0 comments
Open

Pitch adjustment #90

cannam opened this issue Mar 1, 2024 · 0 comments

Comments

@cannam
Copy link
Member

cannam commented Mar 1, 2024

I received a request for pitch adjustment in SV, I think motivated by problems working with old recordings. That seems like a good idea to me and I responded enthusiastically before remembering how many different possibilities there are for how to do it!

There are two different kinds of pitch adjustment, either of which might be useful:

  1. Resampling - adjusting pitch and speed simultaneously (see also Playback speed: Request old-school speed change as an alternative to timestretch #60). This is typically inadequate for musical purposes like transposition, but it is appropriate if you are working with analogue media recorded at the wrong speed. And because it is "quality neutral" it may be the best choice for very fine adjustments if maintaining tempo is not a critical requirement.
  2. Pitch shifting - adjusting pitch while leaving speed unaffected. This is the other side of the coin to the tempo adjustment that SV already supports during playback. SV uses Rubber Band for tempo adjustment, and the same library supports pitch shifting. This typically makes more perceptual sense than resampling for larger shifts like transpositions or really significant differences in tuning pitch, and is necessary when the tempo must not change, but it always adds some audible artifacts.

And there are at least four ways/places where pitch adjustment might happen:

  1. At origin. For example, by converting the audio source into a temporary file with the adjustment applied, and reading from that. This is how SV handles the "resample mismatching files" option already, so there is some mechanism for this behind the scenes, but there is nothing else in SV that involves going back and applying a change to a file in this way after it has already been loaded, so that would be new. Any adjustment we apply here will affect all visualisations of the file as well as playback. (Is that good?) But it might be difficult to get rapid feedback to changes - the easiest implementation would probably involve a dialog in which you set a new pitch and then wait for the change to happen after you close it.
  2. At origin, but explicitly producing a new file into a new pane. This would be much like applying a pitch-shift effects plugin, which is already possible but isn't particularly convenient. Any adjustment would of course affect visualisations of the new file while leaving the old one unchanged. The UI convenience would be better than choosing a plugin explicitly but still no better than option 1, probably worse.
  3. At audio generation for the individual audio model. This would imply an addition to the volume/pan control area in the layer properties for the waveform layer. This would affect playback only, leaving visualisations showing the original pitch. It would adjust playback of individual files, so with more than one file loaded the user could adjust the pitch of one to match another. Interactive feedback would be immediate.
  4. Globally at output. This would imply an addition to the global volume/pan/speed options cluster at bottom right of the main window. This would affect playback of all files identically and leave visualisations showing the original pitch. Interactive feedback would be immediate.

And finally there are at least three degrees of pitch adjustment one might have in mind, in terms of how the user might want to express them:

  1. Fine tuning by frequency - "adjust from 413 to 440Hz"
  2. Fine tuning by pitch - "raise by 13c"
  3. Transposition - "raise by a fifth" (or at least, a certain whole number of semitones)

Having now thoroughly overthought the problem, it would be good to choose exactly one version of the feature to add. And then to work out how to do the UI! In a way the actual pitch correction is the easy part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant