Giter VIP home page Giter VIP logo

Comments (3)

schellingb avatar schellingb commented on May 29, 2024

Hi there,
Thank you for your report and testing.

I carefully stepped through the voice rendering code requesting various sample counts and I ended up finding a different issue where the state of the lowpass filter was not carried across multiple render calls. But that ended up only introducing some noise, never skipped a sample or outputted zero like your recording seems to contain.

Did you run example2.c as is or was your code just based on it? If you modified it, can you post code?

Also, instead of recording a playback you could dump the rendered buffers directly into a file and then inspect it with the tool Audacity with File -> Import -> Raw Data.

Something kinda like this:

enum { BUFFER_WINDOW = 333 };
float Buf[BUFFER_WINDOW * 2];
FILE* f = fopen("D:\\dev\\github\\TinySoundFont\\tsf_work\\out.raw", "wb");
tsf* TSF = tsf_load_filename("D:\\dev\\github\\TinySoundFont\\trunk\\examples\\florestan-subset.sf2");
tsf_set_output(TSF, TSF_STEREO_INTERLEAVED, 44100, 0);
tsf_note_on(TSF, 0, 48, 1.0f);
for (int i = 0; i < 5; i++)
{
	tsf_render_float(TSF, Buf, BUFFER_WINDOW, 0);
	fwrite(Buf, sizeof(Buf), 1, f);
}
tsf_close(TSF);
fclose(f);

Hopefully we can figure this one out (-:
\ Bernhard

from tinysoundfont.

martin-minovski avatar martin-minovski commented on May 29, 2024

It was more than 1 sample per render portion, also seemingly more than zero, but still distorted - and indeed it was the lowpass filter causing this; your latest commit produced a beautiful piano sound (with the help of the right soundfont)! Thanks! #nicelib

from tinysoundfont.

schellingb avatar schellingb commented on May 29, 2024

Awesome to hear! Super stoked we found that one!
Thanks again for reporting.

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.