<p>I am making a simple game in order to learn a new language.  I am in the process of collecting some music for the game and would like to use the MIDI format so that I can control the flow of the track (i.e., I would like to have an introduction that only plays once and does not play again when the song loops.)</p>

<p>I am having a tough time finding information on how to modify existing MIDI files so that they may send a control change signal to the synthesizer.  Has anyone had experience with this?</p>

<hr>

<p>I think that I should have been more clear with my original question. I am using an existing game engine which takes care of playing the music. I am under the impression that this control change value must be embedded directly in the MIDI file itself as I have no control over the synthesizer. From the manual:</p>

<blockquote>
  <p>MIDI files are played via the
  DirectMusic Synthesizer. If a BGM MIDI
  file contains the control change value
  111, that value is recognized as where
  the song will start repeating after it
  reaches the end.</p>
</blockquote>

<p>I wish I could do it programmatically. I suppose what I am after here is some sort of editor which will allow me to modify the MIDI file that I already have. </p>

[{'answer_id': 34038, 'author': 'Jiaaro', 'author_id': 2908, 'author_profile': 'https://Stackoverflow.com/users/2908', 'pm_score': 2, 'selected': False, 'text': '<p>try looking in the <a href="http://www.midi.org/about-midi/specinfo.shtml" rel="nofollow noreferrer">Midi 1.0 spec</a></p>\n\n<p>Here\'s a table of the <a href="http://www.midi.org/about-midi/table3.shtml" rel="nofollow noreferrer">control change messages</a> though it looks like you\'re looking for a way to do this in software. yes?</p>\n\n<p>you could try just sending it as raw midi data (ie. the messages on that table)</p>\n\n<p>looking over your question again... my answer is not that useful...</p>\n\n<p>what I would do if I were you is separate the introduction into it\'s own file and then you have a file containing <strong>just</strong> what you want to loop.</p>\n\n<p>you could also look at the spec for the <A href="http://www.midi.org/about-midi/smf/index.shtml" rel="nofollow noreferrer">Standard Midi File format (SMF)</a></p>\n'}, {'answer_id': 34051, 'author': 'Jiaaro', 'author_id': 2908, 'author_profile': 'https://Stackoverflow.com/users/2908', 'pm_score': 2, 'selected': False, 'text': '<p>Sounds like what you really want is a <A href="http://www.google.com/search?hl=en&amp;safe=off&amp;client=firefox-a&amp;rls=com.ubuntu:en-US:unofficial&amp;hs=ssc&amp;pwst=1&amp;sa=X&amp;oi=spell&amp;resnum=0&amp;ct=result&amp;cd=1&amp;q=midi+editor&amp;spell=1" rel="nofollow noreferrer">midi editor</a></p>\n'}, {'answer_id': 34052, 'author': 'Zooba', 'author_id': 891, 'author_profile': 'https://Stackoverflow.com/users/891', 'pm_score': 3, 'selected': True, 'text': '<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=6E938A6E-B383-466B-A3EE-5A655BF5DB8C&amp;displaylang=en" rel="nofollow noreferrer">DirectMusicProducer</a> is probably your best free option if you are playing using DirectMusic. I don\'t believe the MIDI record feature will include control changes, but your engine may support playing segment files which are much more flexible.</p>\n\n<p>The only MIDI sequencer I use cost around $300 (USD) about 10 years ago (and no longer appears to exist), but I am not aware of any good quality free MIDI file sequencers. (Note that "MIDI editor" is probably different to "MIDI file editor" or "MIDI sequencer")</p>\n'}]
['https://Stackoverflow.com/questions/34023', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1053/']