jacbz / Lofi

ML-supported lo-fi music generator
https://lofi.jacobzhang.de?default
Apache License 2.0
354 stars 99 forks source link

instruments #9

Closed AmirMz1 closed 1 year ago

AmirMz1 commented 1 year ago

Hi, thanks for this amazing repository, I am converting this project to python code... And I want to know that the folder "https://github.com/jacbz/Lofi/tree/main/client/assets/samples/instruments" has full instruments and the music is made only on these instruments?

jacbz commented 1 year ago

Hi, I'm not sure what you mean by "full instrument". The folder you linked contains instrument samples. Since this is a web app, we "cheat" and do not have a sample for every note, but rather samples for every major third, which reduces the number of samples and hence makes the site faster to load. The Tone.js library uses pitch correction to fill in the remaining notes. This reduces the audio quality somewhat, but since the sound is meant to be "lo-fi", there is no issue with that. If you implement an offline Python project though, you can of course add a sample for every note.

AmirMz1 commented 1 year ago

Hi, thank you for your answer. I'm loading all notes from mido library in python but the sound of each note has a little different and I need to add some effects and filters from another library

@jacbz you said : "The Tone.js library uses pitch correction to fill in the remaining notes" Do you mean that this library changes the notes and turns them into the notes that are in the instruments folder? Or add the notes from another link...

jacbz commented 1 year ago

The library only loads the notes that are provided, such as A, C, D#, and F# across 5 octaves in the piano folder. If you wish to play a C note, for example, the library will play the corresponding provided sound. However, if you intend to play a C# note, there is no provided sound available. In such cases, the Tone.js Sampler will use the C sound and adjust its pitch to sound like a C#.