Giter VIP home page Giter VIP logo

Comments (1)

grz0zrg avatar grz0zrg commented on August 17, 2024

Do you load the samples through the interface ?

The audio server wavetable implementation can do that already as it recursively load raw single cycle waveforms from directories so to add any samples you just split the sample into small chunks with some kind of windowing applied to remove crackles, guess it can be done quickly with some software.

Made a quick example : https://vocaroo.com/jG2ppKnGZBh

The sample was exported with this small Python script (which require pydub; pip3 install pydub) :

from pydub import AudioSegment

def triangular_window (i, N):
    return 1 - abs(2 * (i - 0.5 * (N - 1)) / N)

audio = AudioSegment.from_wav("female_french_numbers_1_10.wav")
audio_samples = audio.get_array_of_samples()

audio_len = len(audio_samples)
chunk_len = 1348 # 44100 / C1_frequency
chunk_count = round(audio_len / chunk_len)

for i in range(0, chunk_count):
    start_index = i * chunk_len
    stop_index = start_index + chunk_len
    audio_chunk = audio._spawn(audio_samples[start_index:stop_index])

    # apply triangular window
    chunk_samples = audio_chunk.get_array_of_samples()
    chunk_len = len(chunk_samples)
    for k in range(0, chunk_len):
        chunk_samples[k] = int(chunk_samples[k] * triangular_window(k, chunk_len))
    audio_chunk = audio._spawn(chunk_samples)

    audio_chunk.export('out/' + str(i).rjust(8, '0') + '.wav', format="wav")

Could be used for any samples or even a whole directory with some minor adaptation.

The split may eventually be implemented into the audio server (and so on the interface you could have direct drag & drop) but this is low priority as it can be done already and rather quickly with that script.

This is more an issue for the audio server https://github.com/grz0zrg/fas/ as the client don't play sound on its own anymore.

from fsynth.

Related Issues (12)

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.