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

Interpreting SC code that exports a sound file #106

Open
SamKomesarook opened this issue Aug 4, 2021 · 0 comments
Open

Interpreting SC code that exports a sound file #106

SamKomesarook opened this issue Aug 4, 2021 · 0 comments

Comments

@SamKomesarook
Copy link

Hello, thanks for the library!

What is the best way to pipe an audio signal into an external file using the API? The way I am attempting to do so at the moment is to boot the lang:

const sclang = await sc.lang.boot();

and then run the following:

result = await sc_lang.interpret(`( 
          {
          ({RHPF.ar(OnePole.ar(BrownNoise.ar, 0.99), LPF.ar(BrownNoise.ar, 14) * 400 + 500, 0.03, 0.003)}!2) + ({RHPF.ar(OnePole.ar(BrownNoise.ar, 0.99), LPF.ar(BrownNoise.ar, 20) * 800 + 1000, 0.03, 0.005)}!2) * 4
          }.play;
          s.record(duration: 3);
          )`);

If the interpreted code above is run in the SC IDE, it outputs an .aiff in a certain directory. However, the code as run above outputs nothing.

I thought this was because scsynth wasn't running, but when I try to boot it up immediately after sclang, I get the following error:

*** ERROR: failed to open UDP socket: address in use.

That is a separate issue I can try to debug, but I was curious if I was even on the right track for what I am trying to accomplish...

Thank you!

@SamKomesarook SamKomesarook changed the title Exporting Interpreting SC code that exports a sound file Aug 4, 2021
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

1 participant