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

discrepancies after running: npx webpack #14

Open
case303 opened this issue Jul 24, 2021 · 6 comments
Open

discrepancies after running: npx webpack #14

case303 opened this issue Jul 24, 2021 · 6 comments

Comments

@case303
Copy link

case303 commented Jul 24, 2021

Hi walmik, I'm trying to get scribbleformax running on my Mac.
Whenever I attempt to load any locally transpiled files, Max crashes.

I've got a private branch of your latest build.
After running npx webpack, looking at chords.js, there are discrepancies in the /dist file.
I must have something configured incorrectly.

Any insight is greatly appreciated!

@walmik
Copy link
Contributor

walmik commented Jul 25, 2021

Hi @case303 Thank you for creating this issue. I m aware of this issue as myself and @JanZaion have also been going over it for some days now.

tldr;

  • If all you care about is making music, then use an older version of scribbleformax - this is available on my maxforlive page https://maxforlive.com/profile/user/walmik
  • If you re keen on developing something on top of the Riff device (or want to augment it) I d recommend using the latest version of scribbleformax and the Riff.amxd in it (the approach in this removes the need for webpack and files from dist/ (with dist/api.js and dist/riff.js being the source files themselves - The "Chord" device is currently broken in the latest but available from my maxforlive page)

Just a bit of an explanation on what s going on:

We have recently moved to using maxApi. This allows us some freedom in terms of using ES6 syntax, the dict object and node modules in general but it cannot write clips. For that we continue to use the max JS object (which is an older version of ES5) but has access to the LOM (Live Object Model) needed for writing clips. While there is still some uncertainty around what should be the way forward, we can use a combination of both where one part of the script can use maxApi and then "hand over" control to the script executed by the JS object (which is what Riff.amxd is currently doing).

The maxApi node module is just a dummy module for synctactic sugar. There isnt any module that actually gets downloaded hence it cannot be part of the webpack transpilation config. The current src/api.js will soon be removed and some folder structure might be changed if we remove the transpilation step completely because src and dist wont make any sense as all the JS will be just source that max can execute without transpilation. Lastly a couple of methods from dist/api.js and dist/riff.js will make it the main Scribbletune library so that there is overall less code to be written within the scribbleformax repo (this repo).

Hope that makes sense! Please dont hesitate to ask any further questions and let me know how it goes with getting scribbleformax works locally for you!

@walmik
Copy link
Contributor

walmik commented Jul 25, 2021

@JanZaion I tried freezing the device to test it s use on another machine. But unfortunately there it didnt work and when I opened it up for editing, I could see the error message that node.script has not been started.

I remember you had mentioned something around publishing the device such that node.script is started and npm install also happens automatically. Could you please remind me what that was or point me to a link? I want to be able to publish the new version to maxforlive such that folks can use the updated version of Riff with our new approach using maxApi!

@case303
Copy link
Author

case303 commented Jul 25, 2021

Thanks @walmik for the explanation. I did notice, and had success experimenting directly in /dist.
Interesting to learn what's going on. I've been following your challenges with ES5, and was excited to learn how scribbleformax was writing its clips. I'll keep my eyes peeled and have a deeper dive into the Riff to see how you guys are taking advantage of both worlds.

@case303 case303 closed this as completed Jul 25, 2021
@JanZaion
Copy link
Member

Hi @walmik and @case303 ,

unfortunetely when using node.script object, you cant simply freeze the device as you would with "vanilla" M4L patch. Here is the link I think you're asking for. There are some downsides to this however, I went over them in the last comment in this PR.

In summary, there are 2 ways to produce the final device:

  1. Bundle it with Max (a different thing than M4L, its superconfusing actually, see the link above)
  2. Making the end user (a music producer) download a folder with some stuff instead of just the .amxd file and providing installation instruction. The folder would contain package.json and the .amxd device withing this folder would have a button that would be clicked during a first time use in order to execute npm script install cmd and do as instructed by the package.json. This might be a PR of its own actually. I think that a non-technical user should be able to follow these instructions, since it doesen't require node and npm installed (it's using those in Max). But this option will never be as sleek and simple as option 1.

My 2 cents, hope it helps!

@walmik
Copy link
Contributor

walmik commented Jul 25, 2021

@JanZaion Thank you for the detailed response! I ll go over the link you shared. I think we must provide a clean way for producers to drop in the device and start using right away. I ll try the bundling approach you recommended.

@walmik
Copy link
Contributor

walmik commented Jul 25, 2021

@case303 I m re-opening this issue as it continues to exist in terms of what you ve pointed out in the description. Will close it once we resolve it.

@walmik walmik reopened this Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants