flapi


Nameflapi JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/MiguelGuthridge/Flapi
SummaryRemotely control FL Studio using the MIDI Controller Scripting API
upload_time2024-04-13 09:59:22
maintainerNone
docs_urlNone
authorMiguel Guthridge
requires_python<4.0,>=3.9
licenseMIT
keywords fl studio fl studio midi script midi controller scripting remote remote control
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Flapi

Flapi (pron. *"flappy"*) is a remote control server for FL Studio, using the
MIDI Controller Scripting API. It allows you to execute Python code in FL
Studio from outside of FL Studio by modifying functions in the
[FL Studio API Stubs package](https://github.com/MiguelGuthridge/FL-Studio-API-Stubs)
to forward their calling information to the Flapi server, where they are
executed, with their values returned to the client.

```py
$ flapi
>>> import ui
>>> ui.setHintMsg("Hello from Flapi!")
# Hint message "Hello from Flapi!" is displayed in FL Studio
```

## Setup

1. Install the Flapi library using Pip, or any package manager of your choice.
   `pip install flapi`

2. Install the Flapi server to FL Studio by running `flapi install`. If you
   have changed your FL Studio user data folder, you will need to enter it.

3. On Windows, install a virtual MIDI loopback tool such as
   [loopMIDI](https://www.tobias-erichsen.de/software/loopmidi.html) and use it
   to create two virtual MIDI ports, named `Flapi Request` and
   `Flapi Response`. On MacOS, Flapi is able to create these MIDI ports
   automatically, so this step is not required.

4. Start or restart FL Studio. The server should be loaded automatically, but
   if not, you may need to set it up in FL Studio's MIDI settings. To do this,
   set each MIDI port to have a unique port number in the outputs section,
   configure the input ports to match the port numbers of their corresponding
   output ports, then assign the "Flapi Request" port to the "Flapi Request"
   script and the "Flapi Response" port to the "Flapi Response" script.

## Usage

### As a library

```py
import flapi

# Enable flapi
flapi.enable()

# Now all calls to functions in FL Studio's MIDI Controller Scripting API will
# be forwarded to FL Studio to be executed.
```

### As a REPL

```py
$ flapi
>>> import transport
>>> transport.start()
# FL Studio starts playback
>>> transport.stop()
# FL Studio stops playback
```

#### Server-side execution

Flapi also supports a bare-bones server-side REPL, where all input is executed
within FL Studio (as opposed to forwarding function data).

```py
$ flapi -s server
>>> import sys
>>> sys.version
'3.12.1 (tags/v3.12.1:2305ca5, Dec  7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]'
# It's running inside FL Studio!
>>> print("Hello")
Hello
# Stdout is redirected back to the client too!
```

## Credits

This concept was originally created by
[dimentorium](https://github.com/dimentorium) and is available on GitHub at
[dimentorium/Flappy](https://github.com/dimentorium/Flappy). I have adapted
their code to improve its usability, and make it easier to install.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MiguelGuthridge/Flapi",
    "name": "flapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "fl, studio, fl studio, midi, script, midi controller scripting, remote, remote control",
    "author": "Miguel Guthridge",
    "author_email": "hello@miguelguthridge.com",
    "download_url": "https://files.pythonhosted.org/packages/ae/f1/e165bb4b05ab52816e5797e81a6b8e77dd3ace119d6bc8c9501179127ba9/flapi-1.0.1.tar.gz",
    "platform": null,
    "description": "# Flapi\n\nFlapi (pron. *\"flappy\"*) is a remote control server for FL Studio, using the\nMIDI Controller Scripting API. It allows you to execute Python code in FL\nStudio from outside of FL Studio by modifying functions in the\n[FL Studio API Stubs package](https://github.com/MiguelGuthridge/FL-Studio-API-Stubs)\nto forward their calling information to the Flapi server, where they are\nexecuted, with their values returned to the client.\n\n```py\n$ flapi\n>>> import ui\n>>> ui.setHintMsg(\"Hello from Flapi!\")\n# Hint message \"Hello from Flapi!\" is displayed in FL Studio\n```\n\n## Setup\n\n1. Install the Flapi library using Pip, or any package manager of your choice.\n   `pip install flapi`\n\n2. Install the Flapi server to FL Studio by running `flapi install`. If you\n   have changed your FL Studio user data folder, you will need to enter it.\n\n3. On Windows, install a virtual MIDI loopback tool such as\n   [loopMIDI](https://www.tobias-erichsen.de/software/loopmidi.html) and use it\n   to create two virtual MIDI ports, named `Flapi Request` and\n   `Flapi Response`. On MacOS, Flapi is able to create these MIDI ports\n   automatically, so this step is not required.\n\n4. Start or restart FL Studio. The server should be loaded automatically, but\n   if not, you may need to set it up in FL Studio's MIDI settings. To do this,\n   set each MIDI port to have a unique port number in the outputs section,\n   configure the input ports to match the port numbers of their corresponding\n   output ports, then assign the \"Flapi Request\" port to the \"Flapi Request\"\n   script and the \"Flapi Response\" port to the \"Flapi Response\" script.\n\n## Usage\n\n### As a library\n\n```py\nimport flapi\n\n# Enable flapi\nflapi.enable()\n\n# Now all calls to functions in FL Studio's MIDI Controller Scripting API will\n# be forwarded to FL Studio to be executed.\n```\n\n### As a REPL\n\n```py\n$ flapi\n>>> import transport\n>>> transport.start()\n# FL Studio starts playback\n>>> transport.stop()\n# FL Studio stops playback\n```\n\n#### Server-side execution\n\nFlapi also supports a bare-bones server-side REPL, where all input is executed\nwithin FL Studio (as opposed to forwarding function data).\n\n```py\n$ flapi -s server\n>>> import sys\n>>> sys.version\n'3.12.1 (tags/v3.12.1:2305ca5, Dec  7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]'\n# It's running inside FL Studio!\n>>> print(\"Hello\")\nHello\n# Stdout is redirected back to the client too!\n```\n\n## Credits\n\nThis concept was originally created by\n[dimentorium](https://github.com/dimentorium) and is available on GitHub at\n[dimentorium/Flappy](https://github.com/dimentorium/Flappy). I have adapted\ntheir code to improve its usability, and make it easier to install.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Remotely control FL Studio using the MIDI Controller Scripting API",
    "version": "1.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/MiguelGuthridge/Flapi/issues",
        "Homepage": "https://github.com/MiguelGuthridge/Flapi",
        "Online Documentation": "https://miguelguthridge.github.io/Flapi",
        "Repository": "https://github.com/MiguelGuthridge/Flapi"
    },
    "split_keywords": [
        "fl",
        " studio",
        " fl studio",
        " midi",
        " script",
        " midi controller scripting",
        " remote",
        " remote control"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9ee562eb1a4339e630df7a0aee617b836d192b51cbcf09c454d0669dc23c9be5",
                "md5": "c48c8ab902c03cdaad65697a60c6945b",
                "sha256": "b998b03b2179301dfbdf13025757dd358748438728b9b6b09882259e1f83dbdb"
            },
            "downloads": -1,
            "filename": "flapi-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c48c8ab902c03cdaad65697a60c6945b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 27106,
            "upload_time": "2024-04-13T09:59:21",
            "upload_time_iso_8601": "2024-04-13T09:59:21.194159Z",
            "url": "https://files.pythonhosted.org/packages/9e/e5/62eb1a4339e630df7a0aee617b836d192b51cbcf09c454d0669dc23c9be5/flapi-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aef1e165bb4b05ab52816e5797e81a6b8e77dd3ace119d6bc8c9501179127ba9",
                "md5": "f6212d344055daeaa410819051172803",
                "sha256": "dd2e081a5b7cd3615e4335bc769f7ac85cf3b7bf3f6159971416725e6fdbc0ee"
            },
            "downloads": -1,
            "filename": "flapi-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f6212d344055daeaa410819051172803",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 20984,
            "upload_time": "2024-04-13T09:59:22",
            "upload_time_iso_8601": "2024-04-13T09:59:22.390714Z",
            "url": "https://files.pythonhosted.org/packages/ae/f1/e165bb4b05ab52816e5797e81a6b8e77dd3ace119d6bc8c9501179127ba9/flapi-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-13 09:59:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MiguelGuthridge",
    "github_project": "Flapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "flapi"
}
        
Elapsed time: 0.21585s