Git Product home page Git Product logo

Comments (2)

shakfu avatar shakfu commented on June 3, 2024

@HighHarmonics2

For such questions, what you should do in general is to create the simplest possible <name>.maxpat file to demonstrate your requirement using the Max application and then save the file. Then look at the .maxpat file in an editor and see how the changes you made are implemented in the .maxpat file.

So for the above requirement, create a single object in a Max file (let's say a [cycle~]) and populate the scripting name of the object from the Max application's inspector (let's say 'osc1') and then save. Then look at the file that was created in an editor and you will find that the Scripting Name field is implemented as varname in the .maxpat file.

So from py2max, you would then do the following to give an object a 'scripting name':

from py2max import Patcher
p = Patcher("outputs/test_scripting_name.maxpat")
p.add_textbox('cycle~ 440', varname='osc1')
p.save()

Incidentally, I have added the above case as a test (see tests/test_scripting_name.py)

You maybe thinking why we don't implement a scripting_name keyword api that maps between scripting_name and varname at the py2max level. The answer is because the current py2max implementation tries to minimally reflect the lower-level api of a .maxpat file and if you make a change in a py2max program you should be able to immediately check if that change is reflected in the .maxpat file. The tradeoff is that you have to remember that varname is mapped to Scripting Name in the Max Application.

It may be that in the future, one can implement a higher-level py2max api which reflects the api from the Max Application side. In this case you would use scripting_name rather than varname, but underneath the lower-level part of py2max would still be generating varname.

from py2max.

HighHarmonics2 avatar HighHarmonics2 commented on June 3, 2024

Thanks. I appreciate the detailed description. And it is helpful to know there is an easy way to find and specify additional values.

from py2max.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.