Ivan only said that
- It might be possible to send data to the pc speaker via os.execute, depending on what os you run it on, and that
- Nowadays it's easier to -render-, that is, simulate the sounds, and play it back as a wav file on your actual speakers or headphones.
But to answer your question, sound = love.audio.newSource("music.wav" , os.PCspeaker) will not work, since löve can't handle that second parameter.
Also, read this. The most important parts:
- Eventually because of the lack of hardware to communicate with, support for Beep was dropped in Windows Vista and Windows XP 64-Bit Edition.
- In Windows 7, Beep was rewritten to pass the beep to the default sound device for the session. This is normally the sound card, except when run under Terminal Services, in which case the beep is rendered on the client.
So whatever you do, the beep will happen on the normal speakers, or it won't happen at all, on windows at least.
It's sad really, my first synthesizer program was written in turbopascal in DOS, and it used the beep function, and it was "polyphonic"... with some cheating.
Music like in Nintendo games
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Music like in Nintendo games
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Music like in Nintendo games
This seems awfully complicated and as others said, not a lot of mobos even have a speaker nowadays, mostly IBM ones.
This could help: http://superuser.com/questions/227939/h ... and-prompt
Also, if you run it plays the bell sound, but there is no way to pitch that.
This could help: http://superuser.com/questions/227939/h ... and-prompt
Also, if you run
Code: Select all
print("\7")
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Music like in Nintendo games
(I tested that, win7 x64 did not do anything, that's why i didn't mention it.)Davidobot wrote:This seems awfully complicated and as others said, not a lot of mobos even have a speaker nowadays, mostly IBM ones.
This could help: http://superuser.com/questions/227939/h ... and-prompt
Also, if you runit plays the bell sound, but there is no way to pitch that.Code: Select all
print("\7")
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Music like in Nintendo games
(You need to have the console window open for it to work - t.console = true)zorg wrote:(I tested that, win7 x64 did not do anything, that's why i didn't mention it.)
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Music like in Nintendo games
As master both said, you can use a music tracker to compose your songs.
Since you brought up SMB as an example, I recommend http://famitracker.com/
Since you brought up SMB as an example, I recommend http://famitracker.com/
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Music like in Nintendo games
Except:
One can render an mp3 or something from Famitracker, sure, or even use a more sampling oriented one, and load the module files themselves for less hdd space, but that's not what the OP wanted to do.
Not with löve... yet : 3Nutte wrote:I want to program music not use a file, can i do that with Love?
One can render an mp3 or something from Famitracker, sure, or even use a more sampling oriented one, and load the module files themselves for less hdd space, but that's not what the OP wanted to do.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Music like in Nintendo games
Thank you for all the answer.
-
- Prole
- Posts: 12
- Joined: Mon May 22, 2017 3:45 am
Re: Music like in Nintendo games
I was actually thinking about doing this too recently I think by far the biggest issue with making a software based chiptune/music-in-general player in Love is timing issues. There are no events that get triggered at a predictable periodic rate afaik. Love.update and love.draw get called once per *rendered frame* i think meaning the quality of the music would heavily depend on the framerate. Retro console programmers had it easy when it comes to this kind of thing because they had hardware timers that always fired at the same rate every frame (on the NES you get an event fired every time a frame is finished rendering for example). This made music programming very easy since all you had to do is write the sound engine code then provide a pointer to it in the interrupt vector table (which is at the very end of the program since the CPU looks for interrupt handler pointers at the very last few bytes of RAM, at least on the 6502 which is what the NES uses). Of course in real life applications the music code would be sharing valuable CPU time with other things like controller input, physics/sprite updates etc, but thats beside the point
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Music like in Nintendo games
I already made a player that needs perfect timing, mr. necropost-by-googling-and-old-thread.
https://github.com/zorggn/LoveTracker
Also, you're rendering into a buffer, the quality won't depend on anything; if you use a buffer smaller than how much you can render at once, it will underrun, that's all there is to it.
Hell, someone implemented a game boy emulator with löve (without sound for now, iirc he's waiting for 0.11 to come out because better generative sound API stuff, just like in my project), that also works besides the fact that löve doesn't give you access to hardware timer interrupts on the pc... not like you need them; just edit the default love.run or set vsync to false if you don't want it to run as fast as your screen's refresh rate.
https://github.com/zorggn/LoveTracker
False, you can edit love.run or have vsync turned off, or you can use a separate thread for generatin audio alltogether.therektafire wrote: ↑Fri Jun 02, 2017 9:19 pm I think by far the biggest issue with making a software based chiptune/music-in-general player in Love is timing issues.
There are no events that get triggered at a predictable periodic rate afaik. Love.update and love.draw get called once per *rendered frame* i think meaning the quality of the music would heavily depend on the framerate.
Also, you're rendering into a buffer, the quality won't depend on anything; if you use a buffer smaller than how much you can render at once, it will underrun, that's all there is to it.
Nothing was very easy back then, and if this was a C app, you probably could access the 3 hardware timers that pc-s still have... but the question is why, computers are fast enough for you to just rely on the os scheduler to run your code as fast as it does...therektafire wrote: ↑Fri Jun 02, 2017 9:19 pm Retro console programmers had it easy when it comes to this kind of thing because they had hardware timers that always fired at the same rate every frame (on the NES you get an event fired every time a frame is finished rendering for example). This made music programming very easy since all you had to do is write the sound engine code then provide a pointer to it in the interrupt vector table (which is at the very end of the program since the CPU looks for interrupt handler pointers at the very last few bytes of RAM, at least on the 6502 which is what the NES uses).
As you said, if i had threaded my thing, that would give it even more guarantees, in that other processing wouldn't block the audio generation thread. Everything's on the main thread, renders into a tiny buffer for the least amount of delay, and it works without any hitches still.therektafire wrote: ↑Fri Jun 02, 2017 9:19 pm Of course in real life applications the music code would be sharing valuable CPU time with other things like controller input, physics/sprite updates etc, but thats beside the point
Hell, someone implemented a game boy emulator with löve (without sound for now, iirc he's waiting for 0.11 to come out because better generative sound API stuff, just like in my project), that also works besides the fact that löve doesn't give you access to hardware timer interrupts on the pc... not like you need them; just edit the default love.run or set vsync to false if you don't want it to run as fast as your screen's refresh rate.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
-
- Prole
- Posts: 12
- Joined: Mon May 22, 2017 3:45 am
Re: Music like in Nintendo games
Now how do you create multiple threads in lua? :/ I know about coroutines but I don't think those are the same thing?
Who is online
Users browsing this forum: No registered users and 7 guests