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

load samples as base64 #626

Open
Tracked by #671
felixroos opened this issue Jun 29, 2023 · 1 comment
Open
Tracked by #671

load samples as base64 #626

felixroos opened this issue Jun 29, 2023 · 1 comment
Labels
feature completely new feature

Comments

@felixroos
Copy link
Collaborator

it would be great to be able to load samples as base64 strings directly in the code.
This would make a piece of strudel much more self contained, as it does not depend on external resources.
The editor could truncate / hide base64 strings using https://codemirror.net/docs/ref/#view.Decoration%5Ereplace to not clutter the screen with characters.

maybe the base64 strings can be obtained by running:

samples(...).convert64

though it should probably only convert the sounds that are actually used in the pattern.
to find out which ones are used, the pattern could be queried for 100 cycles or something, then the above would be replaced automatically by:

samples({
  bd: '<base64>',
  sd '<base64>',
  hh ['<base64>', '<base64>'],
  // remaining sounds that are used in the first 100 cycles or something
});
@felixroos felixroos added the feature completely new feature label Jun 29, 2023
@felixroos
Copy link
Collaborator Author

this is already possible by using data urls: https://strudel.tidalcycles.org/?cPSiP164mJ_X

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

No branches or pull requests

1 participant