Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Thursday, July 2, 2015

TCPRelay 0.4 beta 3

TCPRelay 0.4 beta 3 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4.

What's new in this version:
  • GUI
    • FIXED: TCPRelay would fail on startup under some circumstances if there was no IP address configured in Bind to Interface.
      Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

      Friday, March 20, 2015

      TCPRelay 0.4 beta 2

      NOTE: there is a newer version of TCPRelay here.

      TCPRelay 0.4 beta 2 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4.

      What's new in this version:
      • GUI
        • IMPROVED: cosmetic improvements to the Advanced Settings window.
        • FIXED: Advanced Settings window would fail to open again if closed by clicking the X button.
          Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

          Saturday, March 7, 2015

          TCPRelay 0.4 beta 1

          NOTE: there is a newer version of TCPRelay here.

          TCPRelay 0.4 beta 1 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4.

          What's new in this version:
          • GUI
            • NEW: added a new Advanced Settings window for tuning socket parameters
              • Socket Send Buffer Size moved to this window
              • Added Receive Buffer Size
              • Added No Delay
              • Added Connection Timeout
              • Can set up parameters for both the application- and the remote-facing sockets
              • [b1] Added an option to allow binding remote connections to a different IP address
            Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

            Tuesday, March 3, 2015

            TCPRelay 0.4 alpha 4

            NOTE: there is a newer version of TCPRelay here.

            TCPRelay 0.4 alpha 4 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4. Keep in mind that this is an alpha version; some features may not behave correctly.

            What's new in this version:
            • GUI
              • NEW: added a new Advanced Settings window for tuning socket parameters
                • Socket Send Buffer Size moved to this window
                • Added Receive Buffer Size
                • Added No Delay
                • Added Connection Timeout
                • Can set up parameters for both the application- and the remote-facing sockets
              Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

              Thursday, February 26, 2015

              TCPRelay 0.4 alpha 3

              NOTE: there is a newer version of TCPRelay here.

              TCPRelay 0.4 alpha 3 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4. Keep in mind that this is an alpha version; some features may not behave correctly.

              What's new in this version:
              • General
                • NEW: socket send buffer size can be tweaked from the console and GUI.
                  • Console: use the -sbs:## parameter.
                  • GUI: use the newly added Send Buffer field to adjust the buffer size.
                  • The default size is 8 KB.
                  • Increasing this might help reduce or eliminate dropped frames, especially on connections with high latency to the server.
              Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

              Thursday, December 4, 2014

              TCPRelay is now open source!

              Some people have been requesting that I made TCPRelay open source. I finally decided to put it up on GitHub after adjusting the build processes for them.

              Here's the Java version of TCPRelay. The latest released version is 0.1.1 beta. The current code base is 0.2 and has a few small improvements.
              Here's the .NET version of TCPRelay. The latest released version is 0.4 beta 1. The latest released versions are based on this.

              Have fun coding!

              Wednesday, November 5, 2014

              New YouTube channel and stuff

              Hey there guys! A couple of friends and I have started an YouTube channel about our geeky interests: video games, comic books, fiction books, movies, TV shows, and much more! It's The Geek Salad! (We are not edible.) We're just starting out, so check us out!

              I have not forgotten about publishing the TCPRelay source code, the Java synthesizer, the gaming stream, and other stuff I have talked about here. I'm just... a little bit lazy. :P

              Tuesday, October 21, 2014

              TCPRelay 0.4 alpha 2

              NOTE: there is a newer version of TCPRelay here.

              TCPRelay 0.4 alpha 2 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4. Keep in mind that this is an alpha version; some features may not behave correctly.

              What's new in this version:
              • General
                • NEW: partial localization support for:
                  • [es-AR] Spanish (Argentina)  (thanks to Nicolás Sigal)
                  • [nl-NL] Dutch (The Netherlands)  (thanks to TalbotEv)
                • If you wish to add your language, fill this table (make sure to fill both sheets: WinFormStrings and ControlsStrings) and send me via e-mail with the subject TCPRelay translations for [language] [country].
                • NOTE: only the GUI version has support for localization for now.
              • GUI
                • FIXED: [a1] status tooltip did not clear when TCPRelay was started sucessfully after an error.
                • FIXED: [a1] added localization support for several hard-coded strings.
                • FIXED: [a1] component layout updated manually for localization.
                • FIXED: [a2] old Twitch.tv ingest server list was shut down. Updated to the new Kraken REST API. Fixes an error when starting TCPRelay.
                Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

                Friday, August 29, 2014

                Writing a synthesizer... in Java

                Java. A synthesizer. I am writing the latter with the former. The first questions most people ask me are: why are you writing a synthesizer? Why Java?

                I am writing a subtractive synthesizer in Java, indeed. "Why?," you would ask. I have two objectives with this project:

                1. Challenge myself, learn something new, and write a piece of software that I'll enjoy to use frequently.
                2. Demonstrate that Java is powerful enough to synthesize decent audio in real time.
                In these series of posts, I am going to describe the challenges and share the knowledge I acquire as I go through this adventure.

                Why a synthesizer?

                Most people don't know about this, but I enjoy electronic music a whole lot (in particular: many forms of Trance, including Uplifting Trance, Goa Trance, Psychedelic TranceDrum & Bass and variations such as Neurofunk; some Breakbeats; and a few other things), enough to actually dabble into production. I have studied a bit of music theory, looked for tutorials, tips and tricks everywhere and followed some YouTube channels from great producers out there to learn more about the tricks of the trade. I have played with lots of different synthesizers and effects and experimented some DAWs, my favorite being FL Studio.

                The natural step after playing with those, as an avid programmer who is always looking for a challenge, is to learn more about how these things work from the inside. The best way to do that? Why yes, to write code!

                Of course, writing a synthesizer (or any piece of software, for that matter) is not only about writing code. You need to know the concepts behind what you're going to do.

                To build the inner workings of a synthesizer, you need a solid foundation on Digital Signal Processing, or DSP for short, and a working knowledge of MIDI if you want it to respond to real instruments and DAWs. It is also useful to learn about Steinberg's VST, one of the most popular software interfaces for audio synthesizers and effects, and similar technologies, such as DXi, RTAS and Audio Units, as these will allow you to use your plugin on pretty much any DAW in existence.

                As an added bonus, writing my own synthesizer means I can add my own touch to my songs. (Although I have yet to finish and publish one...)

                Why Java?

                My language of choice was Java in part due to the experience I have with it, but mostly because I wanted an extra bit of challenge by writing the synthesizer in a language that is usually regarded as inadequate for real-time number-crunching (and prove that it actually is up to the task).

                Since I wanted this synthesizer to integrate with FL Studio, I had to look for a Java library that provided me an implementation of one of the audio plugin interfaces supported by the DAW. jVSTwRapper was my choice; it does a great job of keeping the native-Java overhead very low and provides an API that closely resembles the native one in C++ while providing a bit of object-oriented flavor.

                I also had to write a simple GUI to test the synthesizer itself in Java without having to go through the build process and restart my DAW anytime I made any changes to the code. That in itself was not as challenging as before, as I had written a module music player in Java (supporting MOD, S3M and IT) and the workings are very similar.

                Oh, and Java is the primary language of Android apps. Maybe in the future you could be playing with my synthesizer on your smartphone. How cool is that?


                Stay tuned!

                Saturday, May 10, 2014

                Getting into GitHub

                I think it's about time I did it. I'm finally on GitHub!

                To start things off, I uploaded two of my personal projects: a bunch of Java utility classes, not unlike Guava, and an XInput library for Java which enables coders to use Xbox 360 controllers (and possibly other XInput devices) in Java. Both projects are released under the MIT license, i.e. do whatever you want with them.

                Some people have requested that I make TCPRelay open source. I feel that I need to fix a few things before doing that. The Java version was abandoned on version 0.1.1 beta, back when Twitch.tv and Justin.tv were still one and the same, because many people were having issues with Java. I wrote the C# version for that very reason, and because it was just much more comfortable to write a graphical interface with it.

                Both projects have very manual methods of building the packages. I'll be honest: I haven't put enough effort into their build processes because, as stated in the readme file, it was just a quick-n-dirty test that I decided to make usable.

                I don't know. I might put them up as is so you can point and laugh at how ugly the code looks... or you can help me fix their build processes. :)

                Tuesday, July 30, 2013

                TCPRelay 0.4 alpha 1

                NOTE: there is a newer version of TCPRelay here. It fixes a problem with Twitch.tv ingest server listing when starting up, so if you still have the problem, make sure to upgrade now.

                TCPRelay 0.4 alpha 1 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4. Keep in mind that this is an alpha version; some features may not behave correctly.

                What's new in this version:
                • General
                  • NEW: localization support for:
                    • [es-AR] Spanish (Argentina)  (thanks to Nicolás Sigal)
                  • If you wish to add your language, fill this table (make sure to fill both sheets: WinFormStrings and ControlsStrings) and send me via e-mail with the subject TCPRelay translations for [language] [country].
                  • NOTE: only the GUI version has support for localization for now.
                • GUI
                  • FIXED: status tooltip did not clear when TCPRelay was started sucessfully after an error.
                  • FIXED: added localization support for several hard-coded strings.
                  • FIXED: component layout updated manually for localization.
                Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

                Saturday, June 29, 2013

                TCPRelay 0.3 beta 3

                NOTE: there is a newer version of TCPRelay here.

                TCPRelay 0.3 beta 3 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4.


                What's new in this version:
                • GUI
                  • FIXED: serverlist.txt is now saved to the user's AppData folder to avoid permission issues. (Thanks for reporting this Pedroca!)
                    The full path under Windows Vista/7/8 is:

                            C:\Users\<user>\AppData\Local\TCPRelay
                Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

                Thursday, May 30, 2013

                Tracker music player using XMP

                Recently I've been working on a tracker music player based on the xmp library. I got the basics working: the DirectSound stream buffer, a software circular buffer to write audio data, compiled xmp into .dll and .lib and integrated those into my project. Then I wrote a simple command-line based player to test it. Works like a charm!


                XMPModPlayer playing 2nd_pm.s3m by Purple Motion of Future Crew

                For those of you unfamiliar with the scene, tracker music (or module music) is an old music format very popular back in the DOS and Amiga era and was used by many games and artists of that time and even further. For instance, Epic Games used it on games like Jazz Jackrabbit and Unreal Tournament. It was also very popular in the demoscene; in fact, some tracker music formats (such as S3M and XM) were created by demosceners because they needed something better than what they had -- they needed to do something impressive, which is the whole point of demos.

                Tracker music files are very similar to MIDI files, except they also include samples and sometimes instrument information like envelopes, filters, key mapping and such. These formats were very influential, so much that there is a contemporary tracker inspired on them that can take advantage of modern technology such as VST plugins. OpenMPT runs on modern OSes too and plays these old formats without a hitch.

                "So, if there are very powerful trackers/players out there, why are you writing a simple player?" For two reasons:
                1) I enjoyed tracker music back then, and I still enjoy them today, and I didn't want to use Winamp or OpenMPT to play those songs, and I couldn't find a xmp player for Windows. (Well, this is like four reasons in one... :P)
                2) I wanted to learn DirectSound programming, and this proved to be an adequate challenge.

                I'm thinking about improving this player quite a bit, making a graphical front-end for xmp but with very advanced visualization features (think Cubic Player, but with more bling), so I can learn Direct3D/OpenGL too. I'll also probably try to implement support for ASIO drivers, mostly for learning purposes.

                Saturday, January 12, 2013

                TCPRelay 0.3 beta 2

                NOTE: there is a newer version of TCPRelay here.

                TCPRelay 0.3 beta 2 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4.


                What's new in this version:
                • GUI
                  • NEW: the Target URI list is now saved to a file in the TCPRelay folder (serverlist.txt) and reloaded every time TCPRelay starts.
                  • NEW: pressing Enter while typing a Target URI or starting TCPRelay will add the current Target URI to the list if not already present.
                Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

                Friday, December 14, 2012

                TCPRelay 0.3 beta


                TCPRelay 0.3 beta is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4.

                What's new in this version:
                • GUI
                  • NEW: the last Target URI and Listen Port values are now saved to the Windows Registry under the key:

                            HKEY_CURRENT_USER\Software\StrikerX3\TCPRelay

                    Now every time you restart TCPRelay the last used server and listen port should be automatically set.
                Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

                Friday, November 30, 2012

                State of TCPRelay, and Natural Selection 2

                It's been a while since my last update here. If you're wondering why I haven't been updating TCPRelay lately, it's mostly because there was no demand for improvements or fixes for it. Also, I work as a systems analyst and that involves a lot of programming, so it's also a matter of being burned out too.
                Anyway, here's a few ideas for the next versions of TCPRelay I have written down:
                • Stream delay: I'm not entirely sure this is possible without inspecting the stream data, but this is definitely worth checking out.
                • A way to fetch server lists from other services (own3d.tv, YouTube, ustream, ...). Also enable users to add their own lists, keep them between sessions and share with others.
                • Improve localization support and allow users to translate TCPRelay to other languages.
                • Fork into TCPProbe -- basically TCPRelay with packet inspection and manipulation capabilities through .NET plugins. Could be useful for network development.
                If you have any suggestions, please feel free to comment.

                On another note, I've been looking for a strong, competitive FPS that's reminded me of the old, but fun formula of Unreal Tournament and Quake: fast-paced action with insane movement skills and pinpoint aiming accuracy required. Unfortunately, since 2007 (when UT3 was released), there was not a single memorable FPS that followed the formula and caught my interest, turning me off from the genre. I went on to other games, including World of Warcraft, Starcraft 2, Borderlands 2 and several casual and indie games. That is, until last month.

                Natural Selection 2 was developed by Unknown Worlds Entertainment and released on October 30th. I haven't heard much about the game until then, but instantly got addicted the moment I got into a multiplayer game. It's an amazing blend of RTS and FPS with a surprisingly friendly community -- the complete opposite of most popular games such as Dota 2, LoL and Starcraft 2. People in NS2 actually help each other out, newbies ask questions and learn tricks and tactics from veterans (there's even some pro players giving out "classes" for free on their servers! See here and here); there's no split between the n00bz and the pros. Teamwork and coordination are absolutely required to get somewhere. Trying to Leeroy Jenkins your way into the enemy base *will* get you killed, unless you happen to be an Onos fighting against a bunch of rookie marines (and even then, if they know how to press the fire button and move their mouse to follow a giant suicidal gorilla-rhino-thing around, you *will* go down).

                I highly recommend NS2 to anyone who has been yearning for something other than the generic "realistic" war shooter #235 with killstreaks and "realistic" gunfights, or anyone who enjoys either the FPS or RTS genres at all. It may not be as popular as LoL or Dota or SC2, but it's definitely competitive and interesting to watch. Refer to this topic on the UWE forums for a list of streams/YouTube channels/whatnot on NS2 competitive play. Oh, and it's cheap on Steam -- just 25 bucks.

                Wednesday, October 3, 2012

                Reminder: TCPRelay 0.3 alpha 3 released!

                For those people who follow my blog/Twitter: TCPRelay 0.3 alpha 3 is now available! Check out the original post for version 0.3 and download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4. Keep in mind that this is an alpha version; some features may not behave correctly.
                There were two changes to the GUI:
                • NEW: [alpha 3] application now has an icon (thanks to Fryderyk "Ziel" Dachowski!)
                • FIXED: [alpha 3] tooltips for speed buttons were incorrectly referring to "as slow as possible".

                Thursday, September 27, 2012

                Simplify ternary operators

                One of my pet peeves in Java/C/C++/C# programming is the use of the ternary operator ?: with boolean values. It's almost always redundant, makes code harder to read and can be easily replaced by a simpler boolean expression that also has the advantage of being "branch-free" in some languages, that is, do not require the CPU to select a path of execution based on a condition, which can be very expensive. The best compilers will optimize them away in a manner similar to what I describe below, but they still don't improve code readability.

                From this point onward I'll be using the Java/C/C++/C# code syntax. A boolean expression is any valid expression that results in a boolean value. This may be anything from the constants true and false all the way to complex expressions such as x == 1 && (y > 3 || z <= 1.25) && !checkSomething(x, y, z) (assuming checkSomething(...) returns a boolean).

                Say you have the condition c and the boolean expressions p and q. The following table contains all possible conversions from a ternary expression to an equivalent boolean expression:

                #Ternary Expressionif-then-else ExpressionEquivalent to
                1c ? p : qif (c) p else q(c && p) || (!c && q)
                2c ? p : trueif (c) p else true!c || p
                3c ? p : falseif (c) p else falsec && p
                4c ? true : pif (c) true else pc || p
                5c ? false : pif (c) false else p!c && p
                6c ? true : falseif (c) true else falsec
                7c ? false : trueif (c) false else true!c
                8c ? true : trueif (c) true else truetrue
                9c ? false : falseif (c) false else falsefalse

                Note that #1 may or may not result in more readable code; it is probably better to use the ternary operator in that case. #6 through #9 are poor coding practices and should be replaced as soon as possible by their equivalent boolean expressions. #2 through #5 require attention and almost certainly will result in better, cleaner code.

                Also note that c ? p : q is equivalent to if (c) b=p else b=q. In other words, if any boolean variables are assigned a value that depends on the condition of an if-then-else clause, then that value can be simplified according to the equivalence table above, as long as there are no unintended side-effects.

                Let's try this with an example:

                boolean b = i > 5 ? j == 3 : false

                or, as an if-then-else clause:

                boolean b;
                if (i > 5) b = j == 3; else b = false;

                Looking at the above table, this matches expression #3, with:

                c = i > 5
                p = j == 3

                The equivalent expression would be:

                boolean b = i > 5 && j == 3

                which is slightly shorter and certainly less confusing than the above ternary or if-then-else statements.

                Sunday, September 16, 2012

                TCPRelay 0.3 alpha 3

                TCPRelay 0.3 alpha 3 is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4. Keep in mind that this is an alpha version; some features may not behave correctly.

                What's new in this version:
                • General
                  • NEW: localization support for:
                    • [en-US] English (United States)
                    • [pt-BR] Portuguese (Brazil)
                  • Send me an e-mail if you wish to add your language.
                  • NOTE: only the GUI version has support for localization for now.
                • Console
                  • FIXED: application no longer crashes when a connection is closed. The fix never got into 0.2.2.3 for some reason.
                • GUI
                  • NEW: Localization support, as above. By default the application will use the default language set in your operating system. You can override this by passing the language code as an argument to TCPRelay.exe. The supported language codes are listed between brackets above.
                  • NEW: [alpha 3] application now has an icon (thanks to Fryderyk "Ziel" Dachowski!)
                  • FIXED: [alpha 2] localization should now work properly on all parts of the GUI.
                  • FIXED: [alpha 3] tooltips for speed buttons were incorrectly referring to "as slow as possible".
                TCPRelay finally has its own icon, thanks to Fryderyk "Ziel" Dachowski! I appreciate your work :)

                Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

                Sunday, August 12, 2012

                TCPRelay 0.2.2.3 beta

                TCPRelay 0.2.2.3 beta is now available! Download the 32-bit or 64-bit version. You may also need to install the Microsoft .NET Framework 4.

                What's new in this version:
                • General
                  • FIXED: [0.2.2.1] no longer tries to reverse DNS lookup the target host. Should fix issues with not being able to connect to certain servers.
                  • FIXED: [0.2.2.2] reduced socket buffer size. This should eliminate dropped frames and disconnects caused by a change in version 0.2.1.0.
                • Console
                  • FIXED: [0.2.2.3] application no longer crashes when a connection is closed.
                • GUI
                  • FIXED: Target URI field no longer loses selection after being populated by the Twitch.tv updater.
                  • FIXED: speeds below 1 bps no longer show as ",# bps" or "bps".
                  • FIXED: [0.2.2.3] outbound and inbound speeds were swapped.
                  • IMPROVED: connection info no longer shows the local bandwidth (the old Received column). Since TCPRelay cannot receive more data than it can push to the servers (due to blocking I/O), that column was completely redundant. The numbers displayed in the GUI now represent the actual bandwidth usage (the old Published column).
                  • IMPROVED: average speed is now an average of the last 2 seconds.
                  • IMPROVED: connection info now displays connection duration in HH:MM:SS.
                  • IMPROVED: [0.2.2.3] closed connections now display the overall average speeds.
                  • Speed history graph:
                    • IMPROVED: widened to fit the extra available space.
                    • IMPROVED: now displays a wide bar with the current speeds to the right of the graph.
                    • IMPROVED: slightly reduced resource usage.
                TCPRelay still does not have its own icon. If anyone could provide me with one, preferably in 16x16, 32x32, 48x48, 64x64 ICO and 128x128, 256x256 PNG formats, I'd be very grateful! :)

                Check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.