# Virtual MIDI Device

**URL:** <https://forum.juce.com/t/virtual-midi-device/65600>\
**Category:** General JUCE discussion\
**Created:** [March 22, 2025, 6:35pm UTC](https://forum.juce.com/t/virtual-midi-device/65600 "2025-03-22T18:35:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [March 22, 2025, 6:35pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/1 "2025-03-22T18:35:24Z")

</div>

Hey!

I know theres a million threads about virtual MIDI devices, but they all seem to be from quite a long time ago so i’m not sure if something has changed.

Im creating a virtual MIDI device (which is successful) on macOS however I don’t see the device appearing anywhere either in Ableton or in MIDI Studio. I want to output MIDI from my application.

This is how i’m creating it:

```auto
bool MidiOutputManager::createVirtualDevice(const juce::String& deviceName)
{
    midiOutput.reset();
    
    juce::Logger::writeToLog("Attempting to create virtual MIDI device: " + deviceName);
    
    midiOutput = juce::MidiOutput::createNewDevice(deviceName);
    
    if (midiOutput != nullptr)
    {
        isVirtualDevice = true;
        currentDeviceInfo = midiOutput->getDeviceInfo();
        midiOutput->startBackgroundThread();
        juce::Logger::writeToLog("Virtual MIDI device created with identifier: " + currentDeviceInfo.identifier);
        
        // Log device info
        juce::Logger::writeToLog("Device name: " + currentDeviceInfo.name);
        juce::Logger::writeToLog("Device identifier: " + currentDeviceInfo.identifier);
        
        return true;
    }
    
    juce::Logger::writeToLog("Failed to create virtual MIDI device");
    juce::Logger::writeToLog("On macOS, this usually happens because of permissions or a sandboxed app.");
    juce::Logger::writeToLog("Make sure your app is not sandboxed and has proper entitlements.");
    
    return false;
}

```

Any idea what i’ve missed?

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [March 22, 2025, 9:26pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/2 "2025-03-22T21:26:07Z")

</div>

On macOS in Audio MIDI Setup create an IAC Driver in MIDI Studio. It should show up in every app on your Mac.

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [March 22, 2025, 10:01pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/3 "2025-03-22T22:01:56Z")

</div>

I am using that for testing, but it would be much more convenient for users of my app if they didn’t have to do that. It’s not exactly the most plug and play solution to have to use the IAC Driver.

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [March 22, 2025, 10:13pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/4 "2025-03-22T22:13:14Z")

</div>

Claude.ai can create an example for you to create your own Virtual MIDI Device using JUCE

---

<div class="post-metadata">

**Author:** ![kerfuffle](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kerfuffle/32/11805_2.png) [@kerfuffle](https://forum.juce.com/u/kerfuffle)\
**Post date:** [March 22, 2025, 10:23pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/5 "2025-03-22T22:23:08Z")

</div>

I’m using pretty much the same code and it works fine here. The MIDI device shows up fine in other DAWs as a possible input.

You may need to show more code. What is the lifetime of this MidiOutputManager object?

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [March 23, 2025, 6:25am UTC](https://forum.juce.com/t/virtual-midi-device/65600/6 "2025-03-23T06:25:07Z")

</div>

Hmm interesting. It’s created when the application starts and the main window is constructed, and then destroyed when the application closes.

---

<div class="post-metadata">

**Author:** ![Rincewind](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rincewind/32/10645_2.png) [@Rincewind](https://forum.juce.com/u/Rincewind)\
**Post date:** [March 23, 2025, 12:18pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/7 "2025-03-23T12:18:51Z")

</div>

Yes, that is the expected behaviour

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [March 23, 2025, 12:47pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/8 "2025-03-23T12:47:45Z")

</div>

So I was creating multiple instances of my MidiOutputManager which I think was causing the issues.

---

<div class="post-metadata">

**Author:** ![Qfactor](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/qfactor/32/14921_2.png) [@Qfactor](https://forum.juce.com/u/Qfactor)\
**Post date:** [March 24, 2025, 11:31am UTC](https://forum.juce.com/t/virtual-midi-device/65600/9 "2025-03-24T11:31:38Z")

</div>

You can consider using [BMIDI Virtual MIDI SDK – Bome Software](https://www.bome.com/products/bmidi) (and it will work on Windows too).

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [March 25, 2025, 9:25am UTC](https://forum.juce.com/t/virtual-midi-device/65600/10 "2025-03-25T09:25:30Z")

</div>

Hmm for some reason it works on my computer, but not on other peoples when i share the binary.

---

<div class="post-metadata">

**Author:** ![kerfuffle](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kerfuffle/32/11805_2.png) [@kerfuffle](https://forum.juce.com/u/kerfuffle)\
**Post date:** [March 25, 2025, 11:34am UTC](https://forum.juce.com/t/virtual-midi-device/65600/11 "2025-03-25T11:34:41Z")

</div>

What is the error message they are getting? Did you sign and notarize the binary?

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [March 31, 2025, 4:59pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/12 "2025-03-31T16:59:34Z")

</div>

I don’t get any messages, I my binary is signed and notarized with the following entitlements:

```auto
➜ /Applications spctl -a -vvv Test\ MIDI.app 
Gamepad MIDI.app: accepted
source=Notarized Developer ID
origin=Developer ID Application: Adam Ham (8D4T9CC22L)
➜ /Applications codesign -d --entitlements - Test\ MIDI.app
Executable=/Applications/Test MIDI.app/Contents/MacOS/Test MIDI
[Dict]
	[Key] com.apple.security.app-sandbox
	[Value]
		[Bool] false
	[Key] com.apple.security.device.midi
	[Value]
		[Bool] true
	[Key] com.apple.security.device.virtual-midi
	[Value]
		[Bool] true
	[Key] com.apple.security.temporary-exception.mach-lookup.global-name
	[Value]
		[Array]
			[String] com.apple.midi.server
➜ /Applications 

```

---

<div class="post-metadata">

**Author:** ![kerfuffle](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kerfuffle/32/11805_2.png) [@kerfuffle](https://forum.juce.com/u/kerfuffle)\
**Post date:** [March 31, 2025, 7:03pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/13 "2025-03-31T19:03:27Z")

</div>

Just want to point out that you’re printing info on two different apps here.

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [March 31, 2025, 8:07pm UTC](https://forum.juce.com/t/virtual-midi-device/65600/14 "2025-03-31T20:07:34Z")

</div>

Ah you can assume that they are from the same app. I copy and pasted it incorrectly.
