Group Abstract Group Abstract

Message Boards Message Boards

Exporting MIDI within a Manipulate interface

GROUPS:

I have an audio interface element that is produced within a Manipulate command AudioInterface .

How do I allow an export of this as a MIDI (.mid) file within the Manipulate command. This is being done within Mathematica 10 and I just want to produce the file locally (I say this because I understand there are export restrictions on non-enterprise cdfs)

Thanks, John

POSTED BY: John Stewart
Answer
1 year ago

Here is one possible approach:

Manipulate[
 DynamicModule[{sound},
  sound = Sound[{SoundNote["C"], SoundNote[note], SoundNote["C5"]}];
  Column[{sound,
    Button["Save",
     Catch@Module[{file},
       file = SystemDialogInput["FileSave", ".mid"];
       If[file === $Canceled, Throw[$Failed]];
       Export[file, sound, "MIDI"]], Method -> "Queued"]}]
  ],

 {note, {"A", "B", "C", "D", "E", "F", "G"}}]
POSTED BY: David Reiss
Answer
1 year ago

David,

Thank you for the help. I was able to use your approach.

John

POSTED BY: John Stewart
Answer
1 year ago