summaryrefslogtreecommitdiff
path: root/muse2/share/pybridge
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/share/pybridge')
-rw-r--r--muse2/share/pybridge/Makefile.am6
-rw-r--r--muse2/share/pybridge/Makefile.in466
-rw-r--r--muse2/share/pybridge/Pyro_NS_URI1
-rw-r--r--muse2/share/pybridge/examples/addpartexample.py29
-rw-r--r--muse2/share/pybridge/examples/addtrack.py33
-rw-r--r--muse2/share/pybridge/examples/ctrlexample.py26
-rw-r--r--muse2/share/pybridge/examples/effecttoggle.py23
-rw-r--r--muse2/share/pybridge/examples/mute.py20
-rw-r--r--muse2/share/pybridge/examples/repeatpart.py61
-rw-r--r--muse2/share/pybridge/examples/setpositionexample.py35
-rw-r--r--muse2/share/pybridge/examples/tempoexample.py6
-rw-r--r--muse2/share/pybridge/examples/trackparamchangeexample.py21
-rw-r--r--muse2/share/pybridge/musepclient.py17
-rw-r--r--muse2/share/pybridge/museplauncher.py257
-rw-r--r--muse2/share/pybridge/parter/main.py26
-rw-r--r--muse2/share/pybridge/parter/parter.py107
-rw-r--r--muse2/share/pybridge/robert.py46
17 files changed, 1180 insertions, 0 deletions
diff --git a/muse2/share/pybridge/Makefile.am b/muse2/share/pybridge/Makefile.am
new file mode 100644
index 00000000..dc323905
--- /dev/null
+++ b/muse2/share/pybridge/Makefile.am
@@ -0,0 +1,6 @@
+EXTRA_DIST = $(wildcard *.py)
+
+pybridgepkgdata_DATA = $(EXTRA_DIST)
+
+pybridgepkgdatadir = $(pkgdatadir)/pybridge
+
diff --git a/muse2/share/pybridge/Makefile.in b/muse2/share/pybridge/Makefile.in
new file mode 100644
index 00000000..8fe22658
--- /dev/null
+++ b/muse2/share/pybridge/Makefile.in
@@ -0,0 +1,466 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = share/pybridge
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-include.m4 \
+ $(top_srcdir)/m4/alsa.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(pybridgepkgdatadir)"
+DATA = $(pybridgepkgdata_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOKSTYLE = @DOCBOOKSTYLE@
+DOCBOOKTARGETS = @DOCBOOKTARGETS@
+DOT = @DOT@
+DOTPATH = @DOTPATH@
+DOXYGEN = @DOXYGEN@
+DOXYGEN_TREEVIEW = @DOXYGEN_TREEVIEW@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLUIDSYNTHDIRS = @FLUIDSYNTHDIRS@
+FST_CFLAGS = @FST_CFLAGS@
+FST_LIBS = @FST_LIBS@
+Fluidsynth_CFLAGS = @Fluidsynth_CFLAGS@
+Fluidsynth_LIBS = @Fluidsynth_LIBS@
+GIVERTCAP = @GIVERTCAP@
+GREP = @GREP@
+HAVEDOT = @HAVEDOT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JACK_CFLAGS = @JACK_CFLAGS@
+JACK_LIBS = @JACK_LIBS@
+JADE = @JADE@
+LASH_CFLAGS = @LASH_CFLAGS@
+LASH_LIBS = @LASH_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LO_CFLAGS = @LO_CFLAGS@
+LO_LIBS = @LO_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MUSECXXFLAGS = @MUSECXXFLAGS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NSGMLS = @NSGMLS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCH = @PCH@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LIB = @PYTHON_LIB@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+QTDIR_BIN = @QTDIR_BIN@
+QTDIR_INC = @QTDIR_INC@
+QT_LIBS = @QT_LIBS@
+RANLIB = @RANLIB@
+SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
+SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
+SNDFILE_LIBS = @SNDFILE_LIBS@
+STRIP = @STRIP@
+SUIDBUILD = @SUIDBUILD@
+SUIDINSTALL = @SUIDINSTALL@
+USE_SSE = @USE_SSE@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+have_docbook = @have_docbook@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+synth_fluid = @synth_fluid@
+synth_fluidsynth = @synth_fluidsynth@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = $(wildcard *.py)
+pybridgepkgdata_DATA = $(EXTRA_DIST)
+pybridgepkgdatadir = $(pkgdatadir)/pybridge
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu share/pybridge/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu share/pybridge/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-pybridgepkgdataDATA: $(pybridgepkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pybridgepkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pybridgepkgdatadir)"
+ @list='$(pybridgepkgdata_DATA)'; test -n "$(pybridgepkgdatadir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pybridgepkgdatadir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pybridgepkgdatadir)" || exit $$?; \
+ done
+
+uninstall-pybridgepkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pybridgepkgdata_DATA)'; test -n "$(pybridgepkgdatadir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(pybridgepkgdatadir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(pybridgepkgdatadir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(pybridgepkgdatadir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pybridgepkgdataDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pybridgepkgdataDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am \
+ install-pybridgepkgdataDATA install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-pybridgepkgdataDATA
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/muse2/share/pybridge/Pyro_NS_URI b/muse2/share/pybridge/Pyro_NS_URI
new file mode 100644
index 00000000..8e304cc1
--- /dev/null
+++ b/muse2/share/pybridge/Pyro_NS_URI
@@ -0,0 +1 @@
+PYRO://127.0.1.1:9090/7f0001010beb68ea2286bbe6686be546
diff --git a/muse2/share/pybridge/examples/addpartexample.py b/muse2/share/pybridge/examples/addpartexample.py
new file mode 100644
index 00000000..65c41bdf
--- /dev/null
+++ b/muse2/share/pybridge/examples/addpartexample.py
@@ -0,0 +1,29 @@
+"""
+//=========================================================
+// MusE
+// Linux Music Editor
+// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//=========================================================
+"""
+
+import Pyro.core
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+
+#
+# Example on how to insert a new note, outcommented since I run the script several times and it inserts so many notes :-)
+# But it works!
+#
+
+
+rpos = muse.getRPos()
+lpos = muse.getLPos()
+
+event = {'data':[61,100,0],
+ 'tick':0, # Relative offset of part - 0 = beginning of part
+ 'type':"note",
+ 'len':rpos - lpos}
+
+part = {'events': [event],
+ 'tick': lpos}
+muse.createPart("Track 1", lpos, rpos - lpos, part)
+
diff --git a/muse2/share/pybridge/examples/addtrack.py b/muse2/share/pybridge/examples/addtrack.py
new file mode 100644
index 00000000..116b35c0
--- /dev/null
+++ b/muse2/share/pybridge/examples/addtrack.py
@@ -0,0 +1,33 @@
+"""
+//=========================================================
+// MusE
+// Linux Music Editor
+// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//=========================================================
+"""
+
+import Pyro.core
+import time
+
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+
+for j in range(0,5):
+ for i in range(0,30):
+ muse.addMidiTrack("amiditrack" + str(i))
+ for i in range(0,30):
+ muse.deleteTrack("amiditrack" + str(i))
+
+for i in range(0, 10):
+ print i
+ muse.addMidiTrack("amiditrack")
+ muse.addWaveTrack("awavetrack")
+ muse.addOutput("anoutput")
+ muse.addInput("aninput")
+ muse.setMute("aninput", False)
+ muse.setAudioTrackVolume("aninput",1.0)
+ muse.deleteTrack("amiditrack")
+ muse.deleteTrack("awavetrack")
+ muse.deleteTrack("anoutput")
+ muse.deleteTrack("aninput")
+ time.sleep(1)
+
diff --git a/muse2/share/pybridge/examples/ctrlexample.py b/muse2/share/pybridge/examples/ctrlexample.py
new file mode 100644
index 00000000..9e28afad
--- /dev/null
+++ b/muse2/share/pybridge/examples/ctrlexample.py
@@ -0,0 +1,26 @@
+"""
+//=========================================================
+// MusE
+// Linux Music Editor
+// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//=========================================================
+"""
+
+import Pyro.core
+import time
+
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+#for i in range(0,10):
+# print "Ctrl no " + str(i) + " = " + str(muse.getMidiControllerValue("Track 1", i))
+
+"""
+for i in range(0,127):
+ muse.setMidiControllerValue("Track 1", 7, i)
+ time.sleep(0.1)
+"""
+
+muse.setMidiControllerValue("Track 1", 7, 56)
+print muse.getMidiControllerValue("Track 1", 7)
+print muse.getAudioTrackVolume("Out 1")
+muse.setAudioTrackVolume("Out 1", -1.0)
+
diff --git a/muse2/share/pybridge/examples/effecttoggle.py b/muse2/share/pybridge/examples/effecttoggle.py
new file mode 100644
index 00000000..6feb4bca
--- /dev/null
+++ b/muse2/share/pybridge/examples/effecttoggle.py
@@ -0,0 +1,23 @@
+"""
+//=========================================================
+// MusE
+// Linux Music Editor
+// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//=========================================================
+"""
+
+import Pyro.core
+import time
+
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+trackname = "wavtrack"
+
+fxs = muse.getTrackEffects(trackname)
+print fxs
+
+for i in range (0,10):
+ muse.toggleTrackEffect(trackname,0, False)
+ time.sleep(1)
+ muse.toggleTrackEffect(trackname,0, True)
+ time.sleep(1)
+
diff --git a/muse2/share/pybridge/examples/mute.py b/muse2/share/pybridge/examples/mute.py
new file mode 100644
index 00000000..5732a7f8
--- /dev/null
+++ b/muse2/share/pybridge/examples/mute.py
@@ -0,0 +1,20 @@
+"""
+//=========================================================
+// MusE
+// Linux Music Editor
+// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//=========================================================
+"""
+
+import Pyro.core
+import time
+
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+for i in range(0,10):
+ muse.setMute("Strings", False)
+ muse.setMute("Lead1", True)
+ time.sleep(1)
+ muse.setMute("Strings", True)
+ muse.setMute("Lead1", False)
+ time.sleep(1)
+
diff --git a/muse2/share/pybridge/examples/repeatpart.py b/muse2/share/pybridge/examples/repeatpart.py
new file mode 100644
index 00000000..e2b8ff31
--- /dev/null
+++ b/muse2/share/pybridge/examples/repeatpart.py
@@ -0,0 +1,61 @@
+"""
+//=========================================================
+// MusE
+// Linux Music Editor
+// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//=========================================================
+"""
+
+import Pyro.core
+import sys
+import time
+
+SLEEPIVAL=0.3
+
+def advanceToNextSection(muse, newlpos, newrpos):
+ print "Advancing..."
+ currpos = muse.getRPos()
+ curlpos = muse.getLPos()
+ curpos = muse.getCPos()
+ muse.setLoop(False)
+
+ while curpos < currpos:
+ time.sleep(SLEEPIVAL)
+ curpos = muse.getCPos()
+ print "Leaving current section..."
+ muse.setRPos(newrpos)
+ curpos = muse.getCPos()
+
+ while curpos < newlpos:
+ time.sleep(SLEEPIVAL)
+ curpos = muse.getCPos()
+ print "Entered new section"
+ muse.setLPos(newlpos)
+ muse.setLoop(True)
+ return
+
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+muse.stopPlay()
+parts = muse.getParts("Track 1")
+muse.setLPos(parts[0]['tick'])
+muse.setRPos(parts[0]['tick'] + parts[0]['len'])
+muse.setCPos(0)
+time.sleep(0.2) # Hmmm, don't like it but it seems necessary to pause a short while before starting play
+muse.setLoop(True)
+muse.startPlay()
+
+for i in range(1, len(parts)):
+ part = parts[i]
+ tick = part['tick']
+ len = part['len']
+ print "Press enter to advance to next section/part!"
+ sys.stdin.read(1)
+ advanceToNextSection(muse, tick, tick + len)
+
+print "This is the final section. Disabling loop and leaving..."
+muse.setLoop(False)
+
+#print "Press enter to leave final section"
+#sys.stdin.read(1)
+#muse.setLoop(False)
+
diff --git a/muse2/share/pybridge/examples/setpositionexample.py b/muse2/share/pybridge/examples/setpositionexample.py
new file mode 100644
index 00000000..476410d9
--- /dev/null
+++ b/muse2/share/pybridge/examples/setpositionexample.py
@@ -0,0 +1,35 @@
+"""
+//=========================================================
+// MusE
+// Linux Music Editor
+// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//=========================================================
+"""
+
+import Pyro.core
+import time
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+parts = muse.getParts("Track 1")
+
+ptick = parts[0]['tick']
+len = parts[0]['len']
+muse.setLPos(ptick)
+muse.setRPos(ptick + len)
+muse.setCPos(ptick + len / 2)
+
+songlen = muse.getSongLen()
+#print "Song length: " + str(songlen)
+
+#
+# Copy first part to after current song length, thus increase song length with length of first part
+#
+newsonglen = songlen + parts[0]['len']
+muse.setSongLen(newsonglen)
+muse.createPart("Track 1", songlen + 1, parts[0]['len'], parts[0])
+time.sleep(1)
+
+lastpart = muse.getParts("Track 1").pop()
+print lastpart['id']
+muse.deletePart(lastpart['id'])
+print muse.getDivision()
+
diff --git a/muse2/share/pybridge/examples/tempoexample.py b/muse2/share/pybridge/examples/tempoexample.py
new file mode 100644
index 00000000..ed12638d
--- /dev/null
+++ b/muse2/share/pybridge/examples/tempoexample.py
@@ -0,0 +1,6 @@
+import Pyro.core
+
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+
+print "Tempo: " + str(muse.getTempo(0))
+
diff --git a/muse2/share/pybridge/examples/trackparamchangeexample.py b/muse2/share/pybridge/examples/trackparamchangeexample.py
new file mode 100644
index 00000000..0681ccb4
--- /dev/null
+++ b/muse2/share/pybridge/examples/trackparamchangeexample.py
@@ -0,0 +1,21 @@
+"""
+//=========================================================
+// MusE
+// Linux Music Editor
+// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//=========================================================
+"""
+import Pyro.core
+import time
+
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+
+muse.setMidiTrackParameter("Track 1", "velocity",10)
+muse.setMidiTrackParameter("Track 1", "compression",101)
+muse.setMidiTrackParameter("Track 1", "delay",2)
+muse.setMidiTrackParameter("Track 1", "transposition",1)
+
+for i in range(-127, 127):
+ muse.setMidiTrackParameter("Track 1", "velocity",i)
+ time.sleep(0.1)
+
diff --git a/muse2/share/pybridge/musepclient.py b/muse2/share/pybridge/musepclient.py
new file mode 100644
index 00000000..dc87e4e8
--- /dev/null
+++ b/muse2/share/pybridge/musepclient.py
@@ -0,0 +1,17 @@
+#
+# Example client for MusE Pyro bridge (Python Remote Object)
+#
+import Pyro.core
+import time
+
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+print "Current position is: " + str(muse.getCPos())
+muse.startPlay()
+time.sleep(1) # Sleep one second
+muse.stopPlay()
+print "New position is: " + str(muse.getCPos())
+muse.rewindStart()
+print "Pos after rewind is: " + str(muse.getCPos())
+print "Lpos, Rpos: " + str(muse.getLPos()) + ":" + str(muse.getRPos())
+
+
diff --git a/muse2/share/pybridge/museplauncher.py b/muse2/share/pybridge/museplauncher.py
new file mode 100644
index 00000000..24206213
--- /dev/null
+++ b/muse2/share/pybridge/museplauncher.py
@@ -0,0 +1,257 @@
+"""
+//=========================================================
+// MusE
+// Linux Music Editor
+// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//=========================================================
+
+This file is used by MusE for launching a Pyro name service and connecting a remote object to the global Python functions
+"""
+
+import Pyro.naming
+import Pyro.core
+from Pyro.errors import PyroError,NamingError
+import sys, time
+import threading
+
+#
+# Note: this module, 'muse' is activated from within MusE - thus it is not possible to execute the scripts without a running
+# MusE instance
+#
+import muse
+
+#
+# Class which implements the functionality that is used remotely.
+# In short just repeating the global functions in the muse-module
+#
+# TODO: It should be better to skip this class completely by implementing
+# functionality as a class in pyapi.cpp instead of global functions
+# that need to be wrapped like this
+#
+class MusE:
+ def getCPos(self): # Get current position
+ return muse.getCPos()
+
+ def startPlay(self): # Start playback
+ return muse.startPlay()
+
+ def stopPlay(self): # Stop playback
+ return muse.stopPlay()
+
+ def rewindStart(self): # Rewind current position to start
+ return muse.rewindStart()
+
+ def getLPos(self): # Get position of left locator
+ return muse.getLPos()
+
+ def getRPos(self): # Get position of right locator
+ return muse.getRPos()
+
+ def getTempo(self, tick): #Get tempo at particular tick
+ return muse.getTempo(tick)
+
+ def getTrackNames(self): # get track names
+ return muse.getTrackNames()
+
+ def getParts(self, trackname): # get parts in a particular track
+ return muse.getParts(trackname)
+
+ def createPart(self, trackname, starttick, lenticks, part): # create part in track
+ return muse.createPart(trackname, starttick, lenticks, part)
+
+ def modifyPart(self, part): # modify a part (the part to be modified is specified by its id
+ return muse.modifyPart((part))
+
+ def deletePart(self, part): # delete a part
+ return muse.deletePart((part))
+
+ def getSelectedTrack(self): # get first selected track in arranger window
+ return muse.getSelectedTrack()
+
+ def importPart(self, trackname, filename, tick): # import part file to a track at a given position
+ return muse.importPart(trackname, filename, tick)
+
+ def setCPos(self, tick): # set current position
+ return muse.setPos(0, tick)
+
+ def setLPos(self, tick): # set left locator
+ return muse.setPos(1, tick)
+
+ def setRPos(self, tick): # set right locator
+ return muse.setPos(2, tick)
+
+ def setSongLen(self, ticks): # set song length
+ return muse.setSongLen(ticks)
+
+ def getSongLen(self): # get song length
+ return muse.getSongLen()
+
+ def getDivision(self): # get division (ticks per 1/4, or per beat?)
+ return muse.getDivision()
+
+ def setMidiTrackParameter(self, trackname, paramname, value): # set midi track parameter (velocity, compression, len, transpose)
+ return muse.setMidiTrackParameter(trackname, paramname, value);
+
+ def getLoop(self): # get loop flag
+ return muse.getLoop()
+
+ def setLoop(self, loopFlag): # set loop flag
+ return muse.setLoop(loopFlag)
+
+ def getMute(self, trackname): # get track mute parameter
+ return muse.getMute(trackname)
+
+ def setMute(self, trackname, enabled): # set track mute parameter
+ return muse.setMute(trackname, enabled)
+
+ def setVolume(self, trackname, volume): # set mixer volume
+ return muse.setVolume(trackname, volume)
+
+ def getMidiControllerValue(self, trackname, ctrlno): # get a particular midi controller value for a track
+ return muse.getMidiControllerValue(trackname, ctrlno)
+
+ def setMidiControllerValue(self, trackname, ctrlno, value): # set a particular midi controller value for a track
+ return muse.setMidiControllerValue(trackname, ctrlno, value)
+
+ def setAudioTrackVolume(self, trackname, dvol): # set volume for audio track
+ return muse.setAudioTrackVolume(trackname, dvol)
+
+ def getAudioTrackVolume(self, trackname): # get volume for audio track
+ return muse.getAudioTrackVolume(trackname)
+
+ def getTrackEffects(self, trackname): # get effect names for an audio track
+ return muse.getTrackEffects(trackname)
+
+ def toggleTrackEffect(self, trackname, effectno, onoff): # toggle specific effect on/off
+ return muse.toggleTrackEffect(trackname, effectno, onoff)
+
+ def findNewTrack(self, oldtracknames): #internal function
+ tracknames = muse.getTrackNames()
+ for trackname in tracknames:
+ if trackname in oldtracknames:
+ continue
+
+ return trackname
+
+ def changeTrackName(self, trackname, newname): #change track name
+ return muse.changeTrackName(trackname, newname)
+
+ def nameNewTrack(self, newname, oldtracknames):# Internal function, wait until new track shows up in tracknames, then rename it
+ tmpname = None
+ for i in range(0,100):
+ tmpname = self.findNewTrack(oldtracknames)
+ if tmpname == None:
+ time.sleep(0.1)
+ continue
+ else:
+ self.changeTrackName(tmpname, newname)
+ time.sleep(0.1) # Ouch!!
+ break
+
+
+ def addMidiTrack(self, trackname): # add midi track
+ oldtracknames = muse.getTrackNames()
+ if trackname in oldtracknames:
+ return None
+
+ muse.addMidiTrack()
+ self.nameNewTrack(trackname, oldtracknames)
+
+
+ def addWaveTrack(self, trackname): # add wave track
+ oldtracknames = muse.getTrackNames()
+ if trackname in oldtracknames:
+ return None
+
+ muse.addWaveTrack()
+ self.nameNewTrack(trackname, oldtracknames)
+
+ def addInput(self, trackname): # add audio input
+ oldtracknames = muse.getTrackNames()
+ if trackname in oldtracknames:
+ return None
+
+ muse.addInput()
+ self.nameNewTrack(trackname, oldtracknames)
+
+ def addOutput(self, trackname): # add audio output
+ oldtracknames = muse.getTrackNames()
+ if trackname in oldtracknames:
+ return None
+
+ muse.addOutput()
+ self.nameNewTrack(trackname, oldtracknames)
+
+ def addGroup(self, trackname): # add audio group
+ oldtracknames = muse.getTrackNames()
+ if trackname in oldtracknames:
+ return None
+
+ muse.addGroup()
+ self.nameNewTrack(trackname, oldtracknames)
+
+ def deleteTrack(self, trackname): # delete a track
+ tracknames = muse.getTrackNames()
+ if trackname not in tracknames:
+ return False
+
+ muse.deleteTrack(trackname)
+
+# def getOutputRoute(self, trackname):
+# return muse.getOutputRoute(trackname)
+
+class NameServiceThread(threading.Thread):
+ def __init__(self):
+ threading.Thread.__init__(self)
+ self.starter = Pyro.naming.NameServerStarter()
+
+ def run(self):
+ self.starter.start()
+
+ def verifyRunning(self):
+ return self.starter.waitUntilStarted(10)
+
+#
+# museclass Pyro object
+#
+class museclass(Pyro.core.ObjBase, MusE):
+ pass
+
+#
+# main server program
+#
+def main():
+ Pyro.core.initServer()
+ nsthread = NameServiceThread()
+ nsthread.start()
+ if (nsthread.verifyRunning() == False):
+ print "Failed to launch name service..."
+ sys.exit(1)
+
+ daemon = Pyro.core.Daemon()
+ # locate the NS
+ locator = Pyro.naming.NameServerLocator()
+ #print 'searching for Name Server...'
+ ns = locator.getNS()
+ daemon.useNameServer(ns)
+
+ # connect a new object implementation (first unregister previous one)
+ try:
+ # 'test' is the name by which our object will be known to the outside world
+ ns.unregister('muse')
+ except NamingError:
+ pass
+
+ # connect new object implementation
+ daemon.connect(museclass(),'muse')
+
+ # enter the server loop.
+ print 'Muse remote object published'
+ daemon.requestLoop()
+
+if __name__=="__main__":
+ main()
+
+main()
+
+
diff --git a/muse2/share/pybridge/parter/main.py b/muse2/share/pybridge/parter/main.py
new file mode 100644
index 00000000..40b85734
--- /dev/null
+++ b/muse2/share/pybridge/parter/main.py
@@ -0,0 +1,26 @@
+import sys,time
+from PyQt4 import QtGui
+
+from parter import ParterMainwidget
+import sys, os
+import Pyro.core
+
+#import musemock
+#muse = musemock.MusEMock()
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+"""
+strack = muse.getSelectedTrack()
+cpos = muse.getCPos()
+muse.importPart(strack, "/home/ddskmlg/.muse/parts/testpart2.mpt", cpos)
+sys.exit(0)
+"""
+
+
+if __name__ == '__main__':
+ app = QtGui.QApplication(sys.argv)
+ partsdir = os.getenv("HOME") + "/.muse/parts"
+ mainw = ParterMainwidget(None, muse, partsdir)
+ mainw.show()
+ #muse.importPart("Track 1","/home/ddskmlg/.muse/parts/testpart2.mpt",18432)
+ sys.exit(app.exec_())
+
diff --git a/muse2/share/pybridge/parter/parter.py b/muse2/share/pybridge/parter/parter.py
new file mode 100644
index 00000000..889b00a1
--- /dev/null
+++ b/muse2/share/pybridge/parter/parter.py
@@ -0,0 +1,107 @@
+import sys,time,os
+from PyQt4 import QtGui, QtCore
+from PyQt4.QtGui import QFileDialog, QListView, QStringListModel, QButtonGroup, QPushButton
+
+class ParterMainwidget(QtGui.QWidget):
+ def __init__(self, parent=None, muse=None, partsdir=None):
+ QtGui.QWidget.__init__(self, parent)
+ self.muse = muse
+ self.partsdir = partsdir
+ self.lcurdir = QtGui.QLabel(partsdir)
+ moveupbutton = QPushButton("Parent dir")
+ appendbutton = QPushButton("Append")
+ putbutton = QPushButton("Put")
+ blayout = QtGui.QGridLayout()
+ blayout.addWidget(self.lcurdir)
+ blayout.addWidget(moveupbutton)
+ blayout.addWidget(appendbutton)
+ blayout.addWidget(putbutton)
+ self.tree = QtGui.QTreeView()
+ self.dirmodel = QtGui.QDirModel()
+ self.tree.setModel(self.dirmodel)
+ self.tree.setRootIndex(self.dirmodel.index(self.partsdir))
+
+ layout = QtGui.QGridLayout()
+ self.setLayout(layout)
+ layout.addWidget(self.tree, 0, 0)
+ layout.addLayout(blayout, 0, 1)
+
+ self.connect(moveupbutton, QtCore.SIGNAL('clicked()'), self.parentDir)
+ self.connect(appendbutton, QtCore.SIGNAL('clicked()'), self.appendPressed)
+ self.connect(putbutton, QtCore.SIGNAL('clicked()'), self.putPressed)
+
+ self.connect(self.tree, QtCore.SIGNAL('activated(QModelIndex)'), self.activated)
+
+ def parentDir(self):
+ f = QtCore.QFileInfo(self.partsdir)
+ self.changeDir(f.canonicalPath())
+
+ def changeDir(self, newdir):
+ self.partsdir = newdir
+ self.tree.setRootIndex(self.dirmodel.index(self.partsdir))
+ self.lcurdir.setText(self.partsdir)
+
+ def activated(self, s):
+ fileInfo = self.dirmodel.fileInfo(s)
+ if fileInfo.isDir():
+ self.changeDir(fileInfo.absoluteFilePath())
+ return
+
+ fname = str(fileInfo.absoluteFilePath()) # if not str() around it crashes!
+ self.putPart(fname)
+
+ def putPart(self, fname):
+ trackid = self.muse.getSelectedTrack()
+ if trackid == None:
+ return
+ cpos = self.muse.getCPos()
+ self.muse.importPart(trackid, fname, cpos)
+
+ def getSelectedItem(self):
+ selectionmodel = self.tree.selectionModel()
+ for i in selectionmodel.selectedIndexes():
+ fileInfo = self.dirmodel.fileInfo(i)
+ return str(fileInfo.absoluteFilePath())
+ return None
+
+ def appendPressed(self):
+ selected = self.getSelectedItem()
+ if selected == None:
+ return
+ trackid = self.muse.getSelectedTrack()
+ if trackid == None:
+ return
+ parts = self.muse.getParts(trackid)
+ if parts == None:
+ return
+
+ pos = 0
+ if len(parts) > 0:
+ part = parts[len(parts) - 1]
+ pos = part['tick'] + part['len']
+ print "Appending " + selected
+ self.muse.importPart(trackid, selected, pos)
+
+
+
+ def putPressed(self):
+ selected = self.getSelectedItem()
+ if selected == None:
+ return
+ trackid = self.muse.getSelectedTrack()
+ if trackid == None:
+ return
+ cpos = self.muse.getCPos()
+ self.muse.importPart(trackid, selected, cpos)
+
+ def testfunc2(self, index):
+ print str(index.row()) + " " + str(index.column())
+ print index.data().toString()
+
+if __name__ == '__main__':
+ app = QtGui.QApplication(sys.argv)
+ mainw = ParterMainwidget()
+ mainw.show()
+ sys.exit(app.exec_())
+
+
diff --git a/muse2/share/pybridge/robert.py b/muse2/share/pybridge/robert.py
new file mode 100644
index 00000000..2de8e1ab
--- /dev/null
+++ b/muse2/share/pybridge/robert.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+#
+# Example client for MusE Pyro bridge (Python Remote Object)
+#
+import Pyro.core
+import time
+
+muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
+print "Current position is: " + str(muse.getCPos())
+
+midiDevice=file("/dev/snd/midiC1D0")
+nextIsCommand=False
+while True:
+ v=midiDevice.read(1)
+ if nextIsCommand:
+ print " %d"%ord(v)
+ if ord(v) == 0:
+ print "set hh"
+ muse.setMute("hh", False)
+ muse.setMute("RIDE", True)
+ if ord(v) == 1:
+ muse.setMute("hh", True)
+ muse.setMute("RIDE", False)
+ print "set ride"
+ if ord(v) == 2:
+ muse.setMute("ACCENT1", False)
+ if ord(v) == 3:
+ muse.setMute("ACCENT2", False)
+ if ord(v) == 127:
+ print "mute all accents"
+ muse.setMute("ACCENT1", True)
+ muse.setMute("ACCENT2", True)
+ nextIsCommand=False
+ if ord(v) == 192:
+ nextIsCommand=True
+
+'''
+muse.startPlay()
+time.sleep(1) # Sleep one second
+muse.stopPlay()
+print "New position is: " + str(muse.getCPos())
+muse.rewindStart()
+print "Pos after rewind is: " + str(muse.getCPos())
+print "Lpos, Rpos: " + str(muse.getLPos()) + ":" + str(muse.getRPos())
+
+'''