we need MIDI music support in the next game engine

Hi

imagine that the game engine supports MIDI music (DREAMS)

the size of a midi music is nearly nothing
cool music in here …

www.khayma.com/cgwoods/tmp/music.rar

i’m asking the devlopers to add this feature … if possiple
bye bye :slight_smile:

3DGURU

Hey 3dguru

I was mucking round with importing the pymidi module into blender 2.32? but it really worked badly and in the end I was just using blender as gui wrapper for python(blender would be forced to wait until pymidi finished)
I also looked into a lot of the python docs on the os and windows modules to see if we could access windows midi mapper or other components but still no luck.In the end I am using that getspectrum function to make a armature rigged mesh sing and dance to a wave file played in the game engine.
Let us know if you want a blend.
Dr S

do you have a demo file? is it simple?

I’d be interested in that as well, please!

so your character actually responds to the music?

heh, now that would be something I would love to see…gotta .blend?:stuck_out_tongue:

In the end I am using that getspectrum function to make a armature rigged mesh sing and dance to a wave file played in the game engine.

wow , !

Let us know if you want a blend.

of course yeah , i’m getting up with python , i am learning it goodly :slight_smile:

reviving that …

Guru,

If you use pygame for music like BHP Racing did (blending-online’s tutorial actually works, despite what some people have claimed) you can use chiptunes (.mod format) in your games. Chiptunes are very small. Two minute songs are about 25kb!! And best of all, they sound like classic video game music!:slight_smile: Here are two links to chiptunes libraries you can download:

http://www.chiptunes.org/ They’re in the “Files” section. I think there’s one big download to grab thousands of songs.

http://chiptunes.back2roots.org/ Get the complete 75MB archive of .mod format chiptunes! Other formats available, too.

It’s a great solution. Here’s a link to a fun little arcade shooter game that uses chiptunes: Invalid Tangram

(P.S. You can play .mod files in Winamp)

Guru,

I just tried one of your midi songs using pygame in Blender. It worked! Here’s the code I used:


import pygame.mixer
pygame.mixer.init()
pygame.mixer.music.load("Megaman_8-Stage_Select.mid")
pygame.mixer.music.play(-1,)  ### <--- -1 means "continuous loop play".
###Otherwise, the format is <i>music.play(number of loops, maximum length of time to play)</i>

Just run it with logic bricks. (don’t use “always”. It will keep trying to start the song over and over, and it will sound like a scratched CD.)

For a .mod, .mp3, or .ogg just type in the full file name. For my Marble Labyrinth game I’m currently working on I used a .mod file


pygame.mixer.music.load("laser_d.mod")

The music file needs to be in the same directory as your .blend file! I still recommend that you download some chiptunes and listen to them. They sound very much like your cool midi’s, and they seem to run smoother on my PC. If you don’t know where to start, I really like chiptunes by Android.

Also, I have the full install of Pygame on my PC, so I don’t know if mod or midi will play with the files you can get from blending-online. Perhaps you could try it.

you could goto windows media player burn it to CD and rip it as .wav or .midi or whatever you want.

blendenzo … i am unable to thank you enough !
can i make this thread a tutorial in my website …
I will credit you of course …

3DGURU

Guru,

You may use any useful information I give to you or anyone else to make a tutorial. I like answering questions, but I prefer not to type so much. It’s nice to say “look at the tutorial on 3DGURU’s website” instead of explaining the whole process.

One note, though. I’m not sure that the files from blending-online are enough to play .mid and .mod files. I had a friend try an incomplete version of a game I made using .mod, and the music did not play on his PC. I will be looking into it, so I will post updates. For now, I do know that they work with the full install of Pygame.

BTW, did you try the chiptunes? How do you like them?

Sorry for the late reply but I took the weekend off bigtime didn’t even think about computors.But I have posted the dancing dude at http://www.bentstraight.org/DancingDudePacked6.zip

I had to use Blender 2.25 Publisher as the sdl.dll file is required and this is very rough as I have to animate the armatures to do dance moves and I am no choreographer.

There is no wave file packed with it you will have to load your own (44.1KHz,16 Bit,Stereo) and set the actuator to play the file.I am not entirely sure exactly what the info returned by the getspectrum represents on an audio level, but I prepared some sound tones starting at 20Hz and went up by octaves and fiddled with the script so that the coloured squares at the back do a fair job as a spectrum analyser ie first one(Lefthand) is 20Hz and 2nd is 40Hz 3rd is 80Hz etc.Iam still working on ways to manipulate the 512 item list that is returned.Look to the python scripts for more info on this.Any tips or armature help would be appreciated. 3dGuru I would love to hang this script on your dancing game you did a while ago.

So as to how accurate the dude moves to the music is open for debate but I think it looks pretty funny Have Fun

Dr S

@blendenzo , i was unable to run the .mod files , i tried for hours ,…

can you upload the blend to the savefile.com or somethig else ¿

the dlls and the scripts of py game should be in the archive please …

@DR S

finally , you are here … thank you too much , i will check this out , would you mind to do a tutorial of this too … i will describe how to use the script … and you will be credited …

3DGURU

I can’t post them right now, I’ve only got a couple of minutes. Later tonight I will have a chance. I will also look into why the archive at blending-online is not enough to play .mod files. Later.

Hey Guru,

I’ve uploaded a zip file to my website:

labyrinth0.6.zip

This is my currently incomplete marble labyrinth game. The controls are [up arrow] & [down arrow] to tilt forward and backward, [z] & [x] to tilt left and right (I’m trying to mimic the actual two-handed control of the real wooden toy). [5] takes a screenshot and saves it as “MarbleLab.tga” & [Esc] quits the game. This game is very difficult, but the real wooden game is even harder. Slow movements will be best to reach the finish.

  • Download labyrinth0.6.zip. Also download the Pygame installer to install the latest version of Pygame on your PC (This is the Windows version. Other OS versions are here.)
  • When you get home, install Pygame, then extract labyrinth0.6.
  • Run labyrinth0.6.exe. You should be able to hear the music. I uninstalled Pygame on my PC, and the music did not play, but when I reinstalled it, the music again ran fine. If after installing Pygame it is not working for you there is still a problem. Let me know and I will try to help.
  • Open labyrinth0.6b.blend to view my python scripts. My music.py script is the same as the script I posted above, except I added the line
pygame.pre_init(44100, -16, 2, 1024*3)

before the pygame.init() command to fix a scratchy sound, as suggested in the pygame documentation. (You may also be interested in my camFollow and PrntScrn scripts. You may reuse any of my scripts however you want to.)If you want the music to play from the .blend file, you must open it by double-clicking the labyrinth0.6b.blend file!! If you open it from Blender, Pygame will look in the Blender directory for the music instead of in the folder the .blend is in.

To read all about the Pygame mixer function, check the Mixer Documentation.

If you want to use .mod files in your games, you can simply include the Pygame installer with your archive/installer and tell people they need to install it on their PC to hear sound in your game.

I hope that I have been helpful.

I assume , that the blend just should work fine , …
when I go back home , i will check the file out …

thanks a million , and when it works i will make a tutorial …

Hey, I see that you’re online right now, so here’s a quick update if you want:

labyrinth0.7.zip

This file includes the Pygame 1.71 Windows installer, and the game is more complete.

I’m off to work for the day…

Hey, I see that you’re online right now, so here’s a quick update if you want:

labyrinth0.7.zip

This file includes the Pygame 1.71 Windows installer, and the game is more complete.

I’m off to work for the day…

thanks Blendenzo , … you are helping the members too much …

3DGURU