Issue1509095

classification
Title: Can't open midi sequencer
Type: Severity: normal
Components: Installer Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, jhodsonking, nobody, rluse
Priority: normal Keywords:

Created on 2006-06-20.07:12:27 by jhodsonking, last changed 2007-12-24.16:59:07 by cgroves.

Messages
msg1167 (view) Author: John Hodgkinson (jhodsonking) Date: 2006-06-20.07:12:27
import javax.sound.midi as midi

sequencer = midi.MidiSystem.getSequencer()
sequencer.open()

fails
TypeError: call of non-function <'int' object> 

John
msg1168 (view) Author: John Hodgkinson (jhodsonking) Date: 2006-07-17.19:47:49
Logged In: YES 
user_id=1542841

The problem arises because
com.sun.media.sound.RealTimeSequencer
inherits a boolean open as well as the method open.
A print of attributes for the object gives the boolean open.
It is not uncommon for Java to have variables and methods
with the same name. Can't Jython handle this situation?
John
msg1169 (view) Author: Nobody/Anonymous (nobody) Date: 2006-11-25.06:00:13
Logged In: NO 

Jython should favor the method over the variable/field

oluoluolu@gmail.gmail.com
msg1170 (view) Author: Bob Luse (rluse) Date: 2007-12-24.11:27:22
Hi,

The following script works just fine on my Windows XP and Jython 2.2.1 :

import javax.sound.midi as midi

sequencer = midi.MidiSystem.getSequencer()
           
print 'got this far'
            
sequencer.open()
    
if sequencer.open:
    print 'sequencer open'
    sequencer.close()
else:
    print 'sequencer not open'

On my system, it handles the difference between the sequencer.open() method and the sequencer.open boolean.  This is handled all the time in Jython.  I can't at all see why it is not working for you and it is working for me.  But I do see that you submitted this a year and a half ago.  So your Jython has to be 2.1, and Java 1.5 had several enhancements in Java Sound.  I am running Java 1.6.0_03 with Jython 2.2.1.

 - Bob
msg1171 (view) Author: Charlie Groves (cgroves) Date: 2007-12-24.16:59:07
Looks like this has worked itself out in the recent versions.
History
Date User Action Args
2006-06-20 07:12:27jhodsonkingcreate