[Csnd] csound web and local file

Hi All,
i'm starting to explore web Csound as real newbie in web technologies so
i'm in trouble with access to local file. I would like to have csd file as a separate file
and i also have a wav sample that i need but i do not really know how can i do.

Someone has some hint for me?
Thanks,
ciao,
francesco

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Uhm, with a GUI frontend (I use CSoundQt on Linux) you can write and read .csd files and render .wav (and .ogg).

Hi Francesco,

This project might give you hints on what to do as it loads samples and has a CSD maintained separately:

https://github.com/kunstmusik/webaudio-csound-samples-example

Let me know if you have any questions!
Steven

Writing from a position of ignorance but the basic system supports #include of both orchestra and score and so a dual file orc/sco can masquerade as a csd in
<CsoundSynthesizer>
<CsInstruments>
#include "foo.orc"
</CsInstruments>

<CsScore>

#include "foo.sco"
</CsScore
</ScoundSyntheizer>

Also samples can be encapsulated in the csdfile with <CsFileB> which takes a base64 encode file and creates a local copy at render time.

I have no idea if these work in the web-base versions. I would like to know too.

Other than John’s second suggestion, I’m not aware of any way you can work on the Web with anything but a single .csd file - no sample files, etc. Even the powerful Csound IDE doesn’t currently allow sample files to be loaded into a “project.” For that matter, you can’t “upload” anything to the IDE except by copy/paste - which won’t help you much with samples. Right now there is a general problem getting files in and out of Web apps, both locally and into the cloud. Hopefully, such “handshaking” will improve in the future - especially in the IDE.

I face the same kind of issue with MIDI (live) input. Currently, Csound IDE is the only Web-based resource that has implemented MIDI input. The various currently available Web-based resources are either very limited in what they can do, or tend to be quite self-contained. The following website is the one exception to this situation (https://thumbsdb.herokuapp.com/csound/), but unfortunately it won’t handle either MIDI data, or other than .csd files.

Art Hunkins

That’s simply not true. The example I posted shows how to use samples and you can put whatever you need on the virtual file system. This is what allows #include to work on the Csound Web-IDE, which also allows samples to be uploaded:

https://ide.csound.com/editor/5CrtXY1UKEdYA2mf1UoS

Just use “File -> Add File” and choose a file to upload.

Does this work with the AudioWorklet build of Csound? The AudioWorkletProcessor runs in its own JavaScript context.

Yes.

OK, I looked at the sample project. That’s clear enough, thanks.

Thanks for the correction, Steven. I’m very happy that I was wrong on this topic; this apparent “file limitation” had really bothered me.

Frankly I was confused by the terminology; “Add File” just didn’t register. I’m more familiar with “Load”, and for that matter, “Save” - which usually refers to “file it elsewhere” (either to my computer or to the cloud), not remaining within the “project” (another new, and here essential, term).

As found in Audacity, I would rather prefer the terms “Import” and “Export” to be used in the IDE, and I’d particularly like a separate “Export .csd” option, along the lines, recently discussed, of a simpler “IDE Light”. As it is, I feel neophytes (and perhaps old-mode Csounders like me), can be overwhelmed by the IDE, and find ourselves looking for more basic Web-based alternatives.

Art Hunkins