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

Thank you for Flapi and request for guidance #17

Open
LL1yt opened this issue Jul 28, 2024 · 4 comments
Open

Thank you for Flapi and request for guidance #17

LL1yt opened this issue Jul 28, 2024 · 4 comments

Comments

@LL1yt
Copy link

LL1yt commented Jul 28, 2024

Dear Flapi developers,

First and foremost, I want to express my sincere gratitude for developing Flapi. This library has the potential to greatly enhance workflow automation in FL Studio, and I'm excited about its possibilities.

I'm working on a project to automate the creation of tracks in FL Studio based on a JSON structure. However, I've encountered some difficulties as I'm not sure about the correct way to use Flapi for this purpose. My current approach seems to be incorrect, as I've noticed that Flapi doesn't have transport, channels, plugins, patterns, or playlist modules that I initially assumed it would have.

from flapi import transport, channels, plugins, patterns, playlist
import json


def create_track_from_json(json_data):
    data = json.loads(json_data)

    
    transport.set_bpm(data["tempo"])

Could you please provide some guidance on how to properly use Flapi to achieve the following tasks:

  1. Setting the project tempo
  2. Creating new channels
  3. Adding instruments (plugins) to channels
  4. Creating patterns and adding notes to them
  5. Adding patterns to the playlist
  6. Setting plugin parameters
  7. Adding and configuring effects

Here's a snippet of the JSON structure I'm working with:

{
    "tempo": 140,
    "channels": [
        {
            "name": "Kick",
            "instrument": "FPC",
            "patterns": [
                {
                    "name": "Main Kick",
                    "notes": [
                        {"time": 0, "note": 36, "duration": 0.25, "velocity": 100},
                        {"time": 1, "note": 36, "duration": 0.25, "velocity": 100}
                    ]
                }
            ],
            "effects": [
                {"name": "Fruity Compressor", "settings": {"threshold": -6, "ratio": 4}}
            ]
        }
    ]
}

Any examples or explanations of the correct Flapi usage for these tasks would be immensely helpful. I'm eager to learn and make the most of this fantastic library.

Thank you again for your hard work on Flapi, and I look forward to your guidance.

PS and yes, LLM helped me in writing this)

@MaddyGuthridge
Copy link
Owner

Hey! Unfortunately, Flapi is currently undergoing a pretty significant rewrite to address some major stability issues on Windows, so for the time being it's not very reliable on anything other than MacOS.

In terms of your feature requests, Flapi is unfortunately limited by FL Studio's Python API capabilities. Here are the things you should be able to do:

  • Set the project tempo
  • Create patterns
  • Set plugin and FX parameters

The things that currently aren't possible are:

  • Creating new channels
  • Adding instruments to channels
  • Adding notes to patterns
  • Adding patterns to the playlist
  • Adding FX plugins to a mixer track

All of these features have been requested to Image-Line, so hopefully they will become possible in the future. For the time being, here is the documentation for FL Studio's Python API, which is what you would want to look at for how to do all of the above features.

@MaddyGuthridge
Copy link
Owner

MaddyGuthridge commented Jul 28, 2024

As for the error that you're getting, my guess is this is to do with LLM hallucinations -- FL Studio's MIDI Controller Scripting API is comparatively new, so many LLMs don't know much about how to use it, and so hallucinate things even more than usual.

If the modules are failing to import, that could be due to a recent issue with the FL Studio API Stubs library where the modules weren't being distributed correctly. Perhaps try upgrading that dependency (pip install --upgrade fl-studio-api-stubs) and see if it helps :)

@francisgabrieljoseph
Copy link

I never did manage to get this to run on OSX, or scripting in general. I just assumed support was only catered to Windows.

@LL1yt
Copy link
Author

LL1yt commented Jul 29, 2024

Thank you very much for clarifying these points. If the API were more widely implemented, then my experience of creating music would have changed dramatically with the support of LLM. But apparently we’ll have to wait for major players and capital to get down to business

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

3 participants