Skip to content

Commit

Permalink
Merge pull request #788 from tidalcycles/github-shortcut
Browse files Browse the repository at this point in the history
samples loading shortcuts:
  • Loading branch information
felixroos committed Nov 6, 2023
2 parents 5807dbf + 2ef35a8 commit 395ae4d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/superdough/sampler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,17 @@ export const samples = async (sampleMap, baseUrl = sampleMap._base || '', option
if (handler) {
return handler(sampleMap);
}
if (sampleMap.startsWith('bubo:')) {
const [_, repo] = sampleMap.split(':');
sampleMap = `github:Bubobubobubobubo/dough-${repo}`;
}
if (sampleMap.startsWith('github:')) {
let [_, path] = sampleMap.split('github:');
path = path.endsWith('/') ? path.slice(0, -1) : path;
if (path.split('/').length === 2) {
// assume main as default branch if none set
path += '/main';
}
sampleMap = `https://raw.githubusercontent.com/${path}/strudel.json`;
}
if (sampleMap.startsWith('shabda:')) {
Expand Down

0 comments on commit 395ae4d

Please sign in to comment.