electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » Clavia Nord Modular » Nomad - NM1 Open Source Editor
Setting up a nomad debug environmment on windows (vista)
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 2 of 3 [66 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2, 3 Next
Author Message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 12:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

Added the latter as an external jar as well, and then I have one problem left :

Project nomad is missing required javea project "nmlibs", seems like a misconfiguration?

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 12:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

I just removed nmlibs from the projects tab in the java build path thingy .... andthen I get another error :

the project wa not built since its build path is incomplete. Cannot find the class file for java.lang.Object Shocked that seems a fundamental thing wrong in my setup Laughing

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 12:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:

the project wa not built since its build path is incomplete. Cannot find the class file for java.lang.Object Shocked that seems a fundamental thing wrong in my setup Laughing


Laughing

Go to Nomad project properties -> java build path -> libraries
There should be an entry like for example
JRE System Library [sun-jdk-1.6.0]

If the entry is either wrong or missing klick on the "Add Library..." button,
choose JRE System Library and choose one of the provided options (Usually this is the Workspace default JRE Option). Make sure to pick a version >=1.5

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 1:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Told you it was a fundametal thingie Laughing

Ok, now I got 134 warnings ... that'better ... now when I try to run it's complaining about /nomad/nomad-source/net.sf.nmedit.nomad.boot.splash/dist/lib/nomad-splash.jar it is said to not exist ... but it is present and just sitting there smiling at me Rolling Eyes

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 1:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

The warnings can be ignored - I have them too.

As for the nomad-splash.jar problem try Project->Clean and/or right click on Project-> Refresh and the run Nomad again. By the way, is the error in the console tab ? (Then show me the output)

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 1:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

It runs drunken
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 1:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

And it debugs drunken

Right ... now I better start to understand what's going on, I looked at it a couple of years ago, it was pretty complicated and it looks like it still is ...

Thank you Christian, this would have takemn me a week without your help.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 1:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
It runs drunken

Great Smile
Yes, the configuration takes a while - I plan to simplify some things to make this easier in the future.

As I mentioned before, when you modify one of the libraries in libs/ you have to run ant configure afterwards to copy the changes into the plugin directories. But since you are using eclipse there is a way avoiding the ant configure step.

For example if you want to modify the jpdl2 library then lookup the appropriate plugin.xml file - in this case
nomad/nomad-source/plugins/net.sf.nmedit.jpdl2/plugin.xml

The file contains the reference to the jar file copied by "ant configure" but you can use relative paths and point directly to the appropriate bin directory.

I am sorry but I can give you no example since this forum messes up the xml code. But most of the plugin.xml files contain both references to the jar files and to the relative bin/ location (one of both is commented out).

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 1:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

chresan wrote:
this forum messes up the xml code.


Even when you disable HTML for your post?

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 1:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
Even when you disable HTML for your post?

Oops, I missed this option. It works fine when html is disabled.

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 1:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

One more question for now .. how do I continue debugging after an exception stopped execution?
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 1:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
... Thank you Christian, this would have taken me a week without your help.

You are welcome. Also I am verry happy to have more helping hands in the nomad project.

At this point I think I should explain you the libraries so you get a basic understanding where to find things.

First, the project is highly modular. In fact you can use the libraries (jpdl nordmodular, jtheme, jpatch, ...) as standalone libs - they don't depend on the nomad application. (this is why they are separated from the nomad project)

Here is a short overview of the libraries:
jsynth - API to create a representation of synthesizer, ports (midi ports), slots, banks
jpatch - API to implement custom patch format + simple implementation + modules can be defined using xml
jtheme - swing classes for Knobs, Buttons, Displays, ... + builder to create user interfaces from XML files
nmutils - mixed/shared stuff required by these libraries
patchmodifier - randomizer, patch mutator
jpdl2 - protocol definition language
codecs - contains the midi.pdl2, patch.pdl2 protocol definition files
jnmprotocol - nordmodular message classes, communication stuff

nordmodular -
This library contains implementations of jsynth/jpatch for the nord modular synth. It uses jtheme to create the patch user interface.

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 1:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
One more question for now .. how do I continue debugging after an exception stopped execution?


Are you in the debug perspective ? (If not select in the menu Window->Open Perspective->Debug)

There you should have different debug controls like "Resume", Step Into, Step Over, ...

Also a very nice feature is that you can modify the code at runtime (There should be a popup asking you to swap in changes).

Edit: I attached a screenshot of the debug perspective.


nomad-eclipse-debug.png
 Description:
eclipse debugging
 Filesize:  125.29 KB
 Viewed:  267 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

nomad-eclipse-debug.png



_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 2:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yes I'm using the debug view, I looked in the wrong toolbar, I remember the icons now from a previous time I used Eclipse, for some reason I did not see them but I had been looking in the run menu and that one ha them as well now ... don't know what went wrong before then, I started the debug in a different way ...

are all timeout in ms?

I get a value of 120 742 860 496 when I break in SchedulingProtocol( ).heartbeatImpl() which seems a bit much ... like uninitialized (which should not be the case, the constructor sets it to zero) ...

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 2:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

The timeout is thrown in the method heartbeatImpl() (in class net.sf.nmedit.jnmprotocol2.NmProtocol )

The timeout value in the exception in fact is the threshold when a timeout occurs. The value is in milliseconds and is initialised using System.currentTimeMillis() + TIMEOUT_INTERVAL.

I believe on windows the system.currentTimeMillis returns the time in milliseconds since the os was started.

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 3:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

A thing that seems note worthy is that while the program is waiting for a reply in the connect method only light messages are coming in from the synth and not the expected message type, so this may be an issue with a patch that is "too complicated"
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 3:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Which messages are sent to the synth before the exception occurs ?

Perhaps modify the method void send(MidiMessage midiMessage) throws MidiException in class AbstractNmProtocol:

Code:
    public void send(MidiMessage midiMessage) throws MidiException
    {
        System.out.println("send: "+midiMessage);
        BitStream stream = midiMessage.getBitStream();
....
}

and show me a copy of the console output.

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 3:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

By the way, in class AbstractNmProtocol is a method
byte[] getNextReceivedSysexBytes() which tries to fix some sysex problems and might contain a bug.

Also the method MidiMessage.create() calls the method BitStream ensureIsValidSysex(BitStream stream) . Try to check if the method returns null at some point. Then the method is either buggy or the midi message is invalid.

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 3:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hmm, yes will do that, but meanwhile I made an empty patch to make things simpler, and the light message are gone and still things time out, so the lights are not the issue.

Is there a good point to set a similar log on reception? Preferrably beforethe bytes have been assembled into messages.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 3:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

It sends one IAmMessage now and then it times out.
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 3:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

The class AbstractNmProtocol contains the method
Code:
    protected void received(byte[] data)

The method is called each time the synth sends messages, the argument contains the message in its raw (unmodified) form.

To print the hex dump modify it:
Code:
protected void received(byte[] data)
    {
        System.out.println("received (raw): "+PDLUtils.toHexadecimal(data));
       
        synchronized (receiveLock)
        {
            receivedQueue.offer(data);
        }
        activity();
    }


Later the jnmprotocol messages are created in MidiMessage.create(BitStream) where the BitStream argument contains the raw message (or the modified message).

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 3:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hm, interesting that the problem happens directly after the IAMmessage was sent.

The application flow is when Nordmodular.connect() is called it sends an IAMMessage (which identifies the editor) - then as reply the synth must send an IAMMessage to identifying itself.

This means that
- the IAM from the editor is sent but discarded somewhere between JDK->Vista (this is the most unlikely case in my opinion) since the synth does not receive the IAM message it does not send an reply
- the synth sends no IAM reply (also unlikely, otherwise the clavia editor would not work)
- the synth sends an IAM reply which is not supported by the protocol or is corrupted at some point

My tip is the last point, to debug this look especially in the MidiMessage.create method what happens. Does it throw an exception, is it even called ?

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 3:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

I must import something to be able to use PDLUtils I guess, but I used a simple "received: <something>" printout instead to see if I get any reception at all.

And indeed I do not receive anything at all.

I'm pretty sure though that I did have reception when I had the complicated patch loaded, so apparently the IAmMessage gets lost or something, or the reply on it of course .. but that seems less likely.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24489
Location: The Netherlands, Enschede
Audio files: 298
G2 patch files: 320

PostPosted: Sat Apr 05, 2008 4:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, I can confirm that reception is possible, I loaded a complicated patch again and now I get the "recv : <something>" message printing and also the accept() method in NmMessageAcceptor.java (where I had a breakpoint) was hit.

Edit : in NmMessageAcceptor.accept() I mean.

Edit : fixed some typos

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
chresan



Joined: Jul 11, 2006
Posts: 150
Location: Karlsruhe, Germany

PostPosted: Sat Apr 05, 2008 4:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
I must import something to be able to use PDLUtils I guess, but I used a simple "received: <something>" printout instead to see if I get any reception at all.

You can set the cursor behind PDLUtils and then press CTRL+Space - this will show the autocompletition window. Or just add the import statement manually

Code:
import net.sf.nmedit.jpdl2.utils.PDLUtils;



Quote:
And indeed I do not receive anything at all.

I'm pretty sure though that I did have reception when I had the complicated patch loaded, so apparently the IAmMessage gets lost or something, or the reply on it of course .. but that seems less likely.


Quote:
Ok, I can confirm that reception is possible, I loaded a complicated patch again and now I get the "recv : <somthing>" message printing and alos the accept() method in NmMessageAcceptor.jave (where I had a breakpoint) was hit.


That's good to hear. Otherwise it would be a bug in the Java midi code. But store the empty patch in the synth again so you have not too much "junk" messages.

Then take a look at the inner class ProtocolReceiver in AbstractNmProtocol. This class implements the Receiver interface from javax.sound. This is the lowest level we can observe.

What happens in
public void send(javax.sound.midi.MidiMessage message, long timeStamp) ?
- Is the method invoked
- Is there an exception:
you can wrap the whole method body like this
try
{
... method body...
} catch (Throwable t)
{
t.printStackTrace();
}

And also interesting to know would be if
public void close()
is called at some point. This should not happen, but when it does then send() will not be called anymore.

_________________
----------------------
http://nmedit.sf.net
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 2 of 3 [66 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2, 3 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Clavia Nord Modular » Nomad - NM1 Open Source Editor
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use