Обитель Злобного Гения

Сборник гениальных идей, рецептов, мыслей и изобретений
RSS icon Home icon
  • A collection of classic Russian songs in Japanese

    Posted on May 24th, 2011 evilgenius 2 comments

    After accidentially finding a japanese version of Russian song “Black eyes” in my audio library, I decided to check if there are more similar records on the Internet. That’s what I have found.

    Черные глаза

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    Миллион алых роз

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    Подмосковные вечера

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese 1

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese 2

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    Голубой вагон

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    Эх, дороги

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    А я иду, шагаю по Москве

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    Катюша

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    Синий платочек

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    Ландыши

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    Очи черные

    • Russian – see end of “Черные глаза”
    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    Цыганочка

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Japanese

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    And the last one, though not in Japanese:
    Группа крови на рукаве

    • Russian

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    • Korean

      Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

    All recordings are published for information purposes only. All rights belong to their respective owners.

    Share/Bookmark
  • How to pass full RequestContext to an inclusion_tag

    Posted on March 26th, 2011 evilgenius No comments

    A way of passing a full copy of RequestContext (extended with additional variables) to an inclusion_tag in Django.

    from copy import copy
    from django import template
    
    register = template.Library()
    
    @register.inclusion_tag("template.html", takes_context=True)
    def do_something(context, arg):
        ctx = copy(context)
        ctx.update({ 'arg': arg })
        return ctx
  • An open source eBay sniper with web interface

    Posted on May 22nd, 2010 evilgenius No comments
    Web Interface

    Web Interface

    One day I got tired of missing good auctions on eBay, and began my research of available auction sniping services and software, which increase the probability of winning by making a bid in during the final seconds of the auction. Unfortunately, all of them were either not free, very buggy, or required me to keep my Windows PC running, which is rather inconvenient, because many listings end when it’s late night in Moscow. Haven’t found anything good enough, I decided to write my own sniper script, capable of running on Linux/Unix as a service and having a web-based GUI for managing listings and watching their status over the network.

    System Requirements (tested under Linux only):

    1. Python 2.6
    2. mechanize 0.1
    3. BeautifulSoup 3
    4. Genshi 0.5
    5. FormEncode 1.2
    6. CherryPy 3.1

    Project source code and updates: GitHub. The code is released under the GPL license version 2.

  • Ethornell (BGI) package extractor

    Posted on May 15th, 2010 evilgenius No comments

    A Python script to extract files from packages used by the Ethornell BGI (Buriko) engine. Has been successfully used to extract some music in Ogg Vorbis format.

    import struct, os
    from optparse import OptionParser
    
    class Unpacker:
            files = []
    
            def __init__(self, options, file):
                    self.opts = options
                    self.file = file
                    self.readtoc(file)
                    if self.opts.verbose:
                            print "There are %d files in the package" % (len(self.files))
    
            def readfmt(self, format):
                    return struct.unpack(format, self.input.read(struct.calcsize(format)))
    
            def sizefmt(self, num):
                    for x in ['bytes','KB','MB','GB','TB']:
                            if num < 1024.0:
                                    return "%3.1f%s" % (num, x)
                            num /= 1024.0
            
            def entryfmt(self, entry):
                    name, offset, size, zero = entry;
                    assert(zero == 0)
                    return (name.rstrip("\x00"), offset, size)
    
            def entryrepr(self, entry):
                    (name, offset, size) = entry;
                    return "%s (%s)" % (name, self.sizefmt(size))
    
            def readtoc(self, file):
                    self.input = open(file, "rb")
                    header, count = self.readfmt("12sl")
                    assert(header.rstrip() == "PackFile")
    
                    for n in range(0, count):
                            entry = self.entryfmt(self.readfmt("16sllQ"))
                            self.files.append(entry)
                            if self.opts.list:
                                    print self.entryrepr(entry)
    
                    optsize = self.readfmt("l")[0]
                    # heuristics to detect presence of the data block
                    if (optsize != 64):
                            optdata = False
                            self.input.seek(-4, os.SEEK_CUR)
                    else:
                            optdata = True
                            self.input.seek(optsize - 4, os.SEEK_CUR)
    
            def extract(self, ext, dir):
                    self.data_offset = self.input.tell()
    
                    if os.path.isdir(dir) == False:
                            os.mkdir(dir)
    
                    if self.opts.verbose:
                            print "data offset: %d" % (self.data_offset)
    
                    for file in self.files:
                            (name, offset, size) = file
                            dest = "%s/%s.%s" % (dir, name, ext)
                            print "extracting: %s to %s" % (self.entryrepr(file), dest)
                            self.extractf(dest, offset, size)
    
            def extractf(self, dest, offset, size):
                    output = open(dest, "wb")
                    self.input.seek(self.data_offset)
                    self.input.seek(offset, 1)
                    output.write(self.input.read(size))
                    output.close()
    
    def main():
            usage = "usage: %prog [options] args"
            parser = OptionParser(usage)
            parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="show verbose output")
            parser.add_option("-l", "--list", action="store_true", dest="list", help="list package contents")
            parser.add_option("-e", "--extension", dest="extension", help="append EXTENSION to output files")
            parser.add_option("-x", "--extract", action="store_true", dest="extract", help="extract package contents")
            parser.add_option("-d", "--directory", dest="directory", help="extract into the specified directory")
    
            parser.set_defaults(directory=".", extension="dat")
            (options, args) = parser.parse_args()
            if len(args) != 1:
                    parser.error("incorrect number of arguments")
    
            unpacker = Unpacker(options, args[0])
    
            if options.extract:
                    unpacker.extract(options.extension, options.directory)
    
    if __name__ == "__main__":
            main()
    
  • Carefully restored sheet music – For You (Marmalade Boy OST)

    Posted on May 3rd, 2010 evilgenius No comments

    A long long time ago on a single website in the whole Internet I found the sheet music for a piano piece called For You, which is performed by Tsuchiya Kei in several episodes of the anime Marmalade Boy. It was a low-quality (400×800 pixels) scan, which I have carefully restored and typed in Finale from scratch. The resulting work was then uploaded to the public sheet music library of Boris Tarakanov. As the time went by, the only source with the original scanned sheet music has been closed, but the demand for the sheet music seems to still exist, and that’s why I’m sharing an updated version here in which I’ve also found and fixed a couple of typos (some of them are also present in the original scan).

    Download: For You (downloaded 1082 times) – 89.5 kB, updated 02.05.2010.

    Please report any typos you may find in the score to me, so that I can fix it and upload an updated version. Thank you!

  • Playing with the UDK

    Posted on April 28th, 2010 evilgenius 1 comment

    After I found out that the Unreal Development Kit has been released to the general public, I decided to try and fulfill my childhood dream and create a “remake” of the old game called B-Hunter, which I used to like a lot – happily there is no more need to spent enormous amount of time trying to create a complete game engine from scratch, so the idea became more realistic than ever. The UDK happened to be not as scary as it was described. This is what I’ve got after a couple of hours in Notepad++ and 3ds max since the time of installation:

    The physics of the flying jet has been implemented in a custom PlayerController. Special logic has been added to add inertion to rotation, adjust acceleration depending on the vertical angle of the hover jet. I’ve re-created the physics based on my experience from playing the original B-Hunter game. It’s still not perfect, but is somewhat close.

    However, as soon as it came to collision processing, I’ve faced a problem which I wasn’t able to solve so far: upon collision with buildings and the ground the engine didn’t call any callbacks which, according to the documentation, were somehow related to collision processing – like HitWall, Touch, Bump etc. Collisions with in-game items (like weapons), called Actors, and only some of the walls, however did trigger these events. I wasn’t able to get a meaningful response about this problem on the Epic Games Forums and the development has been suspended. If you have ever faced similar problem please tell me how did you manage to solve it.

    class BHPlayerController extends PlayerController;
    
    var Rotator LastDeltaRot;
    
    var const float MaxPitch;
    var float Pitch;
    
    defaultproperties
    {
            CameraClass=class'BHunter.BHPlayerCamera'
    		Name='Default__BHPlayerController'
    		
    		MaxPitch = 16384.0;
    }
    
    function EnterStartState()
    {
        GotoState('PlayerFlying');
    }
    
    state PlayerFlying
    {
    ignores SeePlayer, HearNoise, Bump;	
    	
    	function PlayerMove(float DeltaTime)
    	{
    		local vector X,Y,Z;		
    
    		GetAxes(Rotation,X,Y,Z);		
    
    		// Apply throttle acceleration (player input)
    		Pawn.Acceleration = PlayerInput.aForward * X + PlayerInput.aStrafe * Y + PlayerInput.aUp * vect(0,0,1);
    		Pawn.Acceleration = Pawn.AccelRate * Normal(Pawn.Acceleration);
    		
    		// Allow to control the pawn in free flight
    		Pawn.Velocity = X * VSize(Pawn.Velocity);
    		
    		// Angle of attack may create (or reduce) acceleration
    		if (Rotation.Pitch > 32768)
    			Pitch = (65535 - Rotation.Pitch) / MaxPitch;
    		else
    			Pitch = -Rotation.Pitch / MaxPitch;
    
    		// Apply acceleration change
    		Pawn.Acceleration += Pitch * (Pawn.AccelRate / 2) * X;
    
    		// Update rotation
    		UpdateRotation(DeltaTime);		
    
    		if (Role < ROLE_Authority)
    			ReplicateMove(DeltaTime, Pawn.Acceleration, DCLICK_None, rot(0,0,0));
    		else
    			ProcessMove(DeltaTime, Pawn.Acceleration, DCLICK_None, rot(0,0,0));
    	}
    
    	event BeginState(Name PreviousStateName)
    	{
    		Pawn.SetPhysics(PHYS_Flying);
    	}
    }
    
    function UpdateRotation( float DeltaTime )
    {
    	local Rotator DeltaRot, newRotation, ViewRotation;
    	local Rotator PlayerRot;
    
    	ViewRotation = Rotation;
    	if (Pawn != None)
    	{
    		Pawn.SetDesiredRotation(ViewRotation);
    	}
    
    	// Calculate Delta to be applied on ViewRotation
    	PlayerRot.Yaw	= PlayerInput.aTurn;
    	PlayerRot.Pitch	= PlayerInput.aLookUp;
    	
    	lastDeltaRot.Yaw *= 0.99;
    	lastDeltaRot.Pitch *= 0.99;	
    	
    	DeltaRot = PlayerRot + lastDeltaRot;	
    	lastDeltaRot += PlayerRot / 2;
    
    	ProcessViewRotation(DeltaTime, ViewRotation, DeltaRot);
    	SetRotation(ViewRotation);
    
    	ViewShake(deltaTime);
    
    	NewRotation = ViewRotation;
    	NewRotation.Roll = Rotation.Roll;
    
    	if (Pawn != None)
    		Pawn.FaceRotation(NewRotation, deltatime);
    }
  • Hi-Fi Phono Preamp (RIAA)

    Posted on April 27th, 2010 evilgenius No comments

    Recently I’ve decided to make digital copies of my old vinyl records, but the quality of the amplifier in my turntable was far from being good for that purpose, so I thought about throwing the old amplifier board away and replacing it with a new high-quality one. After spending long time reading various articles and reviewing various schematics on the internet I’ve found a really good and clear amplifier design, but unfortunately there was no PCB image provided along with the shematic, and the only option available on the website was to purchase a manufactured PCB. Though the website and the design were really good I decided that I want to try the preamp first before buying, and after several hours of staring into a couple of low-res photos of the assembled PCB I was able to almost completely recreate the original PCB (as seen from the top side at lest, and excluding a couple of capacitors which were not in the schematic and probably are just bypass capacitors anyway).

    The original design by Rod Elliott can be found here: http://sound.westhost.com/project06.htm. You may find many other very interesting projects there, including the power supply suitable for this preamplifier.

  • The sound of Elton John’s concert grand piano

    Posted on October 10th, 2009 evilgenius No comments

    The main component forming the unique sound of Elton’s concert grand is still a Roland MKS20 module, a widely used in 80-s rack-mounted version of the RD1000 piano, which Elton played these years, because amplification of the clean acoustic sound of his grand piano was causing feedback due to the volume of Elton’s monitors. In addition to this bright digital piano module having 8 different programs (3 piano, 2 EP and some others), there are 2 Motif Rack tone generators in the Elton’s piano rack, which add a mixture of different acoustic and electric piano sounds to the MKS20. The Technics WSA1R module is used to beef up electric piano used on Philadelphia Freedom and Daniel (EP2 and EP1 patches from the MKS20 respectively). The final touch is added by the microphones inside of the Elton’s acoustic grand Yamaha DCFIIISPRO.

    Summary:

    • Roland MKS-20 – the programs used are the Piano 1 and both EPs (for Daniel and Philadelphia Freedom).
    • Yamaha Motif Rack – using the PowerGrand program, as well as other patches like layered strings.
    • Technics WSA1R – the exact setup is not known.
    • Yamaha DCFIIISPRO – the acoustic grand is miked to to colour the tone of the modules rather than be the core sound.
  • Chords for video “How to play Sorry Seems to Be The Hardest Word”

    Posted on September 24th, 2009 evilgenius No comments

    These are the chords I am playing in the video. My piano was transposed to -4 semitones,
    so if you’ll play them on a normal piano it will sound higher.

    Intro:
    Am/G | Am/F# | Am/F | Am/E | Am | Dm | Dm/B | E7(13)

    Verse, 1st part (“…to make you love me?”):
    Am | Am/G | Dm -> Dm7 | G -> G7 | C | D7 | E7 | Am7

    Verse, 2nd part (“…to make you want me”):
    Am | Am/G | Dm -> Dm7 | G -> G7 | C | G/B

    Refrain, 1st part:
    F | E | Am | Am/G | F | E | Am | D7 | E7

    Refrain, 2nd part (“oh, it seems to me”):
    F | E | Am | Am/G | F | Em | Dm | E | Am

    Instumental:
    Am | Dm | Dm/C | G | C | Dm | E7 | Am | Dm | G | C | C/B
    (goto Refrain, part 1).

    These chords are just a guideline for your own enhancements and experiments, they are absolutely not a “must”.

  • A software MIDI-conductor

    Posted on September 24th, 2009 evilgenius No comments

    In the process of learning of different excerpts from Rachmaninoff’s Piano concerts I’ve got an idea to create a software-based MIDI conductor, which could (given an input MIDI file) softly adapt the tempo of the orchestra to the tempo of a solo instrument (piano). This would make it easier for the live performer to keep in time with the orchestra while not maintaining a very precise tempo.

    The idea has been implemented in an open source program running under Linux. You need to give it a MIDI file, specify a track to use for solo instrument and a MIDI device to listen your perfomance on and it will do the rest of the magic.

    A demonstration of the program in action is available below. During the performance I change my tempo on purpose to show you how the orchestra will handle it.


    (The recording was made in 2007)

    Known issues: in this prototype implementation the “conductor” doesn’t know what is going to be played by the solo instrument in the near future. That’s why if you accidentially skip even just a single note from your part, the orchestra will immediately stop and wait for it to be played. Instead, it should detect that the performer has gone into the “future” and resyncronize the orchestra with him.

    Download the source code