Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you show how to use customdx7.lib from DawDreamer WITHOUT JAX? #1

Open
turian opened this issue Aug 24, 2024 · 1 comment
Open

Comments

@turian
Copy link

turian commented Aug 24, 2024

The improved dx7.lib is great!

But even with a GPU, JAX rendering is I think slower/more expensive per output than multicore CPU.

I've tried to get CPP rendering to work with sndfile architecture, but that isn't working :(

I've tried stripping JAX from dx7_render.py and not transforming the values, but I end up with empty audio files (or just direct sine-tones always at a high pitch).

Any help would be greatly appreciated!

@DBraun
Copy link
Owner

DBraun commented Aug 24, 2024

Thanks. I think it's an improvement over the one from Faust Libraries, but still not as good as Dexed etc.

In my experience, once you can get to a batch size of 512, the GPU parallelism outweighs the slower clock rate.

For just DawDreamer, it would be like this

import dawdreamer as daw
from scipy.io import wavfile
SAMPLE_RATE = 44100
engine = daw.RenderEngine(SAMPLE_RATE, 512)  # 512 block size
faust_processor = engine.make_faust_processor("faust")
faust_processor.num_voices = 1
code = open("custom_dx7.lib", "r").read()
i = 1  # between 1 and 32
code += f"\nprocess = dx7_algorithm({i});"
faust_processor.set_dsp_string(code)
print(faust_processor.get_parameters_description())
engine.load_graph([(faust_processor, [])])
faust_processor.add_midi_note(60, 100, 0, 3)
engine.set_bpm(120.)
engine.render(4.)  # render 4 seconds
audio = engine.get_audio()  # shaped (C, N samples)
wavfile.write('faust_dx7_demo.wav', SAMPLE_RATE, audio.transpose())
print('All done!')

Note that the parameters are not typical [0-1] VST parameters.

It should be possible to adapt this to the multiprocessing example: https://github.com/DBraun/DawDreamer/tree/main/examples/multiprocessing_plugins

update: made the faust code mono.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants