Creating music in one line of C code


Note: Please read the movie description if you like to learn how this program works. Note: Please read the movie description if you like to learn how this program works.

46 thoughts on “Creating music in one line of C code

  1. Should already work just fine if you compile it as C (not C++). However, it outputs the audio into stdout. You will need to redirect it into either an audio file or a device driver that feeds on audio data and produces sound. I am not aware of anyone writing the latter for DOS.

  2. Anyone with rudimentary programming knowledge and good command at their programming language of choice can do stuff like this. A specific task may require task-specific knowledge (which you can acquire by studying it), such as the creating of some actual music in this case requires knowledge of how PCM sound works.

  3. Hey. sir Bisqwit. do you have a tutorials about creating music using programming C? or anything. I need the concept for my thesis… or codes….. just little codes or something that I can learn about.
    thanks………

  4. Is this Bytebeat? I thought that Bytebeat dates only on September 2011.
    Also, it's a bit strange because the song is actually made in October 22, 1999 instead of September 18, 2011…

  5. there is no way i am going to understanding this. like rest of this channel. or coding in general. or life.

  6. I found this really insteresting an i wanted to test it. But when i run the program it pop's me up a message in the linux notifications "bell in session" but i cant hear the music. Do i have to do something to enable the sound? or im doing something wrong?

  7. This still works today
    you just need to pipe it into "aplay" on linux
    Here's the typed version

    main(C, f, s, o, k){for(C=0;;++C,C&=63){for(k=o=f=99;k–;"057+5420"[C/8]>k?o=o*89/84:f)"+%7%+%7%5%4%2%457%0%0%754%2%+%%%5%542%457%0%0%042%2#+%!#0%+%$%%%"[C]>k&&(f=f*89/84);for(s=999+99*(C&2);s–;putchar(s*((776-f?s*f&32767:k)+(C&2?s*o/2&32767:k))/299999));}}

  8. I would like to make this code work on Apple (which unfortunately doesn't till now). In fact, I learned how to write bash codes and now I want to convert notes or integers into some kind of midi file.

  9. Do you mind if I share this video with a certain content creator I watch? His channel is GARDNSOUND and he frequently livestreams his reaction to music, mostly underground, indie or unreleased music, sometimes made by fans and sometimes by others, the music suggestions are from fan submissions. It would be great to see his reaction to something like this!

  10. Nowadays linux does not give direct access to /dev/audio , use this command instead -> ./a.out | padsp tee /dev/audio > /dev/null

  11. main(C,f,s,o,k){for(C=0;;++C,C&=63){for(k=0=f=99;k–;"057+5420"[C/8]>k?o=o*89/84:f)"+%7%+%7%5%4%2%457%0%0%""754%754%2%+%%%5%542%457%0%0%042%2#+%!#0%+""%$%%%"[C]>k&&(f=f*89/84);for(s=999+99*(C&2);s–;putchar(s*((776-f?s*f&32767:k)+(C&2?s*0/2&32767:k))/299999));}}

    Returns error: expected constructor, destructor, or type conversion before '(' token

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2019 Explore Mellieha. All rights reserved.