Purple Hearts hpmusic

HP MIDIFILE

A DLL (Dynamic Link Library) to program MIDI Files of types SMF0 or SMF1. The DLL can be called from C++ applications and offers interfaces for Visual Basic, VB Net and C#.

For Software Engineers only.

The freeware MIDI File DLL "HP MIDIFILE" includes functions to load MIDI Files or create new ones, to read, insert, delete, change all MIDI Events of GM1/GM2 and of YAMAHA XG/XF. With functions Select, Copy and Paste sets of events can be inserted at other time-points into the same or another MIDI File. There are functions to find and select MIDI Devices and to play the loaded song.

HP MIDIFILE is intended to simplify the creation and editing of MIDI Files. Most of the functions work with the logic of events, not with internal data.

HP MIDIFILE also offers functions to read items of Cakewalk/Sonar Instrument Definition Files.

The user of this library must be familiar with the structure of MIDI and MIDI Files. Applying YAMAHA SysEx and Meta Events he should look at XG and XF specifications. A lot of good documents can be found in the internet.

HP MIDIFILE is mainly implemented for the programming language Visual C++ for Windows of all versions: Win98, Win2000, XP, Vista, Windows 7.

Based on HP MIDIFILE I have programmed the freeware application PSRUTI.

HP MIDIFILE ? 2015 Heiko Plate

HP MIDIFILE is published by GitHub as Open Source software with the MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Links:

The actual software HP MIDIFILE, the manual hpmidifile.chm and the actual source code

The source code includes the three sample C++ projects "create_song", "midifile_player" and "ppqn_master".
In these projects exchange the library files with the actual ones.

The repository hpmidifile

History

Version v1.38
Monday, 13 February 2017
Manual only: New VB.Net interface added
HP MIDIFILE Open Source
Monday, 22 June 2015
HP MIDIFILE now is published by GitHub as Open Source software with the MIT License (MIT)
Version 1.37
Thursday, 18 June 2015
  • Instrument Definition Files: Bugs with Drum[...] statements repaired.
  • Chord type "1+2+5" replaced by "sus2".
Version 1.36
Tuesday, 14 May 2013
  • New function: HP_CWinsIsDrumVoice that analyzes the DRUM[...] lines of Cakewalk instrument definitions.
  • Controller Events CC2 (Breath controller (coarse)), CC4 (Foot Pedal (coarse)), CC8 (Balance (coarse), CC92 (Tremulo Level), CC95 (Phaser Level) now get type HP_CONTROLLER_TYPE = 0x400.
Version 1.35
Friday, 04 May 2012
  • Play Functions, new: HP_PlaySingleEvent added.
    The function allows to send while playing an arbitrary MIDI event, for example a MasterVolume SysEx.
Version 1.34
Monday, 31 October 2011
  • Yamaha Meta Events: Score Layout and QuickStart added
  • Yamaha Meta Event Score Start Bar repaired
Version 1.33
Friday, 26 March 2010
  • PitchWheel functions: Incorrect computed values
  • HP_QuantisizeSelected does no longer delete note events.
    New resolutions: 1/1 Triole, 1/16 Triole
  • No longer crash with syntactic incorrect key signatures and chord events
  • Tempo functions now allow BPM with type int or double
  • Manual: Type of parameter percent bool instead of int
Version 1.32
Saturday, 14 February 2009
  • Instrument Definition: To minor bugs repaired.
  • Bug with HP_Copy, HP_Paste repaired
  • Bug in the description of HP_ChangeVelocity repaired.
Version 1.31
Friday, 02 March 2007
  • New function HP_MoreChunks to detect other chunks behind the SMF data. Such chunks are skipped by the DLL.
  • HP_ChangeController now allows to change the controller number (controller type).
  • Bug repaired: Problem with lyric syllables which start with a character >= 128.
  • Bug repaired with HP_ChangeNote: It was not possible to change the channel.
Version 1.30
Wednesday, 26 July 2006
  • Detection of notes with bad velocities.
  • HP_ChangeKeySignature: Bug with change to signature Gm repaired
Version 1.29
Friday, 13 January 2006
  • Better detection of unusual programmed RPN and NRPN.
  • Before finishing the play of midifiles, controller-events "Note Off" are sent.
  • Bug in the description of HP_InsertNote repaired.
Version 1.28
Thursday, 03 November 2005
  • Funktion Load: A bad bug with RPN/NRPN repaired.
Version 1.27
Friday, 19 August 2005
  • A bug with HP_SettleOverlappingNotes repaired.
Version 1.26
Wednesday, 15 June 2005
  • A bug with the analysis of RPN/NRPN with non-sorted controller-parts repaired.
  • Bug repaired with HP_Paste of RPN/NRPN-events.
Version 1.25
Wednesday, 15 June 2005
  • Key-Signature of "Ebm" now with six sharps instead of six flats.
  • The new function HP_CWInsGetBankVoiceList allows to browse voices of Instrument Definition Files.
Version 1.24
Wednesday, 15 June 2005
  • The new function HP_PlayMute allows to mute channels while playing.
  • HP_GetTimeFromTaktBeatTick did not work with denum > 4. Bug in the documentation with this function repaired.
Version 1.23
Wednesday, 15 June 2005
  • Memory exception in HP_Play repaired.
  • Documentation: Methods of calling functions from VB.Net and C# programs added.
Version 1.22
Wednesday, 15 June 2005
  • The new function HP_SetPlayTime allows to continue the play of a MIDI-file at an arbitrary time-position.
  • HP_Play: Bug repaired concerning modus HP_SELECTED.
  • Documentation: The method of calling functions from Visual Basic programs.
Version 1.20
Wednesday, 15 June 2005
Bug repaired: MIDI-files with many short time-delays run too fast.
Version 1.19
Wednesday, 15 June 2005
  • HP_Copy/HP_Paste: Bad tempo, error with channel-prefix-events and chord-events.
  • HP_InsertController: Bad type generated when using the controller-number.
Version 1.18
Wednesday, 15 June 2005
  • Bug repaired with HP_Select and HP_Deselect of RPN/NRPN-events.
  • Instrument Definition Files: All functions optimized.
  • Instrument Definition Files: New functions to get lists of controller-, note-, RPN- and NRPN-names.
Version 1.16
Wednesday, 15 June 2005
  • Bug repaired with HP_SettleOverlappingNotes if same notes follow strictly one after another.
  • Division by zero in HP_GetTimeFromTaktBeatTick and HP_GetTaktBeatTick repaired.
  • Instrument Definition Files: New functions HP_CWInsGetBanks and HP_CWInsGetBankVoices.
Version 1.15
Wednesday, 15 June 2005
  • HP_Playtime did not work.
  • Manual: HP_ReadRPN/NRPN sequence of arguments time and chan.
  • Implicite deleting of incomplete RPN/NRPN repaired.
  • New organisation of timer: Less latency time while playing.
Version 1.13
Wednesday, 15 June 2005
  • New function HP_PlayTranspose to transpose while playing.
  • HP_PlayTempo: Lower limit 10%.
Version 1.12
Wednesday, 15 June 2005
  • Bug with HP_ReadChord repaired (HP_Delete with buffer for parameter chord).
  • Chord-name "cc" without base-note.
  • HP_InsertRPN/NRPN: Data-LSB created even if value zero.
Version 1.11
Wednesday, 15 June 2005
  • Problem with Play-Message "ErrorUnprepareHeader" solved.
  • Bug repaired with reading events, which have been inserted in the same session.
  • Bug repaired with HP_GuideTrackFlag-events.
  • Unknown controller events are processed now.
  • Play-tempo problems with just edited MIDI-files repaired.
  • Bug with insert of YAMAHA meta-events repaired.
  • Bug with HP_KeyboardVoice events repaired.
  • a lot of bugs in the documentation repaired.
Version 1.10
Wednesday, 15 June 2005
Bug repaired: HP_IsPlaying did not work in version 1.9.
Version 1.9
Wednesday, 15 June 2005
  • To get a better timing the play-function uses another timer based on DirectX IReferenceClock.
  • New function HP_PlayTempo to change the play-tempo.
Version 1.8
Wednesday, 15 June 2005
HP_GetTaktBeatTick: Bug with computation of tick repaired.
Version 1.7
Wednesday, 15 June 2005
  • Added: Play-monitor function HP_PlayCHMonitor sends chords from XG chord-sysex.
  • New function HP_ConvertChordToText
Version 1.6
Wednesday, 15 June 2005
  • New function HP_GetLastTime
  • New function HP_GetPlayEventTime
  • New: Interface to listen at measures/beats, lyrics and chords while playing a MIDI-file.
  • COFF library format added.
Version 1.5
Wednesday, 15 June 2005
  • New: Analysis of Cakewalk/Sonar Instrument Definition Files.
  • Note-Off events with no associated Note-On are deleted
Version 1.4
Wednesday, 15 June 2005
Read, write and change key-signatures with minor keys repaired: A bug with chord-strings.
Version 1.3
Wednesday, 15 June 2005
  • New function HP_Delete, which is recommended to allocate memory instead of "delete[]", which was allocated by the dll. "delete[]" crashes in VC++ Debug-Mode.
  • Additional function HP_GetTaktBeatTick implemented to get measure/beat/tick more efficient while scanning the event list.
  • Chord Cancel cc added.
Version 1.2
Wednesday, 15 June 2005
Crash with sources containing incomplete RPN/NRPN repaired.
Version 1.1
Wednesday, 15 June 2005
  • HP_Deselect: Did select, but not deselect.
  • "Windows Multimedia Timer" achieves better timing with HP_Play.
  • With wait or stop controller events "Sound Off" are send now.
  • New: Duration of selected parts.
Version 1.0
Wednesday, 15 June 2005
Initial version