SynthMaker

Problem loading binary files with null values

Archive · 2008 8 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

Breakthru ·

Hi,

I am trying to load binary SysEx files in order to use them. To do this I load the file content as a string and convert every character to ASCII then to HEX. This works up to a point, however when I try to open a file that contains a SysEx value of F0 43 10 4C 00 00 7E 00 F7 only the first four bytes are returned by the "Text load" module (an editor such as Notepad loads everything).

My guess is that the fifth byte "00" is converted to a ASCII null value (ACSII Code 0) and that these are either not supported by the "Load" module or the string primitive. I know what I am trying to do is quite weird but being able to retrieve all ASCII characters from a file could be a nice feature to read some binary files without a SDK (and there is none for SynthMaker).

Anyway, if someone has a workaround to load binary files then feel free to suggest.

Thanks!

infuzion ·

Welcome to SM Bt! You'll have to upload an example, with the 00 values & without. I'm guessing you have each entry on a NewLine, which may get converted to 0? I've loaded .TXT config files in SM before, & used the Custom Parser to chop it up.

rl ·

I did the same, but using a little C program that converts the binary data of a SYS-EX file (0xf043104c....) into a ASCII string file 0F43104C..... and load the ASCII file into an SM String.

Unfortunately SM does not (yet?) have this feature. It has been requested before (Loading and saving sysex files )

infuzion ·

rl wrote: I did the same, but using a little C program that converts the binary data of a SYS-EX file (0xf043104c....) into a ASCII string file 0F43104C..... and load the ASCII file into an SM String.

Unfortunately SM does not (yet?) have this feature. It has been requested before (Loading and saving sysex files )

So why don't you share with us your wizardry? 😉 😇

Breakthru ·

Thanks for the hints! I did not look much into the parser since it is still R&D. And actually it is almost possible to do: SysExLoadTest.osm (quick and dirty...) This will work with this file: read_ok.syx (F0 7E 7F 06 01 F7) but not with this one since it contains null charaters: read_ko.syx (F0 43 10 4C 00 00 7E 00 F7)

When loading the second file, not all characters are loaded (only F0 43 10 4C is loaded the rest is ignored). Since 00 is ASCII null character I thought it might be related...

I'll try the parser but if I cannot load all the charaters then the conversion will still be impossible...

Thanks!

matti ·

I would also need the ability to load text files properly. I've had the idea of supporting 24bit wave file saving myself in SM(among other file types etc) and with full support for ascii-text files that would be an easy task.

With support for direct referencing of float or integer data as binary or char data would make things alot faster too. Currently to get a 24bit wave data to a file takes too many fancy prancy conversions that arent really needed when the idea is to get the data directly in the file as binary.

I think this could be a cool addition to SM as users wouldn't have to rely on Dev's to do all the work for supporting different file types. And ofcourse it could take some work off the Dev's shoulders in that matter too 😉

Btw. These text file problems have come up earlier too when working with SM, but they've been more minor things.. like the "feature" or a bug of a character -> , <- cutting all strings in half etc (is it called comma?). Couldn't the option of cutting strings at those characters be left to the user?

Updating the logics of how strings work and the proper ascii support for files could make a big difference in scalability of SM for lots of people.. with just a few reasonably easy bug-fixes. Proper Sysex-file support would come free of charge with those fixes 🙂

matti ·

Btw. I'm currently going to do my binary loading and writing by creating command line C++ applications that can convert things to a supported text format and back. Not very optimal, but it'll have to do for now. Atleast i get sysex file support for my Waldorf Q midi controller VSTi 🙂

If anyone has filetype suggestions i could prob code some converters for them too.

(Oh yeah someone else mentioned doing this to sysex files too.. cool)

matti ·

Ok i did a quick command line app to convert any file to a HEX-text file. If anyone needs it it's here -> link

Should be very usefull for loading syx files.. and fast enough for even wave files. Implementing different file format loaders should be possible if a binary loader primitive is going to be included some day. With this app of mine the concept can be evaluated by SM users 🙂

Let me know of any bugs or if you need different file formatting options(i first thought of doing it directly as integers with line breaks.. but i'm using this for sysex myself anyway, so hex was what i needed).

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.