-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the player inside a real game #8
Comments
Hello! Thank you for your interest in my project. When writing it, I tried to separate the interface from the implementation the best i could, in the hopes it wouldn't be too difficult to adapt it to a game project if necessary. However, the code hasn't been tested outside of the scene it belongs to, so I couldn't say for sure! If you check the code you can see most of the classes are in the main file. All of the interface functions are at the top, and the replayer code is below that. Feel free to make your own audio stream generator in another scene and try using the replayer to fill the buffer with data from a mod you've loaded into the replayer. I'll be happy to know the results! P.S. One more thing to note; the file access routines are not guaranteed to work on every platform in the same way, so to be safe you should load a path from the resource folder, and remember that mods aren't included in the pack file by default, so you'll have to include them when exporting to a real project. On my puny old i3, gdsmod takes up around 6% cpu to render a mod and fill the sound buffer at runtime. Please set your expectations accordingly. 🙏 Thank you! |
Ah, and moreover, whether you're able to successfully play a mod from outside the scene or not, please let me know. I may be able to try moving the replayer to its own separate singleton myself if it needs more work to get working in your game than a simple copy-and-paste job to an autoload. |
Hello Nobuyuki,
thank you for your kind reply :-)
I am just starting now writing my game and as soon as I'll arrive to the
tracker I'll write to you.
Thanks!
Fabio
…On Tue, Nov 5, 2019 at 3:35 PM Nobuyuki ***@***.***> wrote:
Hello! Thank you for your interest in my project. When writing it, I tried
to separate the interface from the implementation the best i could, in the
hopes it wouldn't be too difficult to adapt it to a game project if
necessary. However, the code hasn't been tested outside of the scene it
belongs to, so I couldn't say for sure!
If you check the code you can see most of the classes are in the main
file. All of the interface functions are at the top, and the replayer code
is below that. Feel free to make your own audio stream generator in another
scene and try using the replayer to fill the buffer with data from a mod
you've loaded into the replayer. I'll be happy to know the results!
P.S. One more thing to note; the file access routines are not guaranteed
to work on every platform in the same way, so to be safe you should load a
path from the resource folder, and remember that mods aren't included in
the pack file by default, so you'll have to include them when exporting to
a real project.
On my puny old i3, gdsmod takes up around 6% cpu to render a mod and fill
the sound buffer at runtime. Please set your expectations accordingly. 🙏
Thank you!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8?email_source=notifications&email_token=AAVWNV3Z62V3MKBTI4RXKY3QSGAE3A5CNFSM4JI7CQE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDC5JPA#issuecomment-549835964>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVWNV4LVBYRUOESNR2YJDLQSGAE3ANCNFSM4JI7CQEQ>
.
--
--
Ciao,
Fabio
|
I would also like to use it in a game. I really like the idea of using mods instead of big ogg files, and it seems to perform pretty well. Maybe a plugin that provides a new Node-type with an import-plugin (like this would make it easier to use? I tried digging in, but couldn't quite figure out how to pull the player out of the demo scene. It looks like |
Also, as a side-note, I think it will allow mod-files in HTML5 exports, which is great (vs native addons, which only work on specific native targets that they've been compiled for, and cause lots of other issues.) |
I think I made some progress using it as a plugin that should define a new Still can't wire it up to a
Maybe someone with more godot-knowledge can see what I'm missing? |
I decided to go another direction: make a minimal self-contained scene, so I could just drop it into my game. I'll keep working on a plugin (maybe just a new type that is an instance of the scene, that lets you set the file) but I figured this could be useful to others as-is. The zip is a demo-project, but you can drop ModPlayer.tscn into your scene, then run code liek this: func _ready():
$ModPlayer.load("res://test.mod")
$ModPlayer.play() |
Hello,
I am starting porting one of my old Amiga games (Quadranoid) on Godot (after 25 years!) and I'd like to use your mod player to play original PRO tracker files.
Is it possible to use your software as a standalone library to play modules?
Thanks! :-)
The text was updated successfully, but these errors were encountered: