Message Boards Message Boards

Exporting MIDI within a Manipulate interface

Posted 10 years ago

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
2 Replies
Posted 10 years ago

David,

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

John

POSTED BY: John Stewart

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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract