Announcement

Collapse
No announcement yet.

sending and recieving data as midi from quake

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • sending and recieving data as midi from quake

    Hi, i'm new here.

    I'm interested to know if anyone can tell me if the following is possible (or if something similar has already been done/attempted):

    - i want to recieve event data from quake (e.g. ammo box collected, monster spawned) and convert it to midi data which is sent to a max/msp patch.

    - i also want to send midi data from a max/msp patch to the game in order to control parameters such as FOV or game speed (for example).

    So the question is, is it possible to create some kind of interface which does this using quake C, and maybe PD? Or any other ideas? I currently have no programming experience, I just know how to use max/msp. But in theory I could attempt to learn some quake C/PD to do this. The question is, how feasable is it to send and recieve data externally from quake in the way mentioned. And how hard would it be for me to achieve this if it is possible?

    Any advice or pointers in the right direction appreciated

  • #2
    hmm.. i'm not an expert on QC or any engine related coding, but i do know that joystick input uses (or at least used to use) the so called "gameport" on sound cards, which is actually a midi I/O port, so controlling the game from any midi device should be pretty easy to do..

    (just bind whatever quake command to the AUX keys used by a joystick/gamepad, or in this case a midi device)

    in terms of controlling a midi device from quake... i dunno about that, but i guess it could be done..

    Comment


    • #3
      on reflection it doesn't have to be midi data.

      im thinking now along the lines of sending gamepad or key data somehow via max, so that these simply trigger keys binded to the desired parameters

      Comment


      • #4
        this tool might come in handy..

        Comment


        • #5
          ive just installed this:

          Bome's Midi Translator - Bome Software

          which ive got printing keys when i hit a couple of midi controls. problem is they dont register in quake at the moment... they register in the console but not in the game itself. apparently this is because games tend to use DirectInput of keystrokes, which the midi translator does not yet support.
          Last edited by genfu; 02-07-2009, 04:27 PM.

          Comment


          • #6
            if the keys print in console then all you need to do is..
            bind whatever quake command to them keys in quake like so:

            bind "x" "say x"

            replace "x" with whatever key and "say x" with whatever quake command..

            assuming you meant the quake console that is...

            else that auto-hotkey tool might just be what you need to make it work in quake..

            also, if your not scared to get into python scripting (which is actually not all that hard) then this might be a good place to look..
            Last edited by =peg=; 02-07-2009, 05:21 PM.

            Comment


            • #7
              where i'm up to with this:

              i can get 5 midi notes to control stuff in quake, by using midi translator to send mouse1, mouse2, mouse3, mousewheelup and mousewheeldown.

              i can get midi translator to trigger autohotkey, which sends keys to quake. the problem is the keys appear ONLY in the console, so a keystroke sent from midi translator OR autohotkey will appear in the console, but you cannot bind it to anything, because it will not trigger in the main game, and it will not recognise as a key in customise controls. as far as i can tell this is either due to Direct Input, meaning the key is not detected because AHK and MT don't send Direct Input keystrokes, and/or because quake could be preventing external keystrokes or something.

              i've also tried getting autohotkey to send joy1, joy2, joy3 information, which doesn't seem to register properly in quake either.

              so at the moment i'm limited to using the mousekeys only, which is not idea because the idea was to automate parameters of the game with keys you wouldn't normally be using in the game (U, I, O, P or something). but i can start experimenting with using mousewheelup and mousewheeldown + mouse3 which i can manage without for normal game controls for the time being. so the next question is:

              can you increment values of things such as FOV, rather than just setting them, so for example:
              bind mousewheelup "[increase FOV by 10]"
              bind mousewheeldown "[decrease FOV by 10]"
              so hitting mousewheeldown repeatedly would result in
              FOV 80
              FOV 70
              FOV 60
              etc.
              rather than just setting a fixed value. how can you do this... ?

              Comment


              • #8
                fitzquake and darkplaces have a cvar for that called "inc" to increase (or decrease if negative value) another cvars value..

                however you could use some aliases for this..

                example:
                Code:
                //intitiatal values
                alias fov_up fov_090
                alias fov_dn fov_090
                
                //scrolling
                alias fov_010 "fov  10;alias fov_up fov_020;alias fov_dn fov_010"
                alias fov_020 "fov  20;alias fov_up fov_030;alias fov_dn fov_010"
                alias fov_030 "fov  30;alias fov_up fov_040;alias fov_dn fov_020"
                alias fov_040 "fov  40;alias fov_up fov_050;alias fov_dn fov_030"
                alias fov_050 "fov  50;alias fov_up fov_060;alias fov_dn fov_040"
                alias fov_060 "fov  60;alias fov_up fov_070;alias fov_dn fov_050"
                alias fov_070 "fov  70;alias fov_up fov_080;alias fov_dn fov_060"
                alias fov_080 "fov  80;alias fov_up fov_090;alias fov_dn fov_070"
                alias fov_090 "fov  90;alias fov_up fov_100;alias fov_dn fov_080"
                alias fov_100 "fov 100;alias fov_up fov_110;alias fov_dn fov_090"
                alias fov_110 "fov 110;alias fov_up fov_120;alias fov_dn fov_100"
                alias fov_120 "fov 120;alias fov_up fov_130;alias fov_dn fov_110"
                alias fov_130 "fov 130;alias fov_up fov_130;alias fov_dn fov_120"
                
                //binds
                bind mhweelup fov_up
                bind mhweeldn fov_dn
                just type this ^^ in console or better:
                save as zoom.cfg in \id1 and execute from console, for example:
                exec zoom.cfg

                btw, you can bind "joy1" to "joy4" and "aux5" to "aux12".
                and set -dinput in quake commandline to enable direct input
                Last edited by =peg=; 02-07-2009, 08:36 PM.

                Comment


                • #9
                  Originally posted by =peg= View Post
                  fitzquake and darkplaces have a cvar for that called "inc" to increase (or decrease if negative value) another cvars value..
                  i'm actually doing this with darkplaces at the moment... how do you use the "inc" command?

                  Originally posted by =peg= View Post
                  set -dinput in quake commandline to enable direct input
                  unfortunately this doesn't help to get the keys working, because (as i understand it) keystrokes are direct input anyway, and i'd need them not to be for MT to be able to send keystrokes.

                  -directinput sets direct input to "on" for the mouse and joystick, i'll need to check if that makes any difference for sending clicks/presses from MT. interestingly since direct input enables forcefeedback joysticks to work, i'm wondering if there is some way to recieve that forcefeedback info and translate it back to midi... but i'll look at that one later.

                  Originally posted by =peg= View Post
                  btw, you can bind "joy1" to "joy4" and "aux5" to "aux12".
                  what are "aux5" and "aux12"...?

                  these comments are really useful btw., thanks. i'm not too far off getting a midi controlled oscillator on a parameter...

                  Comment


                  • #10
                    when i assign XButton1, XButton2 or Joy1, they all work in the game... but they all also trigger messagemode. these buttons appear as "SHIFT" in customize controls, and they do not recognise with the above descriptions in the console, so you can't unbind them (assuming they are bound to messagemode for some reason).

                    Aux1 works in the game, but it effectively functions as SHIFT. So if you bind Aux1 to "+attack", nothing happens. If you then bind SHIFT to "+attack" then hitting the midi pad which triggers "Aux1" will trigger whatever SHIFT was bound to. Unbinding SHIFT means Aux1 does nothing, and hitting SHIFT when it is bound performs the same function as Aux1 (of course).

                    Aux12 also appears as SHIFT in customise controls, and performs the same function as above. Weirdly though, if SHIFT is unbound and you hit Aux12, it cycles your weapon quickly in an instant returning it to what it was originally (this happens in about a single frame). This is when Aux12 is unbound. Odd.
                    Last edited by genfu; 02-08-2009, 05:13 AM.

                    Comment


                    • #11
                      Short video demonstrating FOV automation using MAX/MSP > MidiYoke > Bome's Midi Translator > AutoHotKey > Fitzquake:

                      http://www.loadsavedelete.com/g/stomaquake.avi

                      Basically at the moment it works by sending 25 bangs to one midi note, then 25 bangs to another midi note. These midi notes are converted to mwheelup and mwheeldown, which are bound to "inc fov 2"/"inc fov -2" commands.

                      A midi slider controls the rate at which Max/Msp cycles the bangs with a counter, so you can control the speed at which the FOV changes.

                      I'm using Aux1 to centre it on each cycle at the moment [bind SHIFT "fov 90"], because otherwise it drifts forward for some reason. I'm not sure if thats a problem with max, quake or the accuracy/latency of sending midi notes this way. There should be 25 up and 25 down, so it should centre itself with each cycle, but it doesn't. The FOV value gradually drifts downwards every time. You can see that in the video; this is why the transition is not smooth.

                      Hopefully I can improve these things later, but as a basic test it demonstrates that you can control Quake parameters from Max/Msp.

                      Comment


                      • #12
                        lol that looks funky

                        nice job!

                        btw, i got a Roland MC 505 Groovebox synth, which has a D-Beam controller.. i might try do some funky stuff with it myself.. should be fun playing quake by only moving your hands around in free air!

                        I'll post back when i do..

                        Comment


                        • #13
                          Originally posted by =peg= View Post
                          lol that looks funky
                          btw, i got a Roland MC 505 Groovebox synth, which has a D-Beam controller..
                          I'll post back when i do..
                          I used to have one of those, if the D-Beam sends midi data that could indeed be sweet.

                          Comment


                          • #14
                            following this up, someone gave me a mxj for max/msp now which means you can send keystrokes directly from max/msp to quake (and have them register in the game). that means i can ditch all the midi crap and automate any key

                            Comment


                            • #15
                              cool!

                              Comment

                              Working...
                              X