MIDI tempo change

Started by dario, March 23, 2017, 07:27:56 PM

Previous topic - Next topic

dario

Hello.
I am building an application with your ActiveDJstudio activeX. Everything is fine, but I am not able to make the control detect the tempo changes of the MIDI during playbeck. For example, if the song starts with a speed 140 bpm the control loads the correct speed but when the tempo in the MIDI changes to ... 80 bpm (as written in the MIDI tempo track) ... the control goes on reproducing the song at the starting speed. If I use programmatically the setBPM statement, however, the speed changes correctly.
Do you have any advice?
Many thanks,

Dario Barbieri

Administrator

Hello,

could you be so kind to specify how you detect that the tempo is changed within the track?
Do you get the it through the MidiStreamEventNotification event reporting the MIDI_EVENT_TEMPO parameter?

Kind regards

Severino Delaurenti
MultiMedia Soft

dario

Hello,
many thanks for your advice.
I added the MIDI-TEMPO event notification.
During playback I get the values of the TEMPO, but I don't understand the values and I how to convert those values to bpm.

Private Sub Amp3dj1_MidiStreamEventNotification(ByVal nPlayer As Integer, ByVal nMidiEvent As AMP3DJLib.enumMidiStreamEvents, ByVal nMidiParam1 As Integer, ByVal nMidiParam2 As Integer, ByVal nMidiChannel As Integer, ByVal fPositionInMs As Double, ByVal fPositionInTicks As Double, ByVal fPositionInPercentage As Double)
dim microsec
If nMidiEvent = MIDI_EVENT_TEMPO Then
microsec = nMidiParam1
Me.Print microsec
End If

For example, in a midi song tempo changes the following way: 120,100,60,40 bpm.
The corresponding values I get from the TEMPO event notification are: -24288, 10176, 16960, -7328.

Where is the mistake?

Dario

Administrator

Hello,

could you be so kind to attach a MIDI file having the mentioned tempo changes inside the track?

Kind regards

Severino Delaurenti
MultiMedia Soft

dario

Hello,
here's the simple MIDI sample with those tempo changes.

Administrator

Hello,

thanks for having sent the file.
This appears to be a bug inside our engine which seems to truncate in error the tempo value from 32 to 16 bits. I will make some further investigation and will keep you posted about my findings.

Kind regards

Severino Delaurenti
MultiMedia Soft

Administrator

Hello,

an updated version of Active DJ Studio that fixes the issue is available on our web site. I've sent you the URL to download the full version through e-mail.

Kind Regards

Severino Delaurenti
MultiMedia Soft