• Disclaimer: This Vendor's Forum is a paid-for commercial area. Unlike the rest of diyAudio, the Vendor has complete control of what may or may not be posted in this forum. If you wish to discuss technical matters outside the bounds of what is permitted by the Vendor, please use the non-commercial areas of diyAudio to do so.

New plotting software

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Code:
Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Collections.Generic


Module Module1

    Sub Main()
        Dim data As New Generic.List(Of String())
        Dim current_line As String()
        Dim width_(45) As Integer
        For i As Integer = 0 To 45
            width_.SetValue(12, i)
        Next i
        Dim wr As HttpWebRequest = CType(WebRequest.Create("http://gedlee.com/summa.txt"), HttpWebRequest)
        Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)
        Dim str As Stream = ws.GetResponseStream()
        Using myStreamReader As New FileIO.TextFieldParser(str)
            myStreamReader.TextFieldType = FileIO.FieldType.FixedWidth
            myStreamReader.FieldWidths = width_
            While myStreamReader.LineNumber > -1
                current_line = myStreamReader.ReadFields
                data.Add(current_line)
            End While
        End Using
    End Sub

End Module

VB syntax makes my head hurt, but the above works :)
 
Last edited:
What do you write in?

I am moving to the .NET environment and I find VB.net quite straightforward. But I have some C++ code that I want to use and I cannot get the C++ Dll's to work - I know its the "managed code" stuff, but that's all fog to me. I started looking at C# and I can see that I could really take to that language, but I find C++ completely discouraging and not at all apparent what is going on.
 
I spent a lot of time in C# using the .net framework (first job out of university was web programming in C#.net), but I haven't really used it since .NET 3.5 came out. I greatly prefer C# to VB. I could get used to VB I'm sure, I've just never done much of anything in it.

Spent 6 months or a little more in Java, then a year not coding, and now I'm mostly working in Python. Always thought it would be crazy to leave a strongly typed language, but I'm really starting to like a dynamically typed language like Python. Code ends up so clean and concise.

If you switch over to C#, check out JetBrains ReSharper. It's a must have in my opinion.

And if you end up more seriously developing your plotting tool, I'd strongly recommend checking out a book called Clean Code and doing some reading on TDD (test driven development). Pain in the *** to get your head around the TDD paradigm, takes a while to figure out what tests to write. But once you do, you end up with fewer bugs, and you can re-factor your code fearlessly with the confidence a full suite of test coverage provides.
 
Last edited:
With changes the app is working fine for me. Takes a couple seconds to load a new dataset.

You might also want to consider zipping the datasets. The System.IO.Stream name space includes some that will decode gzip files. And there are some free libraries for doing zip files. Should save on bandwitch and speed up the data set switching time.

Could set it up so that it pulls in all the datasets in a zipped format, then keeps them all locally in memory for switching between them, which should make changing between the plots almost instant.
 
Yea - thanks a lot - your code worked great.

Good idea about the zip thing.

Trouble is that I DO NOT want to become a programmer. I'm a hack. But there are some things that I have to do myself. I was using a plotting package for the polar maps and it won't run under Win7. I got sick and tired of buy new plotting packages every couple of years so I wrote this one to play with my new VS2008. It was really very straightforward. But I have no intention of getting too deep in any of this.

I need to do some extremely heavy numerical stuff and I can't get FORTRAN to work in WIN 7 either. So I thought that I would jump to VS C++, but I just got frustrated. I'm still not sure what I am going to do. I'd prefer to work in FORTRAN, but thats getting darn near impossible.

Thanks again.
 

taj

diyAudio Member
Joined 2005
I don't imagine you'd want to go this route, but I found Adobe Flex to be a very easy-to-digest language for muckin around in. And since it targets the flash player, it's pretty much compatible with everthing (okay, except Apple iDevices). This little program I am playing with is about a page and half of (horrid beginner) code. Flex is most similar to JavaScript I think.

please 'scuse the simplicity, but it demonstrates the capabilities a bit...

Spoddler: A Speaker Modeler

(and 'scuse the vain URL -- it's a freebie host.)

..Todd
 
I don't know what Python has for math libraries, the programming I do doesn't require much and I didn't take that much math in university. But I've found it amazing how quickly you can hack stuff together in Python.

Here's a link to a wiki page on the libraries available in Python:
NumericAndScientific/Libraries - PythonInfo Wiki

Here's an online book that would have you up and running in Python in a couple hours.
Dive Into Python
 
I don't imagine you'd want to go this route, but I found Adobe Flex to be a very easy-to-digest language for muckin around in. And since it targets the flash player, it's pretty much compatible with everthing (okay, except Apple iDevices). This little program I am playing with is about a page and half of (horrid beginner) code. Flex is most similar to JavaScript I think.

please 'scuse the simplicity, but it demonstrates the capabilities a bit...

Spoddler: A Speaker Modeler

(and 'scuse the vain URL -- it's a freebie host.)

..Todd

Over the years I would have to rate Adobe as the premier software company because there stuff is so stable, the apps so common and functional. So I would be tempted. But I am shackled in legacy, which dominates everything that I do. I can save months to years in a project by using legacy numerical code and just writting a GUI front-end, but that legacy code is all in FORTRAN. That makes things very difficult because its becoming nearly impossible. But I have not given up. The biggest problems come from two OS changes; .NET and 64-bit. FORTRAN has trouble with both of these changes, but I can see that it can be done.
 
I don't know what Python has for math libraries, the programming I do doesn't require much and I didn't take that much math in university. But I've found it amazing how quickly you can hack stuff together in Python.

Here's a link to a wiki page on the libraries available in Python:
NumericAndScientific/Libraries - PythonInfo Wiki

Here's an online book that would have you up and running in Python in a couple hours.
Dive Into Python

Thats a trivial set of math capabilities and most are just wrappers around C++ libraries. So Python doesn't solve anything for me since its not the "python" side of the situation that I am having trouble with and it cannot do the side that I am having problems with.

I was reading about C# and I see someting that I had not seen before about "managed code". A FORTRAN dll cannot be "managed code" so to be called from any .NET application is not trivial. Under VB6 it was - one line of code - done!
 
Yeah, the sheer enormity of .NET is too much for me. The time it would take to become familiar with enough of the .NET landscape to begin writing any code is more than my interest level can bear.

..Todd

I got VS and .NET back in 2001 and I tried to get into it, I gave up. But for reason - VS2008 seems far more developed - I found it quite straightforward this time. SOme things with mangaged code interoperability - which is mostly not addressed in the documentation - but not as long as I stay in .Net.

Dustin B;2193321[/QUOTE said:
I'm shooting in the dark here, but that book makes it sound like you should be able to use the Fortran libraries you need from Python scripts.

Thanks - that top book does look very interesting. I am not that familiar with Python. How does it compare with C#? Who supports it?
 
Python (programming language) - Wikipedia, the free encyclopedia

It's an open source language managed by the non profit called the Python Software Foundation. It's been around since 1991 and still actively being developed.

There are some major sites out there written in it, such as YouTube.


It was a small shift to get used to the fact it's a dynamically typed language and code blocks are all defined by whitespace. But now that I'm into it, I like it better than C#. Like I said earlier, it's very concise and promotes clean code. It's not unusual to write in 20 lines of python what would have taken over 100 in something like C#.
 

taj

diyAudio Member
Joined 2005
Wow. A few minutes dragging around the coordinates and the speaker performance becomes much more visually intuitive. Yes, I could get used to that.

Nice work. (Even though I had to hold my nose and use I.E. :dead: -- but that's not your fault.)

Now I want to measure, plot and study my own projects... Maybe one day.

..Todd
 
Thanks Todd

I keep trying to tell people that these kinds of ploits are extremely insightful and show the true nature of a loudspeaker design. I can viually see the problems when the data is shown like this, but with the way its typically shown, even I can';t tell what the problems are, or if there are any - its all hidden.

But, of copurse, when other designers see the problems in theior designs they are NOT going to want to show that data to the public. Contrary to the claims, this whole industry lacks transparency and that is quite deliberate when you seen behind the scenes. Claims like "measurements don't tell the story" - so they don't show any or only enough to be misleading.

my plea to the audio marketplace is simply this - demand to see the data that shows whats really going on.
 
Hi Earl,

I think you did a good job with the interface. It's simple and the polar and frequency response plots aside the polar map are instructive and clarifying. I have some questions though.

The sharp dips/nulls in the frequency response, are those real or artifacts of some sort? And most important, are you planning to support third party data so we can make plots of our own speakers?
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.