Sequoia - Cannot drop MIDI onto Logic

Hi, it’s no longer possible to drop MIDI onto Logic. Dropping onto Live is fine.

Guessing this is going to be OS/Logic issue but just wondered if theres anything the Juce team is aware of?

Update: I can drop the MIDI file that I generate onto Logic and that works, so it looks like it’s the performExternalDragDropOfFiles() call that is not doing its task.

Thx

Just download and tried Scaler 2 to see if it has the same problem and it works fine.

Can you supply some more information please:

  • Which Logic version are you testing?
  • On which platform, Intel/Arm?
  • If Arm, are you running under Rosetta?
  • Are you building AU or AUv3?
  • Which directory are you using to store the intermediate MIDI file?
  • Have you enabled macOS security technologies such as entitlements, sandboxing, or hardened runtime?

I tested the following plugin project as an AU on Logic 11.0.1 Arm, macOS 15.0.1. This is using the AudioPlugin CMake example, so it doesn’t have any extra entitlements/sandboxing. The plugin is able to drop a MIDI snippet into the timeline as expected:

class AudioPluginAudioProcessorEditor final : public juce::AudioProcessorEditor,
                                              public juce::DragAndDropContainer
{
public:
    explicit AudioPluginAudioProcessorEditor (AudioPluginAudioProcessor&);

    void paint (juce::Graphics& g) override
    {
        g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));

        g.setColour (juce::Colours::white);
        g.setFont (15.0f);
        g.drawFittedText (juce::SystemStats::getJUCEVersion(), getLocalBounds(), juce::Justification::centred, 1);
    }

    void mouseDrag (const juce::MouseEvent&) override
    {
        const auto f = juce::File::getSpecialLocation (juce::File::userDesktopDirectory).getChildFile ("drag.midi");

        {
            constexpr auto ticks = 96;

            juce::MidiFile midiFile;
            midiFile.setTicksPerQuarterNote (ticks);

            juce::MidiMessageSequence sequence;
            sequence.addEvent (juce::MidiMessage::noteOn (1, 64, 0.5f).withTimeStamp (0));
            sequence.addEvent (juce::MidiMessage::noteOff (1, 64, 0.5f).withTimeStamp (ticks));

            midiFile.addTrack (sequence);

            juce::FileOutputStream stream { f };
            stream.setPosition (0);
            stream.truncate();

            midiFile.writeTo (stream);
        }

        performExternalDragDropOfFiles ({ f.getFullPathName() }, false, this, {});
    }

private:
    AudioPluginAudioProcessor& processorRef;

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginAudioProcessorEditor)
};

input

thx for the demo code - I’m doing pretty much the same in my app. I copied your code across to my app and the D&D fails. Most strange.

Can you try in a blank plugin? If it works in a blank plugin, that would hint that there’s something specific to your original plugin that breaks DnD in this case. If it doesn’t work in a blank project either, that might indicate that the issue is caused by the DnD implementation itself, rather than an interaction between DnD and other parts of the plugin.

1 Like

yep, will do this shortly.

Hi, yes,your code in a new plugin works fine.

can you think of anything offhand that I can be doing in my app to affect this? FYI, my app works for other DAWs(Live,Bitwig,FL) and also works for Logic running on Sonoma and other OSes.

Thx

It sounds like my example app is using a different directory for the temporary MIDI file. Maybe you could try changing this directory in the example so that it matches your original plugin, and see whether it still works.

Directory makes no difference. If I have the D&D code on the maingui, it works fine, but I have my D&D code on a subcomponent so looks like that’s causing the issue.

Found it. I was calling deleteFile() on the file before creating the new stream. Changed this to use setPosition and truncate on the stream as you do, and it works fine now.

Thanks