Jump to content

BlowMe

Active Members
  • Posts

    33
  • Joined

  • Last visited

Recent Profile Visitors

1,395 profile views

BlowMe's Achievements

Newbie

Newbie (1/14)

  1. You can get a better effect using sine waves. Heres an example stolen from the Hacker Voice forums #include <stdio.h> #include <math.h> #include <malloc.h> #ifndef DBL_EPSILON /* Difference between 1.0 and the minimum double greater than 1.0 */ #define DBL_EPSILON 2.2204460492503131e-16 #endif int writesamples(char *filename, short *samptable, int samples) { FILE *f1; f1 = fopen(filename, "wb"); fwrite(samptable, sizeof(short), samples, f1); return fclose(f1); } double makesinetable(float *sinetable) { const double pi = (4.0 * atan(1.0)); double angle_rad, desiredpeak, inputpeak; int i, angle = 0; float value; // Create the sine table while(angle <= 360){ angle_rad = (pi * (angle / 180.0)); value = sin(angle_rad); sinetable[(angle - 1)] = value; angle++; } inputpeak = 0.0; for(i = 0; i < 360; i++) if(sinetable[i] > inputpeak) inputpeak = sinetable[i]; desiredpeak = 32767.0; return ((desiredpeak / inputpeak) + DBL_EPSILON); } void samplefloats(float *sinetable, short *samptable, int samples, double factor) { double dSample; int nSample, i; for(i = 0; i < samples; i++){ dSample = ((double)sinetable[i] * factor); nSample = (int)dSample; if(nSample < -32767) nSample = -32767; else if(nSample > 32767) nSample = 32767; samptable[i] = (short)nSample; } } int main(void) { float *sinetable; short *samptable; double factor; printf("rawsine16.c"); printf("=================\n"); printf(" MAKE A SINE WAVE \n"); printf("=================\n"); sinetable = malloc(360 * sizeof(float)); samptable = malloc(360 * sizeof(short)); factor = makesinetable(sinetable); samplefloats(sinetable, samptable, 360, factor); writesamples("thing16bit.raw", samptable, 360); free(samptable); free(sinetable); return 0; } personally, I've never played with it in C/C++, but i've made a whole lot of interesting sounds using the same technique in python, its all very fun. I did have a link to a page describing the technique used to create sounds using the .wav file format and sine waves, but unfortunately it seems to be 404'ing now. If anyone has any further information of this subject it would be great to see it shared. James
  2. Yeh, we used the CSV from that site, like I said, TomB modified it a lot, if you download the package you can see what he did. If you write one in PHP, I wouldn't mind taking a look. Thanks James
  3. Is this in th original code you did? or arrans modification?
  4. Thanks for adding the command line argument, that makes it a lot nicer. I never got a problem with EmptyLinkedList() when I compiled with minGW on windows, or gcc on linux but I'll take another look. I know ip-to-country.txt is pretty big, but since I already had it in an (almost) usable format (TomB had to make some changes) I thought I would just use it. Basically like I said, this application was made purely for learning purposes, but thanks for the changes, you taught me some stuff.
  5. I might go for the lulz. But to be honest, I don't give a flying fuck about Scientology.
  6. A little while ago I decided to make an program that would trace an IP to the country it originated from. After finding a CSV file of IP Number ranges and their corresponding countries I got to work, with out much luck. After talking to TomB about it for a while, he decided to give me a pretty in-depth (at least for me) tutorial on aspects of C and C++ like linked lists and text phrasing. The result of this tutorial is this app: Download Source Code sorry about the lack of comments, everything I need is in chat logs. Its not too hard to work out though. The code isn't really mine, so as far as I am concerned do as you will unless TomB says otherwise.
  7. On Ubuntu now. Clean: Full Size: http://jamesbowden.com/~james/images/scree...gnome_clean.png Busy Full Size: http://jamesbowden.com/~james/images/scree.../gnome_busy.png
  8. Using windows for now. Doesn't look that good but I like it. Clean: Full Size: http://jamesbowden.com/~james/images/scree...ndows_clean.png Busy Full Size: http://jamesbowden.com/~james/images/scree...indows_busy.png
  9. lol, its looks kinda like a pokemon =P Its cool though, nice one.
  10. I think me and some friends might go just for a laugh, its basically local for me so travel is no issue. If there is a group of Hak.5 fans meeting up I would be happy join in. Just tell me where and when.
  11. So just a kernel... wow... http://en.wikipedia.org/wiki/Kernel_%28computer_science%29 the topic is #1 tool, therefore its a valid answer, can't boot an OS without the kernel, I know you can't do much with just the kernel, but at least you can boot. I mean, what boot would all these lovely tools be without one.
  12. *Rolls*... *rolling*... *tears*,,, *laughing* whats so funny?
  13. Ok, here is ReactOS (same version Moonlit posted) and I will post Visopsys: version from boot:
  14. I RELY hate this desktop background. =/
×
×
  • Create New...