blob: 0d430ddd166217687656b0110b0081b6defbd4d1 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- -*- xhtml -*- -->
<title>Meet a NetBeans Module Writer: Peter Blemel</title>
<link rel="stylesheet" type="text/css" href="https://netbeans.org/netbeans.css">
<meta name="AUDIENCE" content="NBUSER">
<meta name="TYPE" content="ARTICLE">
<meta name="EXPIRES" content="N">
<meta name="AUTHOR" content="Geertjan Wielenga">
<meta name="developer" content="gwielenga@netbeans.org">
<meta name="indexed" content="y">
<meta name="description"
content="">
<!-- Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. -->
<!-- Use is subject to license terms.-->
</head>
<body>
<h1>Meet a NetBeans Module Writer: Peter Blemel</h1>
<p><small><a href="mailto:nbdocs_feedback@usersguide.netbeans.org?subject=Feedback:%20Meet%20A%20NetBeans%20Module%20Writer:%20Peter">Feedback</a></small></p>
<table class="ltblue" align="right" border="1" cellpadding="5" cellspacing="0" width="190">
<tbody>
<tr>
<td align="center"><img src="nbm_interviews/peter/Peter.jpg" alt="Peter's picture" align="middle">
<br><b>Peter Blemel</b></td>
</tr>
<td>Peter's Hot Links:
<ul>
<li><a href="http://www.management-sciences.com">Management Sciences, Inc</a>
<li><a href="http://www.transposix.com">Transposix</a>
<li><a href="http://www.jfugue.org">JFugue</a>
</ul>
</tbody>
</table>
<p>Peter Blemel is a Swing desktop application developer. Here he talks about the applications he's been
working on. Plus, he shows off his Music IDE and explains how he uses it to teach programming to kids!
<h3>
<a name="So_2C_Peter_2C_where_in_the_world_are_you_and_what_do_you_do_there_3F" />So, Peter, where in the world are you and what do you do there?
</h3>
<p class="P6"><span class="T3">I live in Albuquerque, New Mexico. I work for a research and development company, <a href="http://www.management-sciences.com">Management Sciences, Inc</a> (MSI),
which my parents started 30 years ago. The great thing about my job is that every few years I can answer "what do you do" differently,
and still be working for the same company. Currently I'm designing and writing software for prognostic health management (PHM). Our primary
focus is in situation-aware embedded systems. </span>
<span class="T1">These are systems that learn to evaluate their own health and ability
to complete a mission based on their own past performance, the kind of mission they are tasked to do, and the world around them. Essentially,
the system itself can help extend its own life, which will save our customers' money. </span>
<span class="T3">Our applications range from aircraft to wiring. The rest of my time is spent with my family, volunteering, and my
other programming-related interests. </span></p>
<h3>
<a name="You_27ve_created_some_kind_of_music_application. _. _. _what_27s_that_all_about_3F" />
You've used the NetBeans Platform quite a bit. What have you done with it?
</h3>
<p>I have written several packages for Management Sciences that support probabilistic models, including Bayesian Networks and
various flavors of Markov Models. We have a collection of 10 NetBeans modules that are added to the NetBeans Platform. Our applications use
the chained NetBeans Platform. The one that is the most interesting is a Turing Complete probabilistic modeling language called Cognitive Bayesian
INformation EXploitation (CBNX). We have an algorithm
that performs in linear time, reducing many n-p hard problems into tractable ones. I am creating an IDE based on the NetBeans Platform that
allows the user to write logic applications, visualize the relationships, and simulate them. Our target is embedded systems. </p>
<h3><a name="How_do_you_develop_CBNX_applications_using_NetBeans_3F" />How do you develop your CBNX applications?</h3>
<p>The MSI CBNX compiler is written in Java. The CBNX IDE is an application based on the NetBeans Platform. It
makes use of the <a href="http://bits.netbeans.org/dev/javadoc/index.html">MultiView Windows API</a> to provide an editor view and a graphical view that allows the user to see the compiled network in a second view.
I integrated with the <a href="http://graph.netbeans.org/">Visual Library API</a> to draw graphs, but we are evaluating other commercial graphing packages. At first I just used the text
editor to edit programs written in the CBNX language, and used the compiler to check for errors. That can be a time consuming process, but adding
language support to the platform looked complicated, and I had higher priority things to do. Then I saw blog entries on how easy it was to
use the <a href="http://languages.netbeans.org/">Generic Languages Framework</a>, also known as Schliemann, so I gave it a try. I had to modify our JavaCC grammar to make it LL(1), but I added lexical highlighting and syntax checking
in less than a day. Here's a section of our grammar definition in Schliemann:</p>
<p><img src="nbm_interviews/peter/CBNXnbs.jpg" border="1" alt="CBX nbs">
<p>Since then I've learned how to add things to the Navigator that the Source Editor provides. I'm very impressed with how much functionality
can be achieved with such a simple configuration file. I can't even begin to guess how long it would have taken me to integrate the CBNX parser
with the Source Editor in that way. Here's some CBNX code, within the editor I created for it:</p>
<p><img src="nbm_interviews/peter/Asia.jpg" border="1" alt="Asia">
<h3>
<a name="You_27ve_created_some_kind_of_music_application. _. _. _what_27s_that_all_about_3F" />
You've also created some kind of music application... what's that all about?
</h3>
<p>Yes, <a href="http://www.transposix.com/index.html">Transposix TABMentor</a>. TABMentor is software for teaching people how to read and play music, specifically guitar,
and things related to music education. It's a start up. My business partner, Steve Maase, is an accomplished professional guitar player
and teacher who felt that none of the "Teach Yourself to Play" packages really met the needs of his students. So, we set about creating
something that did. We didn't want to be in the business of writing music composition software, but our options were limited when we started.
We had to write our own, to meet our needs, before we could get to what we really wanted to do. </p>
<h3><a name="And_how_did_you_build_your_application_3F_What_were_the_main_ingredients_3F" />
And how did you build your application? What were the main ingredients?
</h3>
<p>The grace of God, persistence, and the support of my family and financers! This application is actually not
new, but it has never really seen the light of day. Steve and I knew that we had to be Internet-centric, but he's not a coder.
I started coding it in C++, but I liked the idea of using Java to get us delivered on multiple platforms. That was some time ago.
At first we built our own Java framework. I worked with a great coder named Tim Casey that I had under contract at the time. </p>
<p>We tried early versions of the NetBeans Platform, but made a decision to stick with our own framework. When NetBeans
Platform 4. 0 was released, we were still struggling due to lack of time and funding. I took another look and decided to
integrate with it to solve a little of both our problems. Now we have 15 of our own modules to add to the platform and two
plugins built from LGPL packages! The music modules under the hood are ours, but using an off-the-shelf framework saves time
and money. The result is a complete music platform that is chained from the NetBeans Platform. We have several applications built
on the chained NetBeans Platform. Even now, some of the educational features are just getting designed and coded. </p>
<h3><a name="And_you_are_using_TABMentor_and_NetBeans_to_teach_kids_programming_3F" />And you are using TABMentor and NetBeans
to teach kids programming?</h3>
<p>Yes! My kids wanted to learn computer programming and my 7-year-old son was always asking "So, Dad. . . You workin' on NetBeans?"
Maybe that's a sign that I'm working too much at home! I have been looking around a bit for something appropriate for kids his age, while
still being able to include my 9-year-old daughter. There is a fair amount of material out there geared at teaching kids programming, including
several commercial packages. After reading a few web pages I felt that some of it fell short of the mark for me. I want them to use something
that we can "look under the hood of" and see how it's designed, organized, and put together. </p>
<p class="P6"><span class="T3">I took a cue from the <a href="https://nbjfuguesupport.dev.java.net/">JFugue Music NotePad</a>
and pulled together the bits of my work, an editor, a visual package, etc, and created a Music IDE where the kids can express music as programs.
I am using it to teach them programming concepts including modular design and constructs, everything from "comments" to "functions" and "loops". Once they
have written a bit of their rock opera, they can immediately view it and listen to it. They can see and hear "bugs," and learn the process of
fixing problems. Once they understand how to write programs in this "language," we can look at how the IDE is making it so easy for them. I
have even written a Schliemann grammar to provide the kids with syntax checking in the editor, just like a "real" programming language. I will
let them build UML models of their experience. At least, that's the plan. Only time will tell how it works out! Here's a pic of all of us together: </span></p>
<p><img src="nbm_interviews/peter/class.png" border="1" alt="class">
<h3><a name="Can_you_walk_us_through_an_example_lesson_3F" />Can you walk us through an example lesson?</h3>
<p>I usually start out with a short lecture. Our school has been fortunate and has a nice computer lab, complete
with an overhead projector. I use slides to explain the concepts, and then I tell the kids how the concept can
be seen in music. Here's a sample slide to give you an idea: </p>
<p><img src="nbm_interviews/peter/Lecture.jpg" border="1" alt="lecture">
<p>The kids get to work through an exercise in every class. We started out simple, with "Mary Had a Little Lamb. "
The kids entered it into the IDE's editor. I have used a MultiView TopComponent that lets the kids switch from entering text to viewing their
masterpiece. For more complex programs I let them create files from templates in the IDE, and then I walk them through making changes.
I used the Schliemann API to provide syntax highlighting and grammar checking. The kids are learning how an IDE can show them the mistakes
that they have made in their programs. </p><p>So far we have covered comments, statements, functions, and loops
using repeat marks. We've done everything using the symbols you find in music. Most of the kids have at least a little bit of music background,
and this seems to be working out nicely. </p><p>Here's a sample program the kids can write.</p>
<p><img src="nbm_interviews/peter/SyntaxHilight.jpg" border="1" alt="lecture">
<p>Then they can view their program as sheet music, as shown below, and play it back. They get to hear
and see their program run. </p>
<p><img src="nbm_interviews/peter/MultipleEnding.jpg" border="1" alt="lecture">
<p>That's "F&uuml;r Elise".
<p>Notice the cursor in the 9th measure? It bounces along while the music is played
back, so the kids can follow where the computer is in their program. </p>
<h3><a name="Can_the_IDE_take_music_and_create_the_program_for_them_3F" />Can the IDE take music and create the program for them?</h3>
<p>Remember, this project is about teaching kids the basics of programming first. Then we can move on to the more advanced
ideas like having the IDE create the code for them. The IDE has other TopComponents that allow the user to enter notes graphically,
either by drag and drop or using instruments like the guitar. I haven't told the kids this, but the IDE supports code round trips
for JFugue. If they change their work graphically in the manuscript, the code will be updated in the editor to reflect their changes
when they switch back to the editor view. They can even import MIDI and other music documents, and create JFugue files from them!</p>
<p><img src="nbm_interviews/peter/Guitar.jpg" border="1" alt="lecture">
<h3>
<a name="JFugue_supports_multiple_parts. _Can_your_students_play_more_than_one_part_at_once_3F" />
JFugue supports multiple parts. Can your students play more than one part at once?
</h3>
<p>Yes! Next week I'll introduce the idea of parallel processing with a piece that has multiple parts.
We'll start with a round like "Row, Row, Row Your Boat" that has both multiple parts and repeats. I want them to type in
something so they understand how to start and stop the voices at the right time. Then we'll bring out a masterpiece.
The JFugue website has a <a href="http://www.jfugue.org/exchange.html">Music Exchange page</a> with "Pachelbel's Canon in D" already written as a JFugue input file. I have created a
Template for it that the kids can use. It's a great example that I think the kids will like. </p>
<p><img src="nbm_interviews/peter/MultipleParts.jpg" border="1" alt="lecture">
<p>The IDE lets them look at the piece as a whole, or they can use the Layout Chooser
TopComponent to view just one specific part like the Viola. The chooser slides in from the left side, and automatically hides itself
too, which I think was clever of the NetBeans Platform architects. </p>
<p><img src="nbm_interviews/peter/LayoutChooser.jpg" border="1" alt="lecture">
<h3>
<a name="Will_your_modules_be_open_source_3F" />Will your application be open sourced?
</h3>
<p>CBNX and the Management Sciences projects are commercial applications, so they won't likely be released under LGPL or
GPL. The Music IDE for teaching kids would make a good open source project. Steve teaches full time. I have a full time job and two kids,
so sometimes progress on the software is a little slow. We are eager to get TABMentor out there, but this is a complex application and there
have been issues with our code, and sometimes with Java, that kept us from putting it out there. We know that compromising on quality will only
earn us a bad reputation. I have a short list of outstanding bugs to work through, but with some luck we'll be ready for users soon! Having GPL
developers would help move the process along so we may make this open source. </p>
<h3>
<a name="Hope" />Let's hope that happens! This looks like a great tool for teaching Java! Thanks Peter, for this interview.
</h3>
<!-- ======================================================================================== -->
<h2><a name="nextsteps"></a>Further reading</h2>
<p>For information about creating your own NetBeans Platform applications, see the following resources:
<ul>
<p><li><a href="https://platform.netbeans.org/tutorials/60/nbm-google.html">Introduction to NetBeans Module Development</a></li>
<p><li><a href="https://platform.netbeans.org/tutorials/60/nbm-paintapp.html">Introduction to Rich-Client Application Development</a></li>
<p><li><a href="https://platform.netbeans.org/tutorials/index.html">NetBeans Modules and Rich-Client Applications Learning Trail</a></li>
<p><li><a href="https://netbeans.org/download/dev/javadoc/">NetBeans API Javadoc (Current Development Version)</a></li>
<p><li><a href="http://www.planetnetbeans.org">Blogs by NetBeans Engineers and NetBeans Users</a></li></ul>
</p>
<hr>
<p>
</body>
</html>