You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When scribble.clip is called in a browser with Tone.js support (e.g. with a "synth" or other argument), the clip function output is a Tone.js object instead of a note array.
Scribbletune version: 3.6.1
Tone.js version: 13.3.1 or 13.8.25
OS: Windows 10
Browser: Firefox 76.0.1 (64-bit)
A couple of issues with this:
This is confusing and inconsistent. I would expect scribble.clip to return the same type of output every time I call it.
The Tone.js clip output object cannot be passed to scribble.midi in order to create a midi output file because scribble.midi expects the note array built by the normal scribble.clip output.
Unable to use the same clip for playing in-browser and downloading. I could create one clip for playing and one for downloading, but these might not be the same if using the 'R' pattern for random notes, for example.
Example code:
<!DOCTYPE html><html><head><metacharset="utf-8"><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/tone/13.8.25/Tone.js"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/scribbletune/3.6.1/scribbletune.js"></script></head><body><scripttype="text/javascript">constclip1=scribble.clip({notes: scribble.scale('c4 major'),pattern: 'xRxR',randomNotes: ['c4','d4']});console.log("Clip 1: "+clip1);constclip2=scribble.clip({notes: scribble.scale('c4 major'),pattern: 'xRxR',randomNotes: ['c4','d4'],synth: 'PolySynth'});console.log("Clip 2: "+clip2);console.log("Generating midi file for Clip 1");//this succeedsconstlink1=scribble.midi(clip1,'clip1.mid');console.log("Generating midi file for Clip 2");//this fails with "TypeError: o is undefined"constlink2=scribble.midi(clip2,'clip2.mid');</script></body></html>
Sample code console output:
Clip 1: [object Object],[object Object],[object Object],[object Object] clip_midi.html:17:17
Clip 2: Sequence clip_midi.html:26:17
Generating midi file for Clip 1 clip_midi.html:28:17
Generating midi file for Clip 2 clip_midi.html:33:17
TypeError: o is undefined
The text was updated successfully, but these errors were encountered:
I always worked in a way that I d be producing clips ether from the terminal OR play em in the browser (and if I needed to create MIDI, then I d do something similar to what you did).
Having said that, this is a perfectly valid expectation on your part and I cant imagine why I never thought of it! I want to think aloud on what we can do to address this. One option is to just not return a Tone object from clip. But then that means we ll have to provide some additional interface to create a playable Tone object from a clip for sample vs samples and synth (and monosynth). This is not impossible but it moves away from the philosophy of Scribbletune to have a minimal API.
Ideally it d be nice if the clip behaves exactly the way you expected. When passed on to the midi method within a browser, it should simply strip out the Tone.js specific props and continue to operate in a seamless sort of way. This may require us to retain the originally passed params somehow so that they can be invoked again later.
Having an additional interface to create the Tone object fits my expectations better, but I'm also fine with a more seamless approach since that probably fits your philosophy better.
Really, my main concern would be whether I could get the same output for both the download and the browser audio.
When scribble.clip is called in a browser with Tone.js support (e.g. with a "synth" or other argument), the clip function output is a Tone.js object instead of a note array.
Scribbletune version: 3.6.1
Tone.js version: 13.3.1 or 13.8.25
OS: Windows 10
Browser: Firefox 76.0.1 (64-bit)
A couple of issues with this:
Example code:
Sample code console output:
The text was updated successfully, but these errors were encountered: