Skip to content

Commit

Permalink
Quick fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanCacqueray committed Jan 26, 2025
1 parent 0ea14ea commit 935df95
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/strudel.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ export class StrudelSession {
pattern = this.allTransform(pattern);
}

// fix `pattern.fmap is not a function` exception,
// which happens when the pattern is the hubda function.
// TODO: figure out why this is happening, that sounds like a bug with the nudel std lib.

This comment has been minimized.

Copy link
@TodePond

TodePond Jan 26, 2025

Collaborator

pretty sure its because the returned pattern is now a non-pattern when you don't use $:

for example...

an empty strudel pane with silence will throw the error

an empty strudel pane with $: silence will not throw the error

I think we should make the std lib end with something like silence to avoid this error. although we would need to do it in a way that doesn't break things like hydra when used within that. maybe just ending the file with window.silence or something

This comment has been minimized.

Copy link
@TristanCacqueray

TristanCacqueray Jan 26, 2025

Author Collaborator

What's confusing is that strudel was working fine otherwise, it's just that the auto analyze below was raising an exception.

if (typeof pattern === 'function') {
return;
}

// fft wiring
if (this.enableAutoAnalyze) {
pattern = pattern.fmap((value) => {
Expand Down

0 comments on commit 935df95

Please sign in to comment.