Patch names from .hfe files of Ensoniq EPS disks

HxC Floppy Emulator Ensoniq Keyboards/Samplers support
Post Reply
OprahWinfrey
Posts: 2
Joined: Wed Jan 28, 2015 4:46 am

Patch names from .hfe files of Ensoniq EPS disks

Post by OprahWinfrey »

My HxC is installed in my EPS and working great. While waiting for my HxC to arrive I made some initial disk images in Linux using dd, only to find out that later that I needed an older floppy drive and the HxC software to copy the weird old disk geometry.

With some of those initial disk images I wrote a MATLAB/Octave script that would dig through the disk image, extract the patch names, and write them to a text file for my reference later. This is handy since I have a 200 floppy sample library.

BUT, I haven't had luck finding the patch names in the .hfe files that the HxC disk imager produces. Can anyone give me file format details that will help me to read the images? Big endian? Little endian? Interleaving of data from different sides or sectors? The patch names in the dd'ed images were typically after about 1kB of other header stuff.

Thanks,
OprahWinfrey

OprahWinfrey
Posts: 2
Joined: Wed Jan 28, 2015 4:46 am

Re: Patch names from .hfe files of Ensoniq EPS disks

Post by OprahWinfrey »

I ended up using the HxC conversion tool to convert the .hfe images to .imd ones. The following MATLAB/Octave script will read the patch names for all the EPS disk images in the working directory and write them to a text file.

Code: Select all

function WriteEPSpatchNames

%Richard Moore
%February 4, 2015

%This script will read patch names from .imd images of Ensoniq disks and write them to a text file.
fid = fopen('EPS_Patch_Names.txt','w');
imds = dir('*.imd');
for x = 1:numel(imds)
	names = EnsoniqPatchNames(imds(x).name);
	fprintf(fid,'%s\n',imds(x).name);
	for y = 1:numel(names)
		fprintf(fid,'\t%s\n',names{y});
	end
	fprintf(fid,'%s\n',' ');
end
fclose all;
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function names = EnsoniqPatchNames(filein)
%This is a function to read the file names from a disk image on EPS patches.

fid = fopen(filein,'r');
[VAL,COUNT] = fread(fid,2000,'uint8',0,'l');
keepers = 0;
nameind = 0;
names = {};
for ind = 1:numel(VAL)
	if (VAL(ind)>31)&&(VAL(ind)<90)
		keepers = keepers + 1;
	else
		keepers = 0;
	end
	%Some filtering.  Make sure there are 12 character in the string and filter out date and other header strings:
	if (keepers==12)&&(~ismember({char(VAL((ind-11):ind)')},names))&&(char(VAL(ind-3))~=':')&&(char(VAL(ind-8))~='/')
		nameind = nameind + 1;		
		names{nameind} = char(VAL((ind-11):ind)');
	end
end
fclose(fid);
end

Post Reply