Monday, 27 April 2015

Working with MIDI files

A quick post.
MIDI files refers to Musical Instrument Digital Interface files and are generally used for generating really small files for sound, whose aspects can be easily edited. It is a real pleasure working with this file format, more so since it can be used to create music without the need for different musicians and/or instruments. 
However, the format depends highly on the sound card of the system and it can not store vocals.

A pressing point however is the usage of the interface for this file type.

One can use timidity for such a purpose :
sudo apt-get install timidity timidity-interfaces-extra  
timidity <filename.midi>
timidity -ig <filename.midi>  [For GUI version of the same] 
Enjoy working with it!! Cheers!!!

Monday, 30 March 2015

[Nightout at forest] Trekking expedition gone awry

[28 March, 2015; 1:00 am]
I check the webmail and was pleasantly surprised to see a 4-6 hour trekking expedition planned out at 5:30 am the same day. Pumped up with joy, I decided to go with it. Who could have guessed the trek would be so much more than just a trekking expedition?

In the blink of an eye, the few hours roll by. Oh good Lord, it was raining quite heavily! My heart did skip a beat at the awful thought of the trek getting cancelled. But hey, were we lucky we still decided to go ahead with the expedition! :)

Semi-drenched in the heavy rain, we assemble at the faculty gate of the campus. Packed with 3 litres of water, some dry-fruits, bananas, milk, and chocolates; the backpacks sure felt heavy. We finally set onto the expedition.

We board a vehicle and reach the Basistha temple located some 31 km away from the campus. We are joined by our guide, a profession adventure enthusiast who has done search-and-rescue course in NIM. The entire team now comprised of 19 students, a Professor and the guide. A briefing on the practices of tackling dangers in forest, detecting danger using the wind direction, and loads of other instructions were imparted by the sagely guide. Who could have guessed, they would actually be put to use the same day!

Thus we began the 25 kilometre trek into the woods of Garbhanga Reserve Forest which is populated thickly with wild elephants, leopards and varied species of butterflies. Just a few metres into the trek and we had to wade through muddy landmasses. It was quite a sight embracing mother nature and the raw beauty. An hour and a half passes by walking in a single file along the narrow forest trail. Since a majority of the trekkers were first timers; we had to stop to take frequent breaks. We realized the 4-6 hour time span would be easily overshot. It was already 10:30 am in the morning. An hour later we stopped at a hamlet and had the fruits and plenty of fluids. We met some very hard-working villagers and it was quite a relaxing moment!

The forest trail started getting  really steep, and we were in fatigue. But then we were overjoyed to see a tree-house. Since it is really rare to encounter them in wilderness, some of us decided to climb the rickety, shaky, weak structure. A good 45 minutes later we resumed on our trek. The view of the scattered farming spots and the sight of butterflies was heartening to the tired bodies.

At 2 pm, we took a small meal of snacks and decided to complete the trek by sunset. Boy oh boy, we starting picking up pace so much so that were almost running along the forest-trail. The guide had infused into us the fear of encountering herd of wild elephants which are notorious for killing humans on multiple occasions.

The dry trail turned into a slippery one; many a times we would skid and slip along the path. The sight of a rivulet along the path was soothing but scary; since the elephants are sighted more often along water-bodies. But it soon became dark and we could hardly walk along the muddy slippery path. However we mustered on at the same pace.

"SNAP!" Wait! What was that?

Did we just hear bamboo breaking? It was dark already. Since we were close to half-an-hour from completing the trek; we wanted to reach the campus at the earliest, but did we just hear a herd of wild elephants along the path? We simply retraced out steps and ran! There was quite some panic!

We assembled dry leaves, bamboos, and cut up trees to fuel the fire. The crackling fire would hopefully scare the elephant(s) away from us. We climbed up some steep highland along the trail and devised strategies as and when the elephants come from certain directions. Everyone was so pro-active. We made a small bonfire, some were making sure the fire does not die out, some tied ropes to pull others up in case they are chased by elephants, and some were on the lookout for any movements or sounds.

It was all in a jiffy. Our supplies were up. The few drops of water left with us were shared across the team. It was quite a feeling. Cold, hunger, fear and weariness rolled in. We could not contact anyone in the outside world, as there was no telecom connection over there. And then while cutting wood, someone realized the signal of mobile was back. Everyone hoarded over there and started sending message to the security officials of IIT. But, it was only at 11:30 pm that one message finally got delivered.

Inspite of the breaking signal, with will-power we kept up the communication; while the fire was all bright and roaring with the constant input of the team members. But then, it started drizzling, and we were really scared at the thought of the bonfire dying out. It was a dark hour.

Midnight struck! I had turned 21!
People offered me the few chocolate pieces they had as a celebration! It sure was heartening! :) But, the fear of getting attacked by elephants and losing life at my birthday was traumatizing nevertheless!

The insects were causing a lot of trouble. It was already 2:30 am. And we had decided to have a night-out and escape in the morning when the elephants go back to their slumber.

Hey, wait! Was it a vehicle? The sound kept on increasing. Much to our respite, the forest officials had reached the forest! Were we actually being rescued?

It was a whole 10 minutes when the police located us. After a head-count the DSP congratulated us on getting rescued. Hardly had we sat in the vehicles that we all dozed off! Some minutes later it started raining cats-and-dogs. Had the police been some minutes late, the fire would have died off!
We later realized the trek would have taken just 30-40 more minutes had we not heard the sound of the probable herd of elephants!

Once we reached the police station, we were sent back to campus. The presence of police and IITG security was such a blissful experience, it can not be described in words. They simply can not be thanked enough!.

By 5 am we reached the campus and the majority of us simply fell asleep hungry.
We learnt lighting fires, reading danger signals in forest, cutting wood, enjoying mother nature and developed such a deep bonding amongst us! :)
The tired souls had been in a real adventure! It surely was an experience of a lifetime! :)

P.S. A day later the students were thrown a party by the Professor for the composure; and we celebrated the day to our full since we all were safe and sound!
            With loaded enthusiasm, we now intend to reach the base camp of the world's third highest mountain Mt. Kanchenjunga; famously regarded as the Goecha la trek. It is at a height of roughly 5000 metres in Sikkim.  These fitness treks would definitely serve the purpose! :)

Some memories of the trek :

Wednesday, 4 February 2015


This post is a re-blogging of a piece of work of the great Russian short-story writer Anton Chekhov. The twist and insight of reading this story is so wonderful that one can not help but read this once in a while.

                                             THE BET

It was a dark autumn night. The old banker was walking up and down his study and remembering how, fifteen years before, he had given a party one autumn evening. There had been many clever men there, and there had been interesting conversations. Among other things they had talked of capital punishment. The majority of the guests, among whom were many journalists and intellectual men, disapproved of the death penalty. They considered that form of punishment out of date, immoral, and unsuitable for Christian States. In the opinion of some of them the death penalty ought to be replaced everywhere by imprisonment for life. "I don't agree with you," said their host the banker. "I have not tried either the death penalty or imprisonment for life, but if one may judge a priori, the death penalty is more moral and more humane than imprisonment for life. Capital punishment kills a man at once, but lifelong imprisonment kills him slowly. Which executioner is the more humane, he who kills you in a few minutes or he who drags the life out of you in the course of many years?"
     "Both are equally immoral," observed one of the guests, "for they both have the same object - to take away life. The State is not God. It has not the right to take away what it cannot restore when it wants to."
     Among the guests was a young lawyer, a young man of five-and-twenty. When he was asked his opinion, he said:
     "The death sentence and the life sentence are equally immoral, but if I had to choose between the death penalty and imprisonment for life, I would certainly choose the second. To live anyhow is better than not at all."
     A lively discussion arose. The banker, who was younger and more nervous in those days, was suddenly carried away by excitement; he struck the table with his fist and shouted at the young man:
     "It's not true! I'll bet you two million you wouldn't stay in solitary confinement for five years."
     "If you mean that in earnest," said the young man, "I'll take the bet, but I would stay not five but fifteen years."

     "Fifteen? Done!" cried the banker. "Gentlemen, I stake two million!"
     "Agreed! You stake your millions and I stake my freedom!" said the young man.
     And this wild, senseless bet was carried out! The banker, spoilt and frivolous, with millions beyond his reckoning, was delighted at the bet. At supper he made fun of the young man, and said:
     "Think better of it, young man, while there is still time. To me two million is a trifle, but you are losing three or four of the best years of your life. I say three or four, because you won't stay longer. Don't forget either, you unhappy man, that voluntary confinement is a great deal harder to bear than compulsory. The thought that you have the right to step out in liberty at any moment will poison your whole existence in prison. I am sorry for you."
     And now the banker, walking to and fro, remembered all this, and asked himself: "What was the object of that bet? What is the good of that man's losing fifteen years of his life and my throwing away two million? Can it prove that the death penalty is better or worse than imprisonment for life? No, no. It was all nonsensical and meaningless. On my part it was the caprice of a pampered man, and on his part simple greed for money ..."
     Then he remembered what followed that evening. It was decided that the young man should spend the years of his captivity under the strictest supervision in one of the lodges in the banker's garden. It was agreed that for fifteen years he should not be free to cross the threshold of the lodge, to see human beings, to hear the human voice, or to receive letters and newspapers. He was allowed to have a musical instrument and books, and was allowed to write letters, to drink wine, and to smoke. By the terms of the agreement, the only relations he could have with the outer world were by a little window made purposely for that object. He might have anything he wanted - books, music, wine, and so on - in any quantity he desired by writing an order, but could only receive them through the window. The agreement provided for every detail and every trifle that would make his imprisonment strictly solitary, and bound the young man to stay there exactly fifteen years, beginning from twelve o'clock of November 14, 1870, and ending at twelve o'clock of November 14, 1885. The slightest attempt on his part to break the conditions, if only two minutes before the end, released the banker from the obligation to pay him the two million.

     For the first year of his confinement, as far as one could judge from his brief notes, the prisoner suffered severely from loneliness and depression. The sounds of the piano could be heard continually day and night from his lodge. He refused wine and tobacco. Wine, he wrote, excites the desires, and desires are the worst foes of the prisoner; and besides, nothing could be more dreary than drinking good wine and seeing no one. And tobacco spoilt the air of his room. In the first year the books he sent for were principally of a light character; novels with a complicated love plot, sensational and fantastic stories, and so on.
     In the second year the piano was silent in the lodge, and the prisoner asked only for the classics. In the fifth year music was audible again, and the prisoner asked for wine. Those who watched him through the window said that all that year he spent doing nothing but eating and drinking and lying on his bed, frequently yawning and angrily talking to himself. He did not read books. Sometimes at night he would sit down to write; he would spend hours writing, and in the morning tear up all that he had written. More than once he could be heard crying.
     In the second half of the sixth year the prisoner began zealously studying languages, philosophy, and history. He threw himself eagerly into these studies - so much so that the banker had enough to do to get him the books he ordered. In the course of four years some six hundred volumes were procured at his request. It was during this period that the banker received the following letter from his prisoner:
     "My dear Jailer, I write you these lines in six languages. Show them to people who know the languages. Let them read them. If they find not one mistake I implore you to fire a shot in the garden. That shot will show me that my efforts have not been thrown away. The geniuses of all ages and of all lands speak different languages, but the same flame burns in them all. Oh, if you only knew what unearthly happiness my soul feels now from being able to understand them!" The prisoner's desire was fulfilled. The banker ordered two shots to be fired in the garden.

     Then after the tenth year, the prisoner sat immovably at the table and read nothing but the Gospel. It seemed strange to the banker that a man who in four years had mastered six hundred learned volumes should waste nearly a year over one thin book easy of comprehension. Theology and histories of religion followed the Gospels.
     In the last two years of his confinement the prisoner read an immense quantity of books quite indiscriminately. At one time he was busy with the natural sciences, then he would ask for Byron or Shakespeare. There were notes in which he demanded at the same time books on chemistry, and a manual of medicine, and a novel, and some treatise on philosophy or theology. His reading suggested a man swimming in the sea among the wreckage of his ship, and trying to save his life by greedily clutching first at one spar and then at another.

The old banker remembered all this, and thought:
     "To-morrow at twelve o'clock he will regain his freedom. By our agreement I ought to pay him two million. If I do pay him, it is all over with me: I shall be utterly ruined."
     Fifteen years before, his millions had been beyond his reckoning; now he was afraid to ask himself which were greater, his debts or his assets. Desperate gambling on the Stock Exchange, wild speculation and the excitability whic h he could not get over even in advancing years, had by degrees led to the decline of his fortune and the proud, fearless, self-confident millionaire had become a banker of middling rank, trembling at every rise and fall in his investments. "Cursed bet!" muttered the old man, clutching his head in despair "Why didn't the man die? He is only forty now. He will take my last penny from me, he will marry, will enjoy life, will gamble on the Exchange; while I shall look at him with envy like a beggar, and hear from him every day the same sentence: 'I am indebted to you for the happiness of my life, let me help you!' No, it is too much! The one means of being saved from bankruptcy and disgrace is the death of that man!"

     It struck three o'clock, the banker listened; everyone was asleep in the house and nothing could be heard outside but the rustling of the chilled trees. Trying to make no noise, he took from a fireproof safe the key of the door which had not been opened for fifteen years, put on his overcoat, and went out of the house.
     It was dark and cold in the garden. Rain was falling. A damp cutting wind was racing about the garden, howling and giving the trees no rest. The banker strained his eyes, but could see neither the earth nor the white statues, nor the lodge, nor the trees. Going to the spot where the lodge stood, he twice called the watchman. No answer followed. Evidently the watchman had sought shelter from the weather, and was now asleep somewhere either in the kitchen or in the greenhouse.
     "If I had the pluck to carry out my intention," thought the old man, "Suspicion would fall first upon the watchman."
     He felt in the darkness for the steps and the door, and went into the entry of the lodge. Then he groped his way into a little passage and lighted a match. There was not a soul there. There was a bedstead with no bedding on it, and in the corner there was a dark cast-iron stove. The seals on the door leading to the prisoner's rooms were intact.
     When the match went out the old man, trembling with emotion, peeped through the little window. A candle was burning dimly in the prisoner's room. He was sitting at the table. Nothing could be seen but his back, the hair on his head, and his hands. Open books were lying on the table, on the two easy-chairs, and on the carpet near the table.
     Five minutes passed and the prisoner did not once stir. Fifteen years' imprisonment had taught him to sit still. The banker tapped at the window with his finger, and the prisoner made no movement whatever in response. Then the banker cautiously broke the seals off the door and put the key in the keyhole. The rusty lock gave a grating sound and the door creaked. The banker expected to hear at once footsteps and a cry of astonishment, but three minutes passed and it was as quiet as ever in the room. He made up his mind to go in.

     At the table a man unlike ordinary people was sitting motionless. He was a skeleton with the skin drawn tight over his bones, with long curls like a woman's and a shaggy beard. His face was yellow with an earthy tint in it, his cheeks were hollow, his back long and narrow, and the hand on which his shaggy head was propped was so thin and delicate that it was dreadful to look at it. His hair was already streaked with silver, and seeing his emaciated, aged-looking face, no one would have believed that he was only forty. He was asleep ... In front of his bowed head there lay on the table a sheet of paper on which there was something written in fine handwriting.
     "Poor creature!" thought the banker, "he is asleep and most likely dreaming of the millions. And I have only to take this half-dead man, throw him on the bed, stifle him a little with the pillow, and the most conscientious expert would find no sign of a violent death. But let us first read what he has written here ... "
     The banker took the page from the table and read as follows:
     "To-morrow at twelve o'clock I regain my freedom and the right to associate with other men, but before I leave this room and see the sunshine, I think it necessary to say a few words to you. With a clear conscience I tell you, as before God, who beholds me, that I despise freedom and life and health, and all that in your books is called the good things of the world.
     "For fifteen years I have been intently studying earthly life. It is true I have not seen the earth nor men, but in your books I have drunk fragrant wine, I have sung songs, I have hunted stags and wild boars in the forests, have loved women ... Beauties as ethereal as clouds, created by the magic of your poets and geniuses, have visited me at night, and have whispered in my ears wonderful tales that have set my brain in a whirl. In your books I have climbed to the peaks of Elburz and Mont Blanc, and from there I have seen the sun rise and have watched it at evening flood the sky, the ocean, and the mountain-tops with gold and crimson. I have watched from there the lightning flashing over my head and cleaving the storm-clouds. I have seen green forests, fields, rivers, lakes, towns. I have heard the singing of the sirens, and the strains of the shepherds' pipes; I have touched the wings of comely devils who flew down to converse with me of God ... In your books I have flung myself into the bottomless pit, performed miracles, slain, burned towns, preached new religions, conquered whole kingdoms ...

     "Your books have given me wisdom. All that the unresting thought of man has created in the ages is compressed into a small compass in my brain. I know that I am wiser than all of you.
     "And I despise your books, I despise wisdom and the blessings of this world. It is all worthless, fleeting, illusory, and deceptive, like a mirage. You may be proud, wise, and fine, but death will wipe you off the face of the earth as though you were no more than mice burrowing under the floor, and your posterity, your history, your immortal geniuses will burn or freeze together with the earthly globe.
     "You have lost your reason and taken the wrong path. You have taken lies for truth, and hideousness for beauty. You would marvel if, owing to strange events of some sorts, frogs and lizards suddenly grew on apple and orange trees instead of fruit, or if roses began to smell like a sweating horse; so I marvel at you who exchange heaven for earth. I don't want to understand you.
     "To prove to you in action how I despise all that you live by, I renounce the two million of which I once dreamed as of paradise and which now I despise. To deprive myself of the right to the money I shall go out from here five hours before the time fixed, and so break the compact ..."
     When the banker had read this he laid the page on the table, kissed the strange man on the head, and went out of the lodge, weeping. At no other time, even when he had lost heavily on the Stock Exchange, had he felt so great a contempt for himself. When he got home he lay on his bed, but his tears and emotion kept him for hours from sleeping.
     Next morning the watchmen ran in with pale faces, and told him they had seen the man who lived in the lodge climb out of the window into the garden, go to the gate, and disappear. The banker went at once with the servants to the lodge and made sure of the flight of his prisoner. To avoid arousing unnecessary talk, he took from the table the writing in which the millions were renounced, and when he got home locked it up in the fireproof safe.