streaming MIDI

Started by dario, August 08, 2016, 11:52:33 AM

Previous topic - Next topic

dario

Hello, I wonder if it is possible, playing streaming MIDI song, to change the volume and/or the panning of individual channel/tracks.
I use VB6.
Many thanks.

Dario Barbieri

Administrator

Hello Dario,

the MIDI.TrackVolumeSet method, applied to a specific track, should be the way to go. Panning could be applied using a combination of values applied to single tracks using the mentioned method. Obviously, the total number of available MIDI tracks can be obtained through the MIDI:TrackCountGet method.

Hope this helps.

Kind regards

Severino Delaurenti
MultiMedia Soft


dario

Many thanks for your reply.

I have another question (sorry, but my programming skill are still poor):
- which statement should I use how can I get (in a listbox) the list of the tracks (channels) and their corresponding instrument (trumpet, violin, ...) ?
This should allow me to select the track upon which apply the volume change.

Many thanks in advance.

Dario Barbieri

Administrator

You are welcome.

as already mentioned before, the total number of available MIDI tracks can be obtained through the MIDI:TrackCountGet method but, unfortunately, there is no way to assign them a "friendly name", reporting the corresponding instrument, that could be used to list the track into a listbox.

Kind Regards

Severino Delaurenti
MultiMedia Soft


dario

Salve, sono ancora qui a disturbare.
Mi piacerebbe inserire nel mio progetto un VUmeter per ogni canale, per visualizzare in tempo reale, durante la riproduzione del file MIDI, l'intensità (o volume) dei singoli strumenti, visualizzando così le loro "entrate" e "uscite".
Ho hatto qualche tentativo con i comandi Midi.stream.... ma temo di non aver compreso bene la sintassi.
Può aiutarmi ?
Grazie.

Dario

Administrator

Hello,

please, note that the language for this forum is English only. If you need to ask support in Italian, please, fill the form on our "Contact us" web page:
http://www.multimediasoft.com/contact

With regards to your question, if you need to receive notifications about each note in real-time, you may need to enable the MidiStreamEventNotification event by invoking the MIDI.StreamEventsEnableNotifications method for the MIDI_EVENT_NOTE option. An example of usage of this combination can be found inside the VB6 sample "MidiSynthesizer" installed with our setup package: inside this sample the note received through the MidiStreamEventNotification event contains the nMidiParam1 parameter which reports the played note and the nMidiParam2 which reports the related intensity: unfortunately at the moment I don't know if there is also a way to distinguish which instrument played the note.

Kind Regards

Severino Delaurenti
MultiMedia Soft


dario

Hello, my project is proceeding well, but I have a new problem.

When I create a spectrum and i try to change the bar settings, the resulting spectrum remains "black", without any bars.

This is the code I use, can you show me, please, the errors?

Many thanks in advance

in declarations
Dim spettro As OLE_HANDLE

in Form_load
    Amp3dj1.Spectrum.Create 0, 0
    Amp3dj1.Spectrum.Show 0, BOOL_TRUE
    spettro = Creaspettro(Picture3, GRAPHIC_BAR_ORIENT_HORIZONTAL)
'    spettro = Creaspettro(Picture3, GRAPHIC_BAR_ORIENT_VERTICAL)

then
Private Function Creaspettro(ctrlPosition As PictureBox, ByVal nOrientation As enumGraphicBarOrientations) As OLE_HANDLE
    Dim hWnd As OLE_HANDLE
    hWnd = Amp3dj1.GraphicBarsManager.Create(Me.hWnd, ctrlPosition.Left, ctrlPosition.Top, _
    ctrlPosition.Width, ctrlPosition.Height)
   
    Amp3dj1.GraphicBarsManager.SetRange hWnd, 0, 100
   
    Dim settings As GRAPHIC_BAR_SETTINGS
    Amp3dj1.GraphicBarsManager.GetGraphicalSettings hWnd, VarPtr(settings)
    settings.bAutomaticDrop = True
    settings.nOrientation = nOrientation
    Amp3dj1.GraphicBarsManager.SetGraphicalSettings hWnd, VarPtr(settings)
   
    Creaspettro = hWnd
End Function

Administrator

Hello,

when using a picture control as a positioning helper, please, be sure to set its Visible property to False or it could cover the graphic bars instanced directly on the container form.
Please, see the Feedbacks sample as a reference.

Hope this helps

Kind Regards

Severino Delaurenti
MultiMedia Soft

dario

Hello,
I followed your instructions but nothing changes.
If I  create a "standard" spectrum, referring directly to the Picture3.hWnd, it works perfectly.
When I shift to the "spettro" OLE_HANDLE I get a black picture with no bars.
I used strictly your samples, but seemingly there is some mistake in the code adjustements.

Administrator

Hello,

please, send us a VB6 project reproducing the issue so we could check it directly and make needed modifications.

Kind Regards

Severino Delaurenti
MultiMedia Soft

dario

Thank you for your reply.
Attached, please find the project (derived from your Test equalizer)

Administrator

Hello,

there are 2 ways to create a spectrum:

1- using the embedded spectrum visual feedback, in which case you need to provide the hWnd of the picture control to the Spectrum.Create method
2- using a set of graphic bars (not a single one as it seems you are doing in your code) so you should add a number of graphic bars identical to the number of monitored frequencies, just as seen inside the Feedbacks sample, and drive their values inside the SpectrumValueChange event: values to apply for each bar can be obtained through the Spectrum.GetTable method. As mentioned, all of these steps can be found inside the Feedbacks sample.

Let me know if I can be of further help.

Kind Regards

Severino Delaurenti
MultiMedia Soft

dario

Hello,
many thanks for your advice.
Now I've got a perfect "horizontal" spectrum.
Thank you once more.


dario

Hello,
one more question.
During MIDI straming playback I can set the volume of each individual channel: this way I can perform a "mute" or "solo" handling of the song. However this does not happen for all MIDI files: sometimes the committed channels are correctly identified (i.e. Channel 5 plays note 64 at volume 124, .... ) when played "altogheter", but if I try to play each channel as "solo", (i.e. setting to 0 the outstreaming volume of the remaining channels) I get not sound. In addition, very often the effect of a command like "volume set" takes effect only if addressed to a channel number bigger than tha real one: for example, to "mute" channel 0 I must address the command to channel 3, and so on.
Do you have any advice?
Many thanks in advance.
Dario 



dario

Hello,

since I got no reply, I think that maybe my question was not clear.
Therefore I send you the code of your MidiPlayer example and two midi files to explain what I mean.
In the code I simply added some Option buttons to "silence" all channels except the checked one.
I invite you to to play the Midi file "Bada bambina":
- checking the option buttons the system works correctly and you can hear each instrument playing alone. However, for example, to hear the "Grand piano" (which plays on Channel 0) you must check che  0ption button indexed 2, and so on.
Play now the Midi file "Camminando":
- checking any Option buttons obtains the result of "silencing" the whole song.

My question is:
why the "MIDI.TrackVolumeSet" command does not work correctly or the results are unpredictable?

Many thanks for your reply.

Dario Barbieri