midi port in c++

Discussion in 'Effects and the DSP' started by stylus02, Jan 18, 2008.

  1. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Just installing the latest Windows SDK will update the headers for you, etc. In any case you should be fine for now, but at some point you should install the SDK. Regarding the code, as you have figured out, you can just replace DWORD_PTR with DWORD, and you can remove the DWORD_PTR line from the uMidiData union (and change "uMidiData.pData = dwParam1" to "uMidiData.dwData = dwParam1").
     
    Last edited: May 21, 2008
  2. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    have downloaded microsoft visual studio 2008 express. everything free, actual and ready for use.
    for all who are interested in: Downloads
     
  3. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
    iirc, M$VS 2008 Express doesn't come with MFC.
    If so, then you probably run into KXGUI MFC dependency problems.
     
  4. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
  5. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I am pretty sure that is just the .dll's and not the MFC header filers and libs, which is what Lex meant.

    BTW: Info on how to get the necessary headers, etc can be found here: http://www.driverheaven.net/1046226-post14.html

    Also, in case you misunderstood, VC 6 is fine and actually is the preferred version for kX plugin development (since it includes the same MFC version (MFC42) that the kX SDK uses).
     
    Last edited: May 20, 2008
  6. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
    Yep, those are just the dlls.
    But why on earth did you wanna switch in the first place while VC6 worked fine??
    It's much easier to stick with MSVC 6 for now, especially in your case stylus.
     
  7. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    ok, i've not realized the problem with the free express edition, which seems only to be free because the limitations. today i just saw randomly the offer on microsofts website and said to me "why not? it's only a 100 mb download." :)

    neverthless.. i like the new environment, which looks to be easier for a beginner like me. if there is no way to get warm with it (kx & express) of course i take my hands off it.

    stylus
     
    Last edited: May 21, 2008
  8. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Not including a commercial library is not really a limitation... :)
     
  9. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    kxm120 beta 01

    the km120 has got 2 combo boxes to change midi input device and midichannel. the midi devices are not listet by name but by number at the moment. you can try out or use the little program ListMidiDevs.exe below.
    also you can use multiple instance of kxm120 but be careful that allways different midi input devices are selected, because same devices could not opened at same time.

    in later versions:
    - show the device names.
    - multiple outputs (notes, gates) which can set with midichannel (multitimbral)
    - midi controller data pass to kx control automatically
    (the impatient of you can use hubi's loopback for do that :) )
    - legato, glide, pitchbend and whatever can dreamed of..

    note: the kxl is compiled for 3538m!
    http://freenet-homepage.de/stylish-stylus/kxm120_beta_01.kxl
    http://freenet-homepage.de/stylish-stylus/ListMidiDevs.exe

    stylus
     
    Last edited: May 22, 2008
  10. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    What version of kX did you compile it for?
     
  11. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    oh i forgot. it's version 3538m. wait i make a link with the workpace files .

    link removed
     
    Last edited: May 22, 2008
  12. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Ok, I downloaded the project files. I have to run out for like 30 min, but I will look at it when I am back.

    BTW: I can add the device names easy enough, if you are having trouble with that.
     
  13. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    i know that it could be done with the midiincaps. but how to put it into the combo.add_string() sequentially? the c++ is crazy enough and here we have to deal with windows api too... it would be great if you can do this. :)
     
    Last edited: May 22, 2008
  14. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Sorry for the wait. I added the device names and made a few changes.

    I changed the order that the GATE and CV values are set, such that GATE is turned on after CV value is set (I had it reversed in my example code).

    Added a check to see if the port is able to open successfully... If it fails, device selection is set to none.

    I added code to turn off the gate when changing ports, channel, or exiting.

    (temporary link removed)

    BTW: Some of the stuff can be done more efficiently, etc, but I find it better to do that when everything else is done.
     
    Last edited: May 23, 2008
  15. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    downloaded and check it now. let me test it a few moments.
    ..
     
    Last edited: May 22, 2008
  16. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Have fun... BTW: Included with the source is a kxl compiled for 3541 (also, note that 3539 and later plugins should be compiled using the release config (and linked with the appropriate version of kX SDK, etc). There is compatibility info at the bottom of my kX Stuff page, that should give you some clues as to which kX versions the plugin will work with, when compiled with different versions of the kX SDK, etc).
     
  17. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    works fine. the midi devices are listed very well. i have seen the midiincaps- call in the little listmididevs.exe but was not shure if i simply can use that because data type handling.
    the gate set to 0 was a good idea to avoid note hangon. the error checking too, although it worked without it.
    i'm really happy with it. now it's time to check out the incredible timing while making some tunes. :)

    3539 later.

    http://freenet-homepage.de/stylish-stylus/kxm120_3538m.kxl
    http://freenet-homepage.de/stylish-stylus/kxm120_3541.kxl

    updated:
    - facelift (standard size)
    - copyrights info

    please report incompatibilities
     
    Last edited: May 23, 2008

Share This Page

visited