Author Topic: Scripting in OpenMPT  (Read 25637 times)

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,516
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Scripting in OpenMPT
« Reply #45 on: July 09, 2017, 10:39:21 »
Can it open a textfile, read its content, parse it, and perform actions based on that?
Lua has a file I/O package, yes, and I will enable all the default Lua packages.

Can it also get information FROM the tracker?
Yes, that is the entire point of the API. ;)

Oh, and if possible, can the script generate a dialog with buttons and perform actions based on custom button presses?
Oh come on, it's even being discussed in the first post on this page...
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,135
    • http://lpchip.nl
  • Operating System: Windows 10 Pro x64
Re: Scripting in OpenMPT
« Reply #46 on: July 09, 2017, 10:43:07 »
Okay, I admit, that last one I got carried away in enthusiasm and it was a bit of teasing on my end. :P
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,516
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Scripting in OpenMPT
« Reply #47 on: July 09, 2017, 10:43:58 »
I like how my post is now referring to itself recursively due to the page break.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,135
    • http://lpchip.nl
  • Operating System: Windows 10 Pro x64
Re: Scripting in OpenMPT
« Reply #48 on: July 09, 2017, 10:47:16 »
I like how my post is now referring to itself recursively due to the page break.

Hahahaha I hadn't noticed. I read first post of this topic, not page...
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Offline JanKXSKI

  • Shy artist
  • Posts: 2
Re: Scripting in OpenMPT
« Reply #49 on: April 05, 2022, 10:37:01 »
I am very sorry to revive an old thread, but any update on this? I cannot find references to scripting in the doc/version history. I would like to export pattern data from OpenMPT to json.

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,516
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: Scripting in OpenMPT
« Reply #50 on: April 05, 2022, 10:47:49 »
I work on this every now and then, but there's not so much progress. It's a huge and difficult task. The current state can be tried at https://github.com/sagamusix/openmpt but I don't remember if accessing pattern data currently works. libopenmpt might currently be an easier / more stable way to get pattern data out of module files, or maybe copying all patterns to the clipboard and then transforming the text data to json with an external tool.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline JanKXSKI

  • Shy artist
  • Posts: 2
Re: Scripting in OpenMPT
« Reply #51 on: April 05, 2022, 11:01:21 »
Thank you for the reply and the effort! I'll look into the alternatives you suggested.