Skip to content
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

Bytestream as Note Frequency in Hex format #19

Closed
flamendless opened this issue May 13, 2019 · 5 comments
Closed

Bytestream as Note Frequency in Hex format #19

flamendless opened this issue May 13, 2019 · 5 comments

Comments

@flamendless
Copy link

flamendless commented May 13, 2019

Hi, im wondering if it's possible to produce output as note frequency that is all in hex format?

@flamendless flamendless changed the title Bytestream to Hex format Bytestream as Note Frequency in Hex format May 13, 2019
@LenShustek
Copy link
Owner

There is, in a way; the -b option will create a binary file of the Playtune bytestream, which contains just the sequence of MIDI note numbers (not frequencies) and timing information.

If by "hex format" you mean an ASCII file that uses the characters 0-9 and A-F, there are all sorts of ways to create that from the binary file. From Windows PowerShell, for example, you can say "format-hex filename.bin". I don't know what "decoration" you would want, in terms of spaces, line breaks, etc.

If you really want the note frequencies instead of note numbers (which isn't very space efficient because it would take more than one byte per note), you would have to write a program to create that from the .bin file. It wouldn't be too hard.

@flamendless
Copy link
Author

@LenShustek im kinda running out of time for our assembly project :/ there is this one java program ive used as reference to create such note frequencies in hex format from a .midi file, but it fails to properly play in the accompanying .asm

Sent from my HUAWEI GR5 2017 using FastHub

@joeybab3
Copy link

You’re going to have to explain what you mean by “hex format”

@flamendless
Copy link
Author

@LenShustek
Copy link
Owner

  1. That encoding is not of "note frequencies", it is of MIDI note numbers, just like Miditones generates.
  2. It is in 8086 source code format, which Miditones doesn't generate. Miditones generates C code.
  3. The bytestream is a much simpler single-channel constant-time format, instead of the multi-channel variable-time format that Miditones generates. You could write a program to convert the Miditones output to that, but you can't use it directly.
    Sorry this wasn't right for immediate use in your "assembly project".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants