{"id":23727791,"url":"https://github.com/tomsimonart/fl-modular-grid","last_synced_at":"2025-07-27T16:43:38.037Z","repository":{"id":270354389,"uuid":"909409543","full_name":"tomsimonart/fl-modular-grid","owner":"tomsimonart","description":"Fl studio midi script for setup mapping and LED feedback intech midi device.","archived":false,"fork":false,"pushed_at":"2025-04-25T10:03:56.000Z","size":189,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T01:38:19.835Z","etag":null,"topics":["fl-studio","intech","midi","modular-grid","script"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomsimonart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-28T16:09:06.000Z","updated_at":"2025-04-25T10:03:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"b442ddda-12df-483c-b739-93bcfa7b494b","html_url":"https://github.com/tomsimonart/fl-modular-grid","commit_stats":null,"previous_names":["tomsimonart/fl-modular-grid"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomsimonart/fl-modular-grid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomsimonart%2Ffl-modular-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomsimonart%2Ffl-modular-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomsimonart%2Ffl-modular-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomsimonart%2Ffl-modular-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomsimonart","download_url":"https://codeload.github.com/tomsimonart/fl-modular-grid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomsimonart%2Ffl-modular-grid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265233753,"owners_count":23731825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fl-studio","intech","midi","modular-grid","script"],"created_at":"2024-12-31T01:45:29.312Z","updated_at":"2025-07-27T16:43:38.030Z","avatar_url":"https://github.com/tomsimonart.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FL Modular Grid\n\nThis is a small project made to enable infinite relative encoders on FL Studio using Intech Modular Grid devices (no more value pickup or teleportation).\nIt also synchronises LED's with the colors defined in the mapping configuration, for both LED layers (buttons and encoders).\nIt also sets intensity depending on the value of a control in fl studio.\nAnd last, it prints the status of the CH, CC, plugin knob name and human readable value in the fl banner window.\n\n# License\n\nRead the license [here](`LICENSE.md`).\n\n# FL Studio setup\n\nAdd the `device_Intech.py` as well as the `mapping.py` scripts in the fl studio midi scripting hardware controllers directory.\n\nImportant ! **Setup your intech devices with port 13** both for midi rx and tx in the fl studio midi configuration tab.\n\n# Grid setup\n\nRead this to configure your Intech grid correctly for the FL Studio midi script to work.\n\nUse EN16 for positions [0, 0], [0, 1], [-1, 0]. In my configuration I have a TEK2 @ [-1, 1]\n```\nEN16 EN16\nEN16 TEK2\n```\n\n### System - Setup\n\nOn the EN16 System `Setup` page, in the setup, declare the following variables in a `self` block\n\n```\nci = module_position_x()*16+(256-module_position_y())*48 % 128\ncx = (module_position_x()*16+(256-module_position_y())*48 % 128)+15\nlcc = -1\n```\n\n### System - Midi rx\n\nOn the `Midi rx` page, change the name of the variables (to shorten the script)\n\n```lua\nchan = midi.ch\ncmd = midi.cmd\np1 = midi.p1\np2 = midi.p2\n```\n\nThen, under the `locals` block in the `Midi rx`, declare a new code block and insert the contents of the [script](grid_script.lua).\n\n### Encoder\n\n![encoder - system setup screen capture](encoder_system.png)\n\n![encoder - button setup screen capture](encoder_button.png)\n\n![encoder - encoder setup screen capture](encoder_encoder.png)\n\n# Mapping\n\nIn the `mapping.py` file, there is a mapping for plugins.\n\nBasically every plugin can be added to this mapping.\n\nHere is a mapping example:\n\n```python\nmapping = {\n    \"plugins\": {\n        \"\u003cplugin-name\u003e\": {  # Mapping auto-syncs when a plugin with this name is focused in the FL Studio DAW\n            # Sets CC 40 as an encoder with a blue led\n            40: Control(encoder_led=LedColor.blue()),\n            # Set CC 41 as a button with a dimmer green light\n            41: Control(button_led=LedColor(r=0, g=0.7, b=0)),\n            # CC 42 is used as both a button and encoder, both leds are sync depending on what's pressed\n            42: Control(encoder_led=LedColor.white(), button_led=LedColor.red()),\n            # CC 43 is the same as 42 but when the button is off, the red led is not dim, it's just off\n            # Beautify basically \"keeps the led on\" even if it's \"off\", it's just dim\n            43: Control(encoder_led=LedColor.white(), button_led=LedColor.red(), beautify_button=False),\n            # CC 43 is a 3-step button, you can press it 3 times and obtain stepped midi controls\n            44: Control(button_led=LedColor.yellow(), button=CtrlButton(steps=3)),\n            # CC 45 is a 5-step encoder, you can turn it and it will send a higher relative value, useful for stepped potentiometers for example\n            45: Control(encoder_led=LedColor.blue(), encoder=CtrlEncoder(steps=5)),\n            # CC 46 is a normal encoder but the led will turn off if the value is 0\n            46: Control(encoder_led=LedColor.pink(), beautify_encoder=False),\n\n            # You can use any combo of the above values\n    }\n}\n```\n\n# Doc\n\nIf you are interested in how this script works, here are some additional informations.\n\n## Midi mapping\n\nMidi channel is always 1 for buttons, always 2 for encoders.\nCC is defined depending on module position.\n[0, 0] has a range of [32 -\u003e 47]\n[0, 1] has a range of [48 -\u003e 63]\n[-1, 0] has a range of [80 -\u003e 95]\n\n## Mini Protocol\n\nIn order to synchronize the led colors with the focused plugin, it was necessary to design a minimalistic protocol that would allow data exchange for all the knobs.\n\nMany experiments resulted in this extremely packed protocol with only these message types:\n\n1. Led intensity layer 1: midi `type=0xB0 | channel=6 | param1=7-bit cc | param2=7-bit intensity`\n2. Led intensity layer 2: midi `type=0xB0 | channel=8 | param1=7-bit cc | param2=7-bit intensity`\n3. Led color layer 1: midi `type=0xB0 | channel=7 | param1=7-bit color msb* | param2=7-bit color lsb*`\n4. Led color layer 2: midi `type=0xB0 | channel=9 | param1=7-bit color msb* | param2=7-bit color lsb*`\n5. Reset module intensity: midi `type=0xB0 | channel=2 | param1=not used | param2=not used`\n\n*led color: for the led color, sending 3 midi messages per led layer was too expensive, to reduce it to 1, some decisions were made:\n- Red: 5 bit value\n- Green: 5 bit value\n- Blue: 4 bit value (the human eye is less sensible to blue light than red and green, so blue resolution was sacrificed due to size restrictions)\n\nThose colors are packed in a single midi message, the cc used is the last cc received for intensity. Because it's relevant to set intensity along with color nearly every time.\n\nThis way we can send 1, at most 2 midi messages to set brightness and color of a led layer and avoid midi rx overflows on the hardware controller.\nColor needs to be synced only once per plugin focus which is convenient.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomsimonart%2Ffl-modular-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomsimonart%2Ffl-modular-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomsimonart%2Ffl-modular-grid/lists"}