Giter VIP home page Giter VIP logo

Comments (10)

schellingb avatar schellingb commented on May 30, 2024 1

@frabert The fix ended up ignoring notes in the sustained state as well, instead of just the release state in note_off... My explanation above was correct but sadly not the code. Sigh...
Third time's the charm?
Thanks again for testing!!

from tinysoundfont.

frabert avatar frabert commented on May 30, 2024 1

@schellingb The last commit seems to have fixed the behavior!

from tinysoundfont.

schellingb avatar schellingb commented on May 30, 2024

Hey there!
Thanks for all your great inputs.
What do you think of my recent commit b9a4de3:

Handle note_on/off more like the MIDI standard suggests:
- Change note_on with a velocity of 0 to be handled as note_off
- Change note_on so it doesn't cancel previous note_on of the same preset/key
- Change note_off so it only stops a single corresponding note_on and not all notes playing on the same preset/key

The previous behavior of note_on/off was taken over from SFZero which does not seem to match the MIDI standard descriptions I can find. They require a corresponding note_off for every note_on. My change ends up stopping only the voices of the first played note_on. I was unsure if it would be better to stop the most recent one. Didn't find a ruling on that part. Funnily not even FluidSynth seems to do it correctly...

The handling of v->region->group (which you #ifdef'd out as well) is still untouched as it matches the description in the SF2 specs:

This parameter provides the capability for a key depression in a given instrument to 
terminate the playback of other instruments.  This is particularly useful for 
percussive instruments such as a hi-hat cymbal.  An exclusive class value of zero 
indicates no exclusive class; no special action is taken.  Any other value indicates 
that when this note is initiated, any other sounding note with the same exclusive class 
value should be rapidly terminated.  The exclusive class generator can only appear at 
the instrument level.  The scope of the exclusive class is the entire preset.  In other 
words, any other instrument zone within the same preset holding a corresponding 
exclusive class will be terminated. 

Does that change do anything good for your test?
Thanks again for using the lib!
\ Bernhard

from tinysoundfont.

frabert avatar frabert commented on May 30, 2024

@schellingb The last commit introduced a lot of notes getting "stuck" playing, whereas before I had no issues

from tinysoundfont.

schellingb avatar schellingb commented on May 30, 2024

@frabert Interesting... I assume you don't have a note_off for every single note_on? Or maybe there is a bug... I'll look into it and hope to get back soon with either an option to make the note_off behave as before or a fix. Sorry for the inconvenience!

from tinysoundfont.

frabert avatar frabert commented on May 30, 2024

I generate the note_off programmatically, so there should never be note_ons without note_off

from tinysoundfont.

schellingb avatar schellingb commented on May 30, 2024

@frabert Oh man, sorry for my accusation...
Turned out to be a bug (or rather complete oversight) in the new note_off handling. Of course note_off can't just end the earliest playing voice without checking its state because even after ending it is still playing the release envelope. It should be good now.
Glad you popped in here :-)
Thanks!!

from tinysoundfont.

frabert avatar frabert commented on May 30, 2024

@schellingb No problem man, no offense taken! Thank you very much for the snappy responses and support!

from tinysoundfont.

frabert avatar frabert commented on May 30, 2024

UPDATE: Unfortunately I can still reproduce the problem...

from tinysoundfont.

schellingb avatar schellingb commented on May 30, 2024

Awesome. Closing this one then!

from tinysoundfont.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.