(help) importing music

Im just starting with pulp and I'm trying to import a .mp3 file but it won't let me select it under the import section, is there a certain file type that needs to be used or something?

All audio has to be in json format - and produced with the internal sound/music editor. It's a slightly weird format too if you have a look in an exported file - there is defo no support for midi, wav or mp3 at present.

Ok thanks, is there anywhere I can look to get resources and sounds?

Would probably be pretty easy to write a python script that converts a midi file into the appropriate json import format for Pulp. You’d have to make some decisions about what instruments map to which of the 5 synth engines and how to handle polyphonic segments of the midi file, but you could design a set of configurable properties for this.

1 Like

If I’ve any hope for music in my game, I think I would need something like this.

I may tinker later today if I get some time.

1 Like

Quick update
I finished the prototype. After reverse engineering the JSON format spec and spending a few days learning the MIDO library for python, this was a pretty fun project. Everything seems to be working smoothly, but I have a little more testing to do before packaging and distributing.

The plan is to have this run from terminal/command prompt. The user is prompted to map MIDI tracks to the appropriate Pulp audio channel and then provide a song name, but the rest is automated.

I'm auto truncating to the 32 measure length limit, and only consuming the first note in cases where polyphonic MIDI notes exist, but if you're designing outside of Pulp to the correct specs, these shouldn't be issues.

9 Likes

Thanks for all your hard work Bro-Code

I was talking to someone on discord about this so i'm glad you've stuck with it!

Ooh this looks great, excited to try it out, are you going to make it open-source? I would love to contribute

@Benpai honestly hadn't thought about it, but I'd have no problem opening up the GitHub repo once we get this initial version packaged this weekend. I'll post a link on a separate thread with more detailed usage instructions once available.

Will likely develop a more polished free version to run on our website that provides GUI control over track grouping, channel mapping, track splits, selectable note/bpm scaling, etc, but that's a few weeks out.

4 Likes

did you end up posting this? it looks like it could be a giant help on my end :slight_smile:

1 Like

Yes - I just opened up the repo. Check it out here.

1 Like

This is such a huge help. Is there a tutorial on getting the conversion set up?

There's not much to it - it runs from the command line and prompts for an input file. From there, you have the option to map each of your midi tracks to one of the available PlayDate audio channels. Then your track is converted and the resulting JSON file is spit back into the input directory. There length limitations on the PlayDate side, so I first scan the file to find the shortest note division, then adjust tempo from there to allow you to squeeze in the most notes possible, but note that the output file might be truncated.

Quick update:

I finally finished and published the python conversion utility. Details are available here: GitHub - ryanbeard82/Python_Midi-to-JSON

Refer to the markdown file for instructions, but the package is available on PyPi and can be installed in any environment running python 3.9.* or higher with pip install playdate-midi-converter