Hornresp

It's not going to happen. If you want to store driver dimensions, you will have to create your own database.

I figured out a simple way to do it. As Hornresp reads only TXT files from the Drivers folder, I could just save the extra parameters in a DAT file with the same name in that folder. Hornresp will ignore the DAT file, but the workbook will be able to read it.
 

Attachments

  • 2019-08-12.png
    2019-08-12.png
    80.8 KB · Views: 159
That's the issue I ran into. It's being turned back on again, rather than being left off as expected.

It seems that I may have misinterpreted your original message:

3. Turn off the semi-inductance option
4. Export the sim, then import it back into Hornresp
When you import the sim, you should see the semi-inductance turned back on again.

When you said: "you should see the semi-inductance turned back on again", I thought that was what you expected to happen, but that it was not occurring.

Either way, I have not been able to replicate the problem you are experiencing. If I switch the semi-inductance option off on a record that has semi-inductance parameter values specified, export that record and then import the exported record, the semi-inductance option on the imported record remains switched off.
 
But how would Hornresp know that the file the user was trying to import was was actually previously generated by Hornresp? :) Going by the ID isn't sufficient - that can be easily "faked" by the program creating the import file. Right now my latest workbook is setting the ID to 48.20 (to match the ID included in files exported from Hornresp), and Hornresp is successfully importing the files generated by the workbook (after I included filter data, of course).

There is only so much that I can do to detect invalid inputs and automatically correct them. In essence I am trying to trap inadvertent errors in the data entered into your workbooks by users. If they wish to corrupt the data maliciously then there is little I can do about that. You will find in the next release that it is not possible to import a standard ID=48.20 Hornresp data record into the loudspeaker wizard. You will of course still be able to import such a record into Hornresp itself.

The way I see it working is that the user will simply press F6 when the wizard has the focus to update and check the performance of the iterative design changes made in your workbooks, with absorbent filling material and filter settings being specified separately in the wizard if required. Updating with F6 will not change these user-specified filling and filter settings. In other words, system physical dimensions will be iterated in your workbooks, and filling and filter settings if required, will be iterated in the wizard.
 
Either way, I have not been able to replicate the problem you are experiencing. If I switch the semi-inductance option off on a record that has semi-inductance parameter values specified, export that record and then import the exported record, the semi-inductance option on the imported record remains switched off.

Yep, I repeated what I was doing last night and I couldn't replicate the issue. I suspect that I was just reimporting the same file I initially started the test with, rather than importing the export file that I created after turning off the semi-inductance.

Raises the question though - what parameter in the exported Hornresp data file flags the semi-conductance as being off?
 
You will find in the next release that it is not possible to import a standard ID=48.20 Hornresp data record into the loudspeaker wizard. You will of course still be able to import such a record into Hornresp itself.

Will the initial import of the BOXPLAN data record into Hornresp still work though? F6 is only used to import an updated copy of the record without having to exit the wizard to do so.
 
If that is a question for me, then I have no idea how it might have happened. Each driver file stands alone - there is no interaction between different driver files.

I'm trying to figure out how it happened. Looks like there was a bunch of records for 10" drivers that were affected. That likely happened when I was trying out different drivers to replace the blown INF10 driver in my Enigma BP subwoofer. I was loading new drivers into Hornresp and adding the semi-inductance parameters for them. I was also updating existing driver records with calculated semi-inductance parameters. I copied each driver back to the database after adding the semi-inductance parameters. I'm going to try to repeat the process tomorrow to see if this issue pops up again.
 
what parameter in the exported Hornresp data file flags the semi-conductance as being off?

I assume you mean semi-inductance, not semi-conductance.

In the full Hornresp record file, the On (1) / Off (0) flag uses a 1-character-width filter field which was made spare when the separate low pass and high pass active filters were removed because they were effectively redundant due to the presence of the active band pass filter. Incidentally, this is another reason why I was reluctant to include the filter settings in your workbooks - the way that things have evolved, they now do far more than just specify filters.

In the BOXPLAN record, if the Re', Leb, Le, Ke and Rss advanced driver parameters all have non-zero values, then when the record is first imported into Hornresp the flag will be set to on. If the user then switches the semi-inductance off, subsequent F6 imports into the wizard will keep the option switched off. If the user then switches it back on manually in the wizard at some stage, subsequent F6 imports into the wizard will keep the option switched on.
 
Hi Brian,

Just to confirm final arrangements, files exported from BOXPLAN workbooks will need to contain the parameters listed in the attached example, with driver default settings being specified as detailed below.

1. To specify lossy inductance, change the traditional driver voice coil inductance parameter label from Le to Le1.

2. To specify semi-inductance, advanced driver parameter values for Re', Leb, Le, Ke and Rss must all be non-zero.

(If both lossy inductance and semi-inductance are specified, semi-inductance takes precedence and will be the default setting recognised by Hornresp).

3. To specify frequency-dependent damping, advanced driver parameter values for Rms and Ams must both be non-zero.

The initial imported default options can be changed by the user on either the main input parameters window, or in the loudspeaker wizard.

You may wish to include the above information in your BOXPLAN user instructions.

I hope to release an update to Hornresp in the next few days.

Kind regards,

David
 

Attachments

  • BOXPLAN.TXT
    428 bytes · Views: 56
1. To specify lossy inductance, change the traditional driver voice coil inductance parameter label from Le to Le1.

I won't be incorporating support for lossy inductance in the workbooks, so no need to worry about that.

The rest looks pretty straight-forward.

How will this affect the inter-operation of my other workbooks though, the ones that are used to model TLs and THs, for example? Would I just need to update them to use the BOXPLAN ID?

I'm curious as to Hornresp is actually reading the data from the data file. Is it using IF statements for parameter validation, like the following example?

Open myFile For Input As #1
LeCount = 0
Range("numPmax").Value = 0
Range("numXmax").Value = 0
Range("numRe1").Value = 0
Range("numLeb").Value = 0
Range("numKe").Value = 0
Range("numRss").Value = 0

Do Until EOF(1)
Line Input #1, textline
If textline <> "" Then
INIArray = Split(textline, "=")
If INIArray(0) = textline Then Driver = INIArray(0)
If INIArray(0) = "Sd" Then Sd = INIArray(1)
If INIArray(0) = "Bl" Then BL = INIArray(1)
If INIArray(0) = "Cms" Then Cms = INIArray(1)
If INIArray(0) = "Mmd" Then Mmd = INIArray(1)
If INIArray(0) = "Le" Then
If LeCount = 1 Then
Le1 = INIArray(1)
End If
If LeCount = 0 Then
Le = INIArray(1)
LeCount = 1
End If
End If
If INIArray(0) = "Rms" Then
If RmsCount = 0 Then
Rms = INIArray(1)
RmsCount = 1
End If
End If
If INIArray(0) = "Re" Then Re = INIArray(1)
If INIArray(0) = "Pmax" Then Pmax = INIArray(1)
If INIArray(0) = "Xmax" Then Xmax = INIArray(1)
If INIArray(0) = "Re'" Then Re1 = INIArray(1)
If INIArray(0) = "Leb" Then Leb = INIArray(1)
If INIArray(0) = "Ke" Then Ke = INIArray(1)
If INIArray(0) = "Rss" Then Rss = INIArray(1)
End If
Loop
Close #1
 
I won't be incorporating support for lossy inductance in the workbooks, so no need to worry about that.

Too late - it's already included. There is no requirement to use it though, if you don't want to.

How will this affect the inter-operation of my other workbooks though, the ones that are used to model TLs and THs, for example? Would I just need to update them to use the BOXPLAN ID?

I am not able to check the contents of your BOXPLAN export files because I only have Excel 2003, and cannot open your .xlsm and .xlsx files to create sample export files. Have you considered saving your workbooks as .xls files instead, so that they can be used by a wider audience? I assume all later versions of Excel can open .xls "legacy" files?

If your existing files end at Xmax followed by the comment line, then as well as changing the first line from ID=29 to ID=BOXPLAN, you will need to insert the parameters Path, Mass, Re', Leb, Le, Ke, Rss, Rms and Ams between Xmax and the comment line. The values of the new parameters can all be set to zero if you like.

In other words, all files will need to have the same format and length as the BOXPLAN.TXT reference example I provided earlier.

I'm curious as to Hornresp is actually reading the data from the data file. Is it using IF statements for parameter validation, like the following example?

Without going into specific details, Hornresp reads the sequential access file line-by-line, assumes that the parameters are listed in the order given in my example, and assumes that the file is of a fixed length (these constraints are not going to change). Hornresp can handle labels being uppercase, lower case or a combination of both. Checks are done to ensure that the parameter values specified in the file are in the ranges permitted by Hornresp, and take into account the possibility of a different decimal separator being used. The complete list of validation tests is considerable, but hopefully this gives you some idea of how the imported BOXPLAN file is processed.
 
Last edited:
Excel API Revisited

Hi Bill,

Sounds complicated :).

I try to keep things as simple as possible so that I can understand what I am doing (this is becoming increasingly difficult the older I get).

Kind regards,

David

Hi David,

It's not that complicated, and certainly convenient.
See this thread for an example illustrating the details.
VB6 How to read and write to an Excel file-VBForums
I expect that you are still doing program maintenance under VB6.
I would encapsulate parameter verification in subroutine(s) for reuse where ever needed.

Regards,
Bill
 
Gents,
my experience is that Excel backward compatibility is not strictly assured.


I have recently moved off Office 2007 (first version with the ribbon UI) at home which was able to run Brians Boxplan (BP)-MTH but not any others. Those I was able to use on my work machine that runs Office 2013. I tried saving all the BP's into the 2007 version of xls/xlsm but this did not seem to work. My home installation of Excel may have been missing some DLL's etc so my situation may not be entirely representative.


I also tried a few flavors of OpenOffice (Libre etc) and these were mostly unable to run the BP workbooks. Looking at an online compatibility table it was clear that OpenOffice lags or does not support some of the VBA capabilities of more contemporary versions of Excel (IIRC).


As the only upgrade path is now to Office 360 (as far as I'm aware!) I have recently upgraded my machines at home to 360 and happily the MTH and new BP6 both work fine (now) with this version of Office. I've not tried any other BP workbooks in 360, yet.


Hope this helps.
Cheers.


And PS - THANK YOU David and Brian - you are a river to your people! :)
 
Last edited:
Hi Bill,

See this thread for an example illustrating the details.

Thanks for the link. While Visual Basic applications can certainly use dynamic data exchange (DDE) to extract data from other applications and automatically update them with new data, as far as Hornresp is concerned I wanted to avoid interacting with external programs wherever possible. It took me quite some time before I was even prepared to accept externally-generated files such as those Brian is now producing for importing into Hornresp. Call me a "control freak" if you like :).

I would encapsulate parameter verification in subroutine(s) for reuse where ever needed.

Global and local subroutines / modules / functions are used extensively in Hornresp to minimise code duplication - there are literally hundreds of them :).

Kind regards,

David