midiscripter


Namemidiscripter JSON
Version 0.2 PyPI version JSON
download
home_pageNone
SummaryFramework for scripting MIDI, keyboard and Open Sound Control input and output
upload_time2024-04-30 11:36:26
maintainerNone
docs_urlNone
authorMaboroshy
requires_python>=3.11
licenseGNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
keywords midi osc automation input script
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MIDI Scripter

MIDI Scripter is a framework for scripting MIDI, keyboard and Open Sound Control (OSC) input and output with a few lines of Python code.

MIDI Scripter is intended for digital audio workstation (DAW) controls scripting but can also be used for general input conversion and automation. It fits where controller mappings are not enough but rewriting DAW controller integration is too much. 

An octave transposer with GUI controls in 10 lines of code:

``` python
from midiscripter import *  # safe * import with no bloat

midi_keyboard = MidiIn('Port name')  # GUI will provide you with port names
proxy_output = MidiOut('loopMIDI Port') # using loopMIDI virtual port for output

# GUI control in a single line, many widget available, custom widgets supported
octave_selector = GuiButtonSelectorH(('-2', '-1', '0', '+1', '+2'), select='0')

@midi_keyboard.subscribe  # decorated function will receive port's messages
def transpose(msg: MidiMsg) -> None:
	if msg.type == MidiType.NOTE_ON or msg.type == MidiType.NOTE_OFF:  # filter
		msg.data1 += 12 * int(octave_selector.selected_item_text)  # modify
		proxy_output.send(msg)  # route

if __name__ == '__main__':  # combine multiple scripts by importing them
	start_gui()  # opens helpful customizable GUI
```

![Screenshot](https://github.com/Maboroshy/midi-scripter/blob/master/examples/octave_transposer/screenshot.png?raw=true)

[Scripting guide and API documentation available](https://maboroshy.github.io/midi-scripter)

Easy tasks for MIDI Scripter:  
1. Filter, modify and route MIDI, OSC and keyboard messages in any way.  
2. Map MIDI, OSC and keyboard to each other.  
3. Map any Python code to input message.  
4. Make extra "shift" keys to multiply MIDI controls.  
5. Organize mappings into sets / scenes with GUI controls.  
6. Make an extra overlay mappings on top of MIDI controller's default DAW integration by using proxy.  

Complex tasks for MIDI Scripter:
1. Create and map complex macros involving multiple hardware or virtual MIDI controllers.
2. Make custom sequencer or MIDI input generator.
3. Make music education ot trainer GUI application based on MIDI input.

Currently MIDI Scripter is at "beta" development stage. It's fully functional but needs some more testing. It targets only Windows for now but Linux and macOS support will follow.

## Installation
1. [Python 3.11+](https://www.python.org/downloads/) with "Add python.exe to PATH" option.
2. [loopMIDI](https://www.tobias-erichsen.de/software/loopmidi.html) for virtual MIDI output ports on Windows.
3. `pip install midiscripter` in console.

## Setup
Run loopMIDI and add virtual ports you want to send MIDI messages. You can enable its autostart option.

Enable virtual MIDI output ports as MIDI inputs in DAW. 

## Quick Start
1. Paste [script template](examples/script_template.py) to Python IDE or plain text editor. IDE is greatly recommended.
2. Run unchanged template script from IDE or by `python .\script_template.py` to open GUI for more info on available ports and their input.
3. Turn on the ports' checkboxes to enable them and watch the log for input messages.
4. Click on port names and messages to copy their declarations to the clipboard. Paste the declarations to your script.
5. Write the functions you need. Subscribe them to messages with `@input_port.subscribe` decorator. Use `log('messages')` for debugging. Use `output_port.send(msg)` to send modified or created messages from a function.
6. Restart the script from GUI.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "midiscripter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "MIDI, OSC, automation, input, script",
    "author": "Maboroshy",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9d/8c/377b55da37d4744bc142cece529b7238a20336824549228f4d01bb0d703d/midiscripter-0.2.tar.gz",
    "platform": null,
    "description": "# MIDI Scripter\n\nMIDI Scripter is a framework for scripting MIDI, keyboard and Open Sound Control (OSC) input and output with a few lines of Python code.\n\nMIDI Scripter is intended for digital audio workstation (DAW) controls scripting but can also be used for general input conversion and automation. It fits where controller mappings are not enough but rewriting DAW controller integration is too much. \n\nAn octave transposer with GUI controls in 10 lines of code:\n\n``` python\nfrom midiscripter import *  # safe * import with no bloat\n\nmidi_keyboard = MidiIn('Port name')  # GUI will provide you with port names\nproxy_output = MidiOut('loopMIDI Port') # using loopMIDI virtual port for output\n\n# GUI control in a single line, many widget available, custom widgets supported\noctave_selector = GuiButtonSelectorH(('-2', '-1', '0', '+1', '+2'), select='0')\n\n@midi_keyboard.subscribe  # decorated function will receive port's messages\ndef transpose(msg: MidiMsg) -> None:\n\tif msg.type == MidiType.NOTE_ON or msg.type == MidiType.NOTE_OFF:  # filter\n\t\tmsg.data1 += 12 * int(octave_selector.selected_item_text)  # modify\n\t\tproxy_output.send(msg)  # route\n\nif __name__ == '__main__':  # combine multiple scripts by importing them\n\tstart_gui()  # opens helpful customizable GUI\n```\n\n![Screenshot](https://github.com/Maboroshy/midi-scripter/blob/master/examples/octave_transposer/screenshot.png?raw=true)\n\n[Scripting guide and API documentation available](https://maboroshy.github.io/midi-scripter)\n\nEasy tasks for MIDI Scripter:  \n1. Filter, modify and route MIDI, OSC and keyboard messages in any way.  \n2. Map MIDI, OSC and keyboard to each other.  \n3. Map any Python code to input message.  \n4. Make extra \"shift\" keys to multiply MIDI controls.  \n5. Organize mappings into sets / scenes with GUI controls.  \n6. Make an extra overlay mappings on top of MIDI controller's default DAW integration by using proxy.  \n\nComplex tasks for MIDI Scripter:\n1. Create and map complex macros involving multiple hardware or virtual MIDI controllers.\n2. Make custom sequencer or MIDI input generator.\n3. Make music education ot trainer GUI application based on MIDI input.\n\nCurrently MIDI Scripter is at \"beta\" development stage. It's fully functional but needs some more testing. It targets only Windows for now but Linux and macOS support will follow.\n\n## Installation\n1. [Python 3.11+](https://www.python.org/downloads/) with \"Add python.exe to PATH\" option.\n2. [loopMIDI](https://www.tobias-erichsen.de/software/loopmidi.html) for virtual MIDI output ports on Windows.\n3. `pip install midiscripter` in console.\n\n## Setup\nRun loopMIDI and add virtual ports you want to send MIDI messages. You can enable its autostart option.\n\nEnable virtual MIDI output ports as MIDI inputs in DAW. \n\n## Quick Start\n1. Paste [script template](examples/script_template.py) to Python IDE or plain text editor. IDE is greatly recommended.\n2. Run unchanged template script from IDE or by `python .\\script_template.py` to open GUI for more info on available ports and their input.\n3. Turn on the ports' checkboxes to enable them and watch the log for input messages.\n4. Click on port names and messages to copy their declarations to the clipboard. Paste the declarations to your script.\n5. Write the functions you need. Subscribe them to messages with `@input_port.subscribe` decorator. Use `log('messages')` for debugging. Use `output_port.send(msg)` to send modified or created messages from a function.\n6. Restart the script from GUI.\n",
    "bugtrack_url": null,
    "license": "GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007  Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.   This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.  0. Additional Definitions.  As used herein, \"this License\" refers to version 3 of the GNU Lesser General Public License, and the \"GNU GPL\" refers to version 3 of the GNU General Public License.  \"The Library\" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.  An \"Application\" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.  A \"Combined Work\" is a work produced by combining or linking an Application with the Library.  The particular version of the Library with which the Combined Work was made is also called the \"Linked Version\".  The \"Minimal Corresponding Source\" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.  The \"Corresponding Application Code\" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.  1. Exception to Section 3 of the GNU GPL.  You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.  2. Conveying Modified Versions.  If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:  a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or  b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.  3. Object Code Incorporating Material from Library Header Files.  The object code form of an Application may incorporate material from a header file that is part of the Library.  You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:  a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.  b) Accompany the object code with a copy of the GNU GPL and this license document.  4. Combined Works.  You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:  a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.  b) Accompany the Combined Work with a copy of the GNU GPL and this license document.  c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.  d) Do one of the following:  0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.  1) Use a suitable shared library mechanism for linking with the Library.  A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.  e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)  5. Combined Libraries.  You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:  a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.  b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.  6. Revised Versions of the GNU Lesser General Public License.  The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.  Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License \"or any later version\" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.  If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.",
    "summary": "Framework for scripting MIDI, keyboard and Open Sound Control input and output",
    "version": "0.2",
    "project_urls": {
        "Documentation": "https://maboroshy.github.io/midi-scripter",
        "Issues": "https://github.com/Maboroshy/midi-scripter/issues",
        "Source": "https://github.com/Maboroshy/midi-scripter"
    },
    "split_keywords": [
        "midi",
        " osc",
        " automation",
        " input",
        " script"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20b9cf687af8f0e2682f2e4cf1c0ff0f5ff0e81c78d79de777be37d19a7ad24d",
                "md5": "239bd92da77b099c3c2071b96bdfba59",
                "sha256": "1942094a061f36d6b467f755e62521ef4f10b8b8c98db5f641fe4f1b8f1bb9f2"
            },
            "downloads": -1,
            "filename": "midiscripter-0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "239bd92da77b099c3c2071b96bdfba59",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 87015,
            "upload_time": "2024-04-30T11:36:25",
            "upload_time_iso_8601": "2024-04-30T11:36:25.477064Z",
            "url": "https://files.pythonhosted.org/packages/20/b9/cf687af8f0e2682f2e4cf1c0ff0f5ff0e81c78d79de777be37d19a7ad24d/midiscripter-0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d8c377b55da37d4744bc142cece529b7238a20336824549228f4d01bb0d703d",
                "md5": "b5f20b3659f1c1c5c7bc45688da47ec4",
                "sha256": "c0f86a8fdb21a12179e907477ee6bb7c97d85893c6c5dc55c4d3ddb1dd976491"
            },
            "downloads": -1,
            "filename": "midiscripter-0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b5f20b3659f1c1c5c7bc45688da47ec4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 69076,
            "upload_time": "2024-04-30T11:36:26",
            "upload_time_iso_8601": "2024-04-30T11:36:26.886477Z",
            "url": "https://files.pythonhosted.org/packages/9d/8c/377b55da37d4744bc142cece529b7238a20336824549228f4d01bb0d703d/midiscripter-0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-30 11:36:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Maboroshy",
    "github_project": "midi-scripter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "midiscripter"
}
        
Elapsed time: 0.24605s