Jump to content




How to convert NBS files?

help

  • You cannot reply to this topic
2 replies to this topic

#1 Agent Silence

  • Members
  • 319 posts
  • Location[string "FindMe"]:23143: bad argument #1 to 'returnPos' (vector expected, got nil)

Posted 25 August 2014 - 04:27 PM

Im making an in game NBS using the Iron Noteblock from Tobit's MoarPeripherals. And I can't seem to understand how to convert saved data files to NBS. The data files are in this format :
addedKeys = {
  {
    instrument = "Piano/Harp",
    key = 3,
    octave = 1,
    page = 1,
    pos = 11,
  },
  {
    instrument = "Piano/Harp",
    key = 9,
    octave = 1,
    page = 1,
    pos = 18,
  },
  {
    instrument = "Piano/Harp",
    key = 11,
    octave = 1,
    page = 1,
    pos = 33,
  },
  {
    instrument = "Piano/Harp",
    key = 5,
    octave = 1,
    page = 1,
    pos = 33,
  },
  {
    instrument = "Piano/Harp",
    key = 3,
    octave = 1,
    page = 1,
    pos = 23,
  },
  {
    instrument = "Piano/Harp",
    key = 6,
    octave = 1,
    page = 1,
    pos = 19,
  },
}
If anyone has knowledge on how to do so, please help

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 25 August 2014 - 06:23 PM

I can tell you that the specification is here. Bear in mind that you'll need a basic understanding of how data types relate to memory usage in order to actually do anything with that information - I suggest reading through BIT's NBS reading code in the Note player for some pointers.

#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 25 August 2014 - 11:21 PM

You'll definitely have to understand Endianess and how to convert between the two as Java's IO is big endian, and the NBS format is little endian.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users