Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow to be imported

- Added main()
  • Loading branch information...
commit 9941a0cacc72a86ecc2b0d76353c526fe7a6525a 1 parent 7c096b0
@ppaez authored
Showing with 32 additions and 28 deletions.
  1. +32 −28 aseqplay.py
View
60 aseqplay.py
@@ -3,31 +3,35 @@
import alsaseq, alsamidi, sys
-dest_cliente = int( sys.argv[1] )
-ruta = sys.argv[2]
-if len(sys.argv) > 3:
- display = sys.argv[3]
-else:
- display = ''
-
-seq = alsamidi.Seq()
-seq.read( ruta )
-eventos = alsamidi.merge( seq.tracks )
-seq.info()
-
-print len( eventos ), 'eventos'
-alsaseq.client( 'Reproductor', 0, 1, 1 )
-alsaseq.connectto( 0, dest_cliente, 0 )
-
-for channel in range( 16 ):
- alsaseq.output( alsamidi.pgmchangeevent( channel, 0 ) )
-
-alsaseq.start()
-
-#eventos = alsamidi.modifyevents( eventos, source = ( 20, 0 ) )
-for evento in eventos:
- if display: print evento
- alsaseq.output( evento )
-
-alsaseq.syncoutput()
-# time.sleep( delay )
+def main():
+ dest_cliente = int( sys.argv[1] )
+ ruta = sys.argv[2]
+ if len(sys.argv) > 3:
+ display = sys.argv[3]
+ else:
+ display = ''
+
+ seq = alsamidi.Seq()
+ seq.read( ruta )
+ eventos = alsamidi.merge( seq.tracks )
+ seq.info()
+
+ print len( eventos ), 'eventos'
+ alsaseq.client( 'Reproductor', 0, 1, 1 )
+ alsaseq.connectto( 0, dest_cliente, 0 )
+
+ for channel in range( 16 ):
+ alsaseq.output( alsamidi.pgmchangeevent( channel, 0 ) )
+
+ alsaseq.start()
+
+ #eventos = alsamidi.modifyevents( eventos, source = ( 20, 0 ) )
+ for evento in eventos:
+ if display: print evento
+ alsaseq.output( evento )
+
+ alsaseq.syncoutput()
+ # time.sleep( delay )
+
+if __name__ == '__main__':
+ main()
Please sign in to comment.
Something went wrong with that request. Please try again.