Python Forum
How can I make music with python/pygame?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I make music with python/pygame?
#1
I'm almost done with my degree, and now I'm teaching myself pygame. I was amazed when I discovered the pygame.image module which allows one to load and save images. I figured I could make my own pixel-art program with it for my games. I was planning on making such a program, but realized that I would need to know a lot more about pygame to make it. I ended up settling instead for a function that can draw sprites from a list I input. I was able to make my program draw one of the aliens from space invaders, without using loose files or the .blit command. However, pygame apparently doesn't come with such diverse tools for sound manipulation. Literally all I can do is load and play images. I don't understand the point in having such a thing when you can't make your own sound files with pygame. You can easily make an art program with pygame, but not a music editor.

I've tried to look for free music editors online, but they all look like they either require a degree in acoustics, or knowledge on how sound files from the 8-bit era worked. The only music-making programs I have had any experience with are simtunes and some music maker program I think was made by mtv. Both of these just had you placing colored blocks in a row to generate music. I can't seem to find a program that works the same way, and can save the files in a format pygame will accept. I would just make my own, but pygame doesn't give me the tools for doing that. And I'm tired of all my programs being completely silent. I can't even so much as make a program play an error sound effect. I figure I could get something similar if I had a library of sound effects to choose from, then I could write a function that could play these sound effects based on a custom list (like how my sprite function draws sprites from data in a list). But I have no clue where I could get such files, and frankly, I'd rather be able to generate these files myself.

To be more specific, I'd prefer to use chiptune music. Aka, music like computers and consoles from the 80s and early 90s could produce. I don't even know where I could find a program that do music like that, plus with a simple interface I could use despite my lack of knowledge on acoustics or old-school sound files, and can save the files in .ogg or .wav format.

Any help would be greatly appreciated.

Oh, and I've already tried winsound. That apparently isn't very good for making music though. When I tried to use it, it kept putting a full second pause between each note that I can't remove for some reason.
Reply


Messages In This Thread
How can I make music with python/pygame? - by xBlackHeartx - Sep-23-2019, 05:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to make enemy chase me in pygame? Jan_97 3 4,421 Nov-23-2021, 05:08 PM
Last Post: Jan_97
  How to make an image move in relation to another in PYGAME CompleteNewb 1 2,315 Nov-10-2021, 03:38 PM
Last Post: metulburr
  [PyGame] How to loop music with pygame finndude 2 3,968 Nov-09-2021, 10:54 AM
Last Post: metulburr
  cant make a door automatically close a few seconds after i open it in pygame cooImanreebro 2 2,266 Dec-15-2020, 08:40 PM
Last Post: michael1789
  Trying to make boundries for the pygame bluewing101 2 2,052 Mar-23-2020, 01:35 AM
Last Post: Windspar
  Problem with music - Pygame.error GaseBall 1 3,209 Nov-28-2019, 07:46 PM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020