Electra One MIDI & Lua Crash Course
WORK-IN-PROGRESS
This document serves as a starting point for collaborative work on the Electra One Programming Handbook for complete beginners.
Part 1: Getting Started
Intro – Give it a try
- a one minute example to run a small Lua code and send a MIDI message for complete beginner
1: Newbies, Pick the challange!
- What this book is about
- What you will learn and build
- How to use this book with your Electra One controller
2: What is MIDI, Really?
- MIDI is a language of musical messages
- Messages describe what to play, how to play it
- Common types of MIDI messages: Note On, Control Change, Program Change
- MIDI channels and devices
3: Control Changes
- Control Change (CC): what it is and how Electra One uses it
- Sending notes and changing patches
- Try it now: build a simple preset with knobs sending CC messages
- Watching MIDI using the Electra One MIDI Console
- NRPN and 14-bit CC
4: Electra One presets
- How presets work
- Creating pages and assigning knobs
- Understanding controls
- Understanding value ranges and types
5: Intro to Lua
- What is Lua?
- Why it’s used in Electra One
- How is Lua added to a preset
- Writing your first script: print to console
- Attaching Lua to controls
- Common mistakes and how to fix them
6: How Numbers Work in MIDI
- Why MIDI uses hexadecimal and binary
- How to read and convert hex, dec, and binary
- Nibbles, 7-bit packed format, ASCII
- Tools to convert values
7: Talk to Your Synth (SysEx Basics)
- What is SysEx?
- How Electra One sends and receives SysEx
- Understanding Synth's SysEx Documentation
- Manufacturer-specific SysEx messages
- Real-world example: decoding a simple SysEx message
8: Synth Parameter Changes
- Changing a parameter with SysEx
- Using parameter values, checksums in SysEx
- Building complex SysEx parameter change messages
9: Patch dumps without Lua
- How patch dumps work?
- Sending a request
- Parsing a patch dump response
Part 2: Hands-On MIDI & Lua Projects
10: Make a Smart Knob
- Create knobs with custom behavior
- Wrapping values, scaling, jumps, and filters
- Use value formatters to make better value labels
- Add visual feedback to the controller
11: Customizing Controls with Lua
- Change controls on the fly, their visibility, colours, names
- Controls that react to other controls
- Examples: switches that control ranges, selectors
12: Live MIDI Processing
- Receiving incoming MIDI
- React to messages in Lua
- Example: filtering or remapping messages
13: ParameterMap, the heart of Electra One
- Understanding how Electra One stores the values
- Observing the stored values
- Setting the values
- Reacting to value changes
14: SysEx in Lua
- Working with SysEx in Lua
- Use Lua to send custom messages
- Functions in SysEx messages
- Example: switch patches on a hardware synth
15: Process a Patch dump with Lua
- Lua functions in Patch requests and responses
- Send a patch request in Lua
- Process a patch dump response
- Example: Update controls using a patch dump
Part 3: Digging Deeper – Becoming a MIDI/Lua Power User
16: Timers
- Using Electra timers in Lua
- Scheduled actions and delays
- Example: A simple sequencer project
17: State Saving
- Persist and recall settings using Lua
- Use of JSON files on SD card
- Create a simple data storage system
18: Preset initialization
- Understand steps of initializing a preset
- use onLoad() and onReady()
- Example demonsgtrating what is called and when
19 User functions
- Introduce custom functions
- Building your own functions
- Create: Transport control buttons
20: Custom controls and graphics
- Understand Custom controls
- Underestand how things get painted on the screen
- React to touch events
- Making your own first custom control
21: Debugging & Tips for Success
- Logging and troubleshooting Lua code
- Structuring larger projects
- Advice for testing, sharing, and improving
Bonus Materials
- MIDI message and number format cheat sheets
- Quick Lua syntax reference
- Reusable project templates, patterns, and snippets