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

Deprecated LOM method in max.ts #155

Open
JanZaion opened this issue Jun 29, 2021 · 8 comments
Open

Deprecated LOM method in max.ts #155

JanZaion opened this issue Jun 29, 2021 · 8 comments

Comments

@JanZaion
Copy link
Member

Hello @walmik,

I believe there is a deprecated method in max.ts file. Anytime I load a device that uses scribble.max method in Live 11, it throws this message:

live 11 update of max things

I think that the 'remove_notes' method in max.ts should be changed to 'remove_notes_extended', since the LOM documentation sais the following:

"Deprecated since Live 11.0. Please use remove_notes_extended instead. If a device uses the deprecated method in Live 11, a warning pop-up will notify users that the device needs to be updated."

Simply replacing the method is not backwards compatible with Live 10, so I wrote the following 2 lines:

const live = new LiveAPI('live_app');
live.call('get_major_version') === 10 ? liveObject.call('remove_notes', 0, 1, 258, 127) : liveObject.call('remove_notes_extended', 1, 127, 0, 258);

I would have opened a PR, but I have very little experience writing TS, so Im posting it here. I have tested the solution manually with js object in Max and ES15 syntax. Im posting the ES15 code for posterity:

var live = new LiveAPI('live_app');;
if (live.call('get_major_version') === 10) {
  liveObject.call('remove_notes', 0, 1, 258, 127);
} else {
  liveObject.call('remove_notes_extended', 1, 127, 0, 258);
}
@walmik
Copy link
Collaborator

walmik commented Jun 30, 2021

wow this is a great find, thank you for noting it here.. i havent moved to 11. i ll get this in soon(ish) i have begun some refactoring and documentation work. I ll pick this up.

@JanZaion
Copy link
Member Author

JanZaion commented Jul 2, 2021

Not that Im being paid by Ableton (I wish I was), but 11 is great, highly recommend.

@JanZaion
Copy link
Member Author

JanZaion commented Jul 2, 2021

Maybe its time to retire the scribble.max method alltogether. It is possible to extend Scribbleformax in the following way:

  1. Abstracting the logic that converts Scribbletune clip to Live format to the Node object
  2. Writing plain ES15 script and replacing the current APIpass (where max.ts currently resides)

I have recently written this solution for a project of mine, dealing with all the new Live 11 methods and backwards compatibility issues. I can open a PR and extend latest version of Scribbleformax , if you are interested @walmik

@walmik
Copy link
Collaborator

walmik commented Jul 3, 2021

Sounds great @JanZaion !

@JanZaion
Copy link
Member Author

JanZaion commented Jul 3, 2021

Cool, Ill get to it sometimes mid Jully

@walmik
Copy link
Collaborator

walmik commented Jul 13, 2021

Hi @JanZaion I was renaming a few things

  • templateAPIPass.js -> api.js
  • clip1 -> apiClip
  • scribbleObjects -> scribbledClip

Everything worked fine but as soon as i bring in the new version of Scribbletune (v4.1.0), i m facing a weird issue. It just crashes Live anytime I use webpack to build the updated dist/api.js file :/ In v4.1.0 all the scales and chords were abstracted out to a new module I created and published called harmonics but the rest of the code was more or less the same. I wonder if I ve missed something (like maybe defining the updated version of scribbletune in some max project file)

Do you have some idea what could be going on? I suspect it throws an Uncaught ReferenceError: LiveAPI is not defined (but there s no way to validate this as Max and Live, both crash and I havent figured a way to get to some error logs from Max)

I ve updated the repo with using v4.1.0 of Scribbletune but I havent commited the breaking api.js. The earlier templateAPIPass is still retained for posterity. If you could check out the latest scribbleformax and then do npm install followed by npx webpack, you can reproduce the issue.

Maybe its time to retire the scribble.max method alltogether.

I d love to explore this ^ idea. Would be great if you could give me some example for this, I d like to give it a shot if you re still busy with stuff. Many thanks in advance!

@JanZaion
Copy link
Member Author

Hi @walmik I haven' reproduced the error you are facing. But I faced similar issue few months back. I was trying to push Tonal into Max js object with Webpack and it kept crashing the whole thing just like you describe. Huge headache, I wasn't even able to produce an error message. IMHO we are just lucky that the transpiled version of Scribbletune worked up till this point. Hopefully the new api script will retire the need for transpiled js objects in Max altogether.

I d love to explore this ^ idea. Would be great if you could give me some example for this, I d like to give it a shot if you re still busy with stuff. Many thanks in advance!

I was planning on opening a proper PR sometimes later this week, but since you are eager to get going, I have forked the latest version of Scribbleformax and updated Riff with the new api script. There are some notes on this in the PR. I hope you find it usefull, let me know if you need me to clarify something :)

@walmik
Copy link
Collaborator

walmik commented Jul 13, 2021

Thank you @JanZaion I think this is the right way forward. I ll take a look at the PR in scribbleformax and will continue this discussion there.

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

2 participants