![]() |
| | #1 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,929
| New years challenge! You cant use a table of values. You have to calculate the next note and duration through some algorithm. You can obviously use the Beep() in a loop to play the notes. Happy Holidays and good luck
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet |
| abachler is offline | |
| | #2 |
| Chinese pâté Join Date: Jul 2007 Location: Canada
Posts: 406
| This looks hard. By the way, in which header file is Beep defined ? I don't find it in the standard header files, only find it in <windows.h>... huh. Help me |
| foxman is offline | |
| | #5 |
| Deathray Engineer Join Date: Mar 2007
Posts: 3,211
| Hope I picked a song that is allowed. Easy note arrangement.
__________________ |
| MacGyver is offline | |
| | #6 |
| Wheres the lesbians? Join Date: Oct 2006 Location: UK
Posts: 1,219
| An ASM only challenge on a C board is just stupid. Why don't we do it in Malbolge? Makes no difference to me o_0 |
| mike_g is offline | |
| | #7 | |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,929
| Quote:
Beep() is in <windows.h> Sorry I dont knowlinux well enough to suggest a similar function there. Song selection will play a role in the contest, since different techniques may be more suitable to some songs than others.
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet Last edited by abachler; 12-24-2007 at 09:35 AM. | |
| abachler is offline | |
| | #8 |
| Wheres the lesbians? Join Date: Oct 2006 Location: UK
Posts: 1,219
| Well I guess I 2 noob. I might have had a go in C, but have fun all the same ![]() Or can we post code after compiler optimization? |
| mike_g is offline | |
| | #9 |
| Chinese pâté Join Date: Jul 2007 Location: Canada
Posts: 406
| Anyway, i believe the hard part of this challenge isn't about the fact it has to be written in assembly, but that you need to find some sort of "algorithm" to calculate the next note and duration. This is what i believe the tricky part, i don't really have any idea and/or enough knowledge to think of something who could achieve this for something as complex as a song. But the term "algorithm" is rather large and incrementing an index and looking in a table is an algorithm... Anyway. I guess only "IA-32 assembly" will be accepted, right ? |
| foxman is offline | |
| | #10 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,929
| As long as the assembly is from code you wrote, this is acceptable. I know looking into a table is an algorithm, but thats just way too easy. Finding a function that produces values you use is a bit more of a challenge, and is of course the interesting part of the contest. Ill give you a hint on a way to solve it on the 26th if noone has made an entry or suggested another means.
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet |
| abachler is offline | |
| | #12 |
| and the Hat of Clumsiness Join Date: Oct 2002
Posts: 1,101
| This is how I would do this: ( probably not the best way but still ). See the song as a function with a period T (which is the duration of the song). Now use fourier ... ( I would actually define the function in maple, piecewise, then let maple do its magic and go for n=1 to n=1000). Then take this function, write it in assembler using some sort of lookup table for the sin and cosine. Afterwards, for the minimal amount of time a note is being played for instance 0.1 second, step trough the function (the mathematical expression), round to the nearest reall note which is also defined somewhere... and output using beep. Its not a lookup method , unless you say that the function actually is a lookup table or something... but then again, every piece algorithm can be defined in that way.... ::edit:: Thinking about this, it would actually take quite some time to determine the fourier approximation.... On the other hand the objective; using an algorithm can easily be done, by just substracting, adding, division etc of the start note its frequency..., of course this would result in something quite big (depending how many notes te be played but still). Then the question is again what is an algorithm, it would be more specific if you would say , write a method, that takes as input the note to start with for this or this song, depending on this note, shift the complete tone of the song one up or one down or whatever... then it would require something more complicated (taking into account you can not use lookup tables). Anyhow, im not competing in this in any way just wanted to spill my thoughts on it . Last edited by GanglyLamb; 12-25-2007 at 08:47 AM. |
| GanglyLamb is offline | |
| | #13 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,929
| If you plan to sit at your computer 24 hours a day for several days in the hopes of doing that at exactly the moment I decide to run your entry and in the hopes that I run it on a computer with an internet connection instead of a hardened system, well, be my guest. Now I promised a clue as to one method of doing this, so here goes. X = (X * K) MOD P Ill provide another hint tomorrow. Remember, the method im hinting at is only one of many that will work.
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet Last edited by abachler; 12-26-2007 at 09:03 AM. |
| abachler is offline | |
| | #14 |
| Registered User Join Date: Jun 2005 Location: New York
Posts: 1,465
| Without supreme cleverness, I can't see how to do this. Option I see is to basically encode the song into a discrete fourier transform, which is not far from a mere table of values. This doesn't make any sense X = (X * K) MOD P X = 5, K = 2, P = 3 Like what? Is that not a mathematical equation in the traditional sense? Rather a sequence X sub N = (X sub N-1 * K) MOD P?
__________________ ╔╗╔╦══╦╗╔╦══╦╗ ║╚╝║╔╗║╚╝║╔╗║║ ║╔╗║╠╣║╔╗║╠╣╠╣ ╚╝╚╩╝╚╩╝╚╩╝╚╩╝ codez http://code.google.com/p/zxcvbn/ |
| Tonto is offline | |
| | #15 |
| Banned Join Date: Nov 2007
Posts: 678
| why it has to be in assembly? |
| manav is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Delete Files Older than 2 years | Dragoon_42 | C++ Programming | 10 | 05-17-2007 04:13 PM |
| Converting seconds to years, months etc... | ^xor | C Programming | 7 | 08-06-2005 11:30 PM |
| Where will programming be in 30 years ? | mrpickle | A Brief History of Cprogramming.com | 27 | 01-08-2004 05:42 AM |
| Requesting a challenge | RealityFusion | C++ Programming | 8 | 08-18-2003 08:24 PM |
| Video Games Industry. 5 years left. | ethic | A Brief History of Cprogramming.com | 26 | 12-10-2002 10:52 PM |