Control Windows application volumes, mute, and solo functions using MIDI controllers. Maps MIDI faders, knobs, and buttons to audio sessions with real-time VU meters and profile support.
A skill for working with Mideej, a .NET 9.0 WPF application that transforms MIDI controllers into Windows audio mixers, allowing control of application volumes, mute/solo functions, and audio monitoring via MIDI faders, knobs, and buttons.
Mideej is a fully functional MIDI-based Windows audio mixer targeting .NET 9.0. Users can control Windows application volumes (Spotify, browsers, games, etc.) using physical MIDI controllers with real-time visual feedback.
**Core Features:**
Before making changes, familiarize yourself with the layered architecture:
**MIDI Input Layer** (`Services/MidiService.cs`):
**Mapping Layer** (`ViewModels/MainWindowViewModel.cs`):
**Audio Control Layer** (`Services/AudioSessionManager.cs`):
**UI Layer**:
#### Building and Running
```bash
dotnet build
dotnet run
dotnet build -c Release
dotnet clean
dotnet restore
```
#### Adding New MIDI Mappings
1. Update `MidiService.cs` to handle new MIDI message types
2. Extend `MainWindowViewModel.cs` to process new mapping types
3. Update `ConfigurationService.cs` to persist new mapping data
4. Add UI controls if needed in `ChannelControl.xaml`
#### Creating New UI Controls
1. Add XAML file to `Controls/` folder
2. Follow existing patterns (e.g., `ChannelControl.xaml`)
3. Use SkiaSharp for custom graphics rendering
4. Bind to ViewModel properties using MVVM pattern
#### Extending Audio Processing
1. Modify `AudioSessionManager.cs` for new audio functionality
2. Handle NAudio exceptions (sessions can become stale)
3. Update UI throttling to maintain performance (30ms refresh for VU meters)
4. Test with multiple audio applications running
#### Supported MIDI Message Types
#### Mackie Control Protocol
The application supports Mackie Control-compatible devices:
#### Testing MIDI Functionality
1. Connect a MIDI device to the system
2. Select the device from the dropdown in the application
3. Click the gear icon on a channel to enter learning mode
4. Move a MIDI control (fader, knob, or button)
5. Verify the mapping was created and the control affects the channel
6. Check that LED feedback or motorized faders respond correctly
#### User Configuration Location
`%APPDATA%/Mideej/`
#### Controller Presets
`ControllerPresets/` directory contains pre-configured mappings:
```json
{
"ControllerName": "Your Controller",
"Channels": [
{
"ChannelNumber": 1,
"FaderCC": 0,
"MuteCC": 16,
"SoloCC": 32
}
]
}
```
To add a new preset:
1. Create a JSON file in `ControllerPresets/`
2. Follow the structure shown above
3. Document MIDI CC numbers for your controller
4. Test all mappings with the physical device
**Key Considerations:**
**Handling Session Changes:**
```csharp
// Sessions can become invalid - always check and handle exceptions
try {
audioSession.SimpleAudioVolume.Volume = newVolume;
} catch (COMException) {
// Session no longer exists - refresh session list
RefreshAudioSessions();
}
```
ā **Fully Working:**
š§ **Partially Implemented:**
| File | Purpose |
|------|---------|
| `Services/MidiService.cs` | MIDI device management and message routing |
| `Services/AudioSessionManager.cs` | Windows audio session control |
| `Services/ConfigurationService.cs` | Settings and mapping persistence |
| `ViewModels/MainWindowViewModel.cs` | Main application logic and MIDI mapping |
| `ViewModels/ChannelViewModel.cs` | Individual channel state |
| `Controls/ChannelControl.xaml` | Channel strip UI component |
| `Controls/VuMeter.cs` | Real-time audio level visualization |
| `MainWindow.xaml` | Main application window |
| `Views/SessionAssignmentWindow.xaml` | Audio session assignment dialog |
```csharp
// 1. Add to ChannelViewModel.cs
[ObservableProperty]
private double _panPosition = 0.5;
// 2. Update MainWindowViewModel.cs MIDI handler
private void HandlePanControl(int channel, int value) {
var channelVm = Channels[channel - 1];
channelVm.PanPosition = value / 127.0; // Normalize 0-127 to 0-1
}
// 3. Add to ChannelControl.xaml
<Slider Value="{Binding PanPosition}" Minimum="0" Maximum="1" />
```
```json
{
"ControllerName": "Behringer X-Touch Mini",
"Channels": [
{
"ChannelNumber": 1,
"FaderCC": 0,
"MuteCC": 8,
"SoloCC": 16,
"SelectCC": 24
},
{
"ChannelNumber": 2,
"FaderCC": 1,
"MuteCC": 9,
"SoloCC": 17,
"SelectCC": 25
}
]
}
```
```csharp
// In AudioSessionManager.cs
public void RefreshSessions() {
var sessions = _sessionEnumerator.GetSessions();
foreach (var session in sessions) {
try {
var processId = session.GetProcessID;
var displayName = session.DisplayName;
// Cache session info
_sessionCache[processId] = new SessionInfo {
DisplayName = displayName,
Session = session
};
} catch (Exception ex) {
// Session might have closed during enumeration
Debug.WriteLine($"Session enumeration error: {ex.Message}");
}
}
}
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/windows-midi-audio-mixer-controller/raw