gogins / csound-extended-manual

An online version of the Csound Reference Manual that embeds the csound-extended-wasm build of Csound to play examples live in Web browsers.
http://gogins.github.io/csound-extended-manual/indexframes.html
GNU Lesser General Public License v2.1
3 stars 0 forks source link

Csound Player - add required sample files? #4

Closed arthunkins closed 3 months ago

arthunkins commented 1 year ago

Would appreciate your adding all the demo samples, such as fox.wav and beats.wav, to the player repository, allowing more opcode examples from your player reference manual to be performed. Someone on the call today, also mentioned the .htrf files and others perhaps that could allow for other opcode example renderings.

Your player reference manual and Player utility are very helpful, much like the Floss manual's playable examples.

gogins commented 1 year ago

Wait a minute -- is this for csound-extended-manual's player? Or is it for the Csound for Android app that can be downloaded from the Google Play store?

For what it's worth, I added these samples to the app.

arthunkins commented 1 year ago

Yes.

Art H.

@.*** http://www.arthunkins.com


From: Michael Gogins @.> Sent: Wednesday, August 23, 2023 3:45 PM To: gogins/csound-android @.> Cc: Arthur Hunkins @.>; Author @.> Subject: Re: [gogins/csound-android] Csound Player - add required sample files? (Issue gogins/csound-extended-manual#4)

Wait a minute -- is this for csound-extended-manual's player?

— Reply to this email directly, view it on GitHubhttps://github.com/gogins/csound-extended-manual/issues/4, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APSKXHDHEX323QPGNEQXEUTXWZMV5ANCNFSM6AAAAAAWXYCRJQ. You are receiving this because you authored the thread.Message ID: @.***>

gogins commented 1 year ago

This is difficult to do, actually.

The reason is that the Emscripten file system used by the WebAssembly build of filesystem only sees the "local" filesystem on the browser side. The browser itself of course can easily request files from the server filesystem, but the C runtime library used by Csound does not see that... I think.

I'm researching to see if this is doable.

gogins commented 3 months ago

OK, the previous comment is more or less correct.

All of the sample files, soundfiles, SoundFonts, and whatnot used by the manual have in fact been uploaded to the gogins.gitub.io/csound-extended-manual/examples directory. But they are not visible and cannot be read by Csound using the C runtime library which provides a hidden filesystem in a protected sandbox.

However, what I have found is that it is possible to embed a sample, a soundfile, a SoundFont, a MIDI file, an image file, an #include file, or indeed any file, and in fact any number of such files, into a .csd file in <CsFIleB filename=file>...</CsFileB> elements of the .csd. The .csd can then be embedded in an HTML file and that can be placed on a local or remote Web server's directory. When Csound compiles the .csd fle, these embedded files are decoded and saved to the local file system, which in this case is the Web browser's protected sandbox or the Android application's private filesystem.

See https://github.com/gogins/csound-ac/issues/27 and https://github.com/gogins/csound-ac/blob/master/vscode-playpen/add2csd.py.

Unfortunately this doesn't help much with the online manual.