Feature #596

Feature #821: continuous frequency sonification

non-integer MIDI note playback

Added by Matthias Mauch over 11 years ago. Updated almost 11 years ago.

Status:ClosedStart date:2013-06-19
Priority:HighDue date:
Assignee:Matthias Mauch% Done:

100%

Category:-
Target version:-

Description

Currently only notes at integer midi note frequencies (essentially in 440Hz, equal temperament) can be played back.

Since we often have non-tuned singing, it would be great to have a capability of playing floating-point MIDI frequencies.

I cheekily assign this to Chris. Chris, forgive me.

History

#1 Updated by Matthias Mauch almost 11 years ago

  • Project changed from [tonioni] Tony: a tool for melody annotation to Tony: a tool for melody transcription
  • Priority changed from Normal to High

#2 Updated by Matthias Mauch almost 11 years ago

  • Parent task set to #821

#3 Updated by Chris Cannam almost 11 years ago

  • % Done changed from 0 to 80

Mostly done ("with rough edges").

Replaced the DSSI sample-player plugin (with MIDI interface) with a built-in clip player (audioio/ClipMixer). The sample player was never especially good anyway.

Implementation is currently very simplistic. Remaining to do:

  • Add release time for notes rather than just cutting off dead
  • Use e.g. a small sinc kernel for pulling sample data at new rate rather than linear interpolation (though SV's sample player always used linear interpolation before so this is not a regression)
  • Suppress wildly out-of-range cases (e.g. "notes" with frequencies like 4Hz, 100KHz)
  • Find a more appropriate / nicer sample than the current piano one
  • Test more, especially for overlapping notes (vital obviously for reintegration with SV) and session I/O (the file format has changed in this detail but is intended to be backward compatible)

We do have arbitrary-frequency playback that works, though, and that's the main thing. This refactoring also provides a tidier path in to #822.

#4 Updated by Chris Cannam almost 11 years ago

  • Assignee deleted (Chris Cannam)

Note that the note playback code is now pretty much self-contained in svapp/audioio/ClipMixer.{cpp,h}.

#5 Updated by Matthias Mauch almost 11 years ago

  • Assignee set to Matthias Mauch

This seems to interest mainly me (among the people who are not Chris Cannam), so I should probably take care of it.

#6 Updated by Matthias Mauch almost 11 years ago

Added a new elecpiano.wav sound sample.

Since this has longer decay it actually shows off better why a non-zero release time would sound much better.

Maybe that's the next thing I'll do then.

#7 Updated by Matthias Mauch almost 11 years ago

  • % Done changed from 80 to 90

Ok -- sounds like the simple note release works.
Setting %Done to 90... bit daring, that.

#8 Updated by Chris Cannam almost 11 years ago

Reviewed svapp commit:7105604e9803, I think it's fine.

You have it so the release happens within the note duration, rather than after its nominal end -- the latter is obviously more usual for a midi-type synth (because you don't know a note is ending until it ends). This way it will fail to release properly if there aren't enough samples for the note in the current block, but the other way fails to release properly if there aren't enough samples after the note in the current block (unless extra work is done to carry over the release). Either way the penalty is an over-abrupt release, but this won't happen very often.

Unless we are prepared to put in the extra detail to carry over releases from one block to the next, I think this approach is acceptable. And I'm not sure it is worth that extra work at this point.

I also notice that I can't really hear the aliasing artifacts from linear resampling, with this particular sample (with the old one I thought it was more evident).

The one remaining bullet point (apart from more general testing) then is:

  • Suppress wildly out-of-range cases (e.g. "notes" with frequencies like 4Hz, 100KHz)

#9 Updated by Matthias Mauch almost 11 years ago

So I just committed a simple change that results in notes between 20 and 2000 being played, others not.

The general testing may be a bit cumbersome because atm Tony doesn't actually have overlapping notes at all. Well, something to think about. WIthout the testing I dare not set the percentage done to 100 though...

#10 Updated by Chris Cannam almost 11 years ago

  • Status changed from New to Closed
  • % Done changed from 90 to 100

I think this is good enough. We can open new bugs if new problems appear.

Also available in: Atom PDF