Noteedit tse3 fluidsynth
mandrake 10.0/9.2
Comment faire pour faire fonctionner
noteedit sans carte midi avec une
mandrake 9.2/10
Il faut d'abord:
alsa
fluidsynth
des soundfonts: http://inanna.ecs.soton.ac.uk/~swh/fluid-unpacked/
Ensuite
telecharger le paquetage source de tse3 (mandrake 10.0 ET mandrake 9.2):
http://mandril.creatis.insa-lyon.fr/linux/Mandrake/current/contrib/SRPMS/tse3-0.2.7-4mdk.src.rpm
**********sous root***************
la librairie tse3 fournie par mandrake ne reconnaît pas la
présence d'alsa (je ne sais pourquoi) il faut donc la recompiler
en installant les sources d'alsa auparavant:
urpmi libalsa2 libalsa2-devel
(mdk10 et 9.2)
ou bien
urpmi libalsa2-1.0.2-3mdk
libalsa2-devel-1.0.2-3mdk (mdk10)
urpmi
libalsa2-devel-0.9.6-3mdk libalsa2-devel-0.9.6-3mdk (mdk
9.2)
installer arts et ses sources si ce n'est déjà fait:
urpmi arts libarts-devel
ou bien:
urpmi arts-1.2-3mdk
libarts-devel1.2-3mdk (mdk 10)
urpmi arts-1.1.3-7mdk
libarts1-devel-1.1.3-7mdk (mdk 9.2)
Ensuite il faut reconstruire tse3 à partir des sources, la
procédure diffère selon la version de mandrake en raison
du changement de kernel (2.4 --> 2.6)
mdk 9.2:
rpm --rebuild
tse3-0.2.7-4mdk.src.rpm
urpmi
/usr/src/RPM/RPMS/i586/*tse3*rpm
*****debut mandrake 10.0***********************
mdk 10.0:
Il faut modifier le source contenu dans le src.rpm, le reconstruire et
enfin l'installer:
Je recommande la lecture du mandrake rpm howto:
http://qa.mandrakesoft.com/twiki/bin/view/Main/RpmHowTo
Pour ce qui nous concerne:
SE CONNECTER SOUS UN UTILISATEUR AUTRE QUE ROOT
SE PLACER DANS LE REPERTOIRE $HOME
Configuration, création des répertoires et installation
des sources
mkdir rpm ~rpm/SOURCES
~rpm/SPECS ~rpm/BUILD ~/rpm/RPMS
~/rpm/RPMS/i586 ~/rpm/RPMS/noarch ~/rpm/SRPMS ~/rpm/tmp
créer 2 fichiers de configuration .rpmrc et .rpmmacros dans
$HOME:
.rpmrc:
buildarchtranslate: i386: i586
buildarchtranslate: i486: i586
buildarchtranslate: i586: i586
buildarchtranslate: i686: i586
.rpmmacros:
%_topdir
YOUR_HOME_DIR/rpm
%_tmppath
YOUR_HOME_DIR/rpm/tmp
%_signature
gpg
%_gpg_name
Mandrakelinux
%_gpg_path
~/.gnupg
%distribution
Mandrakelinux
%vendor
Mandrakesoft
Enfin on peut installer le src.rpm dans ce repertoire utilisateur et le
modifier comme on veut:
rpm -i tse3-0.2.7-4mdk.src.rpm
ceci installe les fichiers suivants:
~rpm/SPECS/tse3.spec
~rpm/SRPM/tse3-0.2.7-4mdk.src.rpm
~rpm/SOURCES/tse3-0.2.7.tar.bz2
Modification du code de tse3
Explication:
La dernière version de tse3 remonte à mars 2003, bien
avant l'arrivée du kernel 2.6.
Elle ne reconnaît donc que les version 0.5xxx et 0.9xxx d'alsa,
or mandrake 10.0 comporte la version 1.0
Il faut donc modifier le fichier tse3-0.2.7/configure.in pour
qu'il reconnaisse la version 1.0 d'alsa.
Décompression des sources de tse3:
cd $HOME/rpm/SOURCES
tar -xvjf tse3-0.2.7.tar.bz2
cd tse3-0.2.7/
Ouvrir configure.in dans votre éditeur favori et rechercher les
lignes suivantes:
/****debut code****/
#
----------------------------------------------------------------------------
# Checks for ALSA library support
# 1. Check whether ALSA is there
have_alsa="no"
AC_DEFUN(AC_CHECK_LIBASOUND,
[
dnl Alsa headers?
alsa_header_prefix="NONE"
AC_CHECK_HEADER(sys/asoundlib.h, alsa_header_prefix="sys")
AC_CHECK_HEADER(alsa/asoundlib.h, alsa_header_prefix="alsa")
ac_ldflags_save="$LDFLAGS"
LDFLAGS="$all_libraries $LDFLAGS"
LIBASOUND=""
if test "x$alsa_header_prefix" != "xNONE"; then
dnl Alsa library exists?
AC_CHECK_LIB(asound,snd_seq_create_simple_port,[
AC_TRY_RUN([
#include <$alsa_header_prefix/asoundlib.h>
int main() { return SND_LIB_MINOR != 5 && SND_LIB_MINOR != 9; }
] ,[
have_alsa="yes"
LIBASOUND="-lasound"
AC_DEFINE(HAVE_ALSA, 1,
[Define if you
have libasound (required for alsa support)])
], [ have_alsa="no" ], [ have_alsa="no"
])
], [
have_alsa="no"
])
dnl Alsa library version
alsa_version="none"
AC_MSG_CHECKING(for Alsa version)
alsa_tmpfile=`mktemp
/tmp/tse3-conftest-alsaversion.XXXXXX`
AC_TRY_RUN([
#include <$alsa_header_prefix/asoundlib.h>
#include <stdio.h>
int main()
{
FILE *temp =
fopen("$alsa_tmpfile", "w");
fprintf(temp, "%d.%d",
SND_LIB_MAJOR, SND_LIB_MINOR);
fclose(temp);
return 0;
}
], alsa_version="determining...",
alsa_version="none", AC_MSG_WARN(Using Alsa whilst cross compiling.
Presuming 0.9.x) && cat "0.9" > $alsa_tmpfile)
alsa_version=`cat $alsa_tmpfile`
rm $alsa_tmpfile
AC_MSG_RESULT($alsa_version)
if test "$alsa_version" = "0.5"; then
AC_DEFINE(TSE3_WITH_ALSA_0_5_X,1,[Define
if you have Alsa 0.5.x])
fi
if test "$alsa_version" = "0.9"; then
AC_DEFINE(TSE3_WITH_ALSA_0_9_X,1,[Define
if you have Alsa 0.9.x])
fi
fi
AC_SUBST(LIBASOUND)
LDFLAGS="$ac_ldflags_save"
])
AC_CHECK_LIBASOUND
AM_CONDITIONAL(HAVE_ALSA, test "$have_alsa" = "yes")
AC_MSG_CHECKING(whether ALSA is available)
if test "$have_alsa" = "yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# 2. Check whether ALSA is wanted
AC_MSG_CHECKING(whether ALSA support is wanted)
AC_ARG_WITH(alsa,
[
--with-alsa
whether to support the ALSA library],
[if test "$withval" = yes; then
AC_MSG_RESULT(yes)
with_alsa="yes"
else
AC_MSG_RESULT(no)
with_alsa="no"
fi], [AC_MSG_RESULT(yes); with_alsa="yes"])
if test "$with_alsa" = "yes" -a "$have_alsa" = "yes"; then
AC_SUBST(TSE3_WITH_ALSA)
AC_DEFINE(TSE3_WITH_ALSA,1,[Define if ALSA library support is
required])
TSE3_ALSA_VERSION=$alsa_version
AC_SUBST(TSE3_ALSA_VERSION)
TSE3_ALSA_PREFIX=$alsa_header_prefix
AC_SUBST(TSE3_ALSA_PREFIX)
AC_SUBST(TSE3_WITH_ALSA_0_5_X)
AC_SUBST(TSE3_WITH_ALSA_0_9_X)
else
TSE3_ALSA_VERSION=none
AC_SUBST(TSE3_ALSA_VERSION)
fi
AM_CONDITIONAL(TSE3_WITH_ALSA, test "$with_alsa" = "yes" -a
"$have_alsa" = "yes")
AM_CONDITIONAL(TSE3_WITH_ALSA_0_5_X, test "$with_alsa" = "yes" -a
"$have_alsa" = "yes" -a "$alsa_version" = "0.5")
AM_CONDITIONAL(TSE3_WITH_ALSA_0_9_X, test "$with_alsa" = "yes" -a
"$have_alsa" = "yes" -a "$alsa_version" = "0.9")
/****fin code****/
Et les remplacer par:
/**debutcode***/
#
----------------------------------------------------------------------------
# Checks for ALSA library support
# 1. Check whether ALSA is there
have_alsa="no"
AC_DEFUN(AC_CHECK_LIBASOUND,
[
dnl Alsa headers?
alsa_header_prefix="NONE"
AC_CHECK_HEADER(sys/asoundlib.h, alsa_header_prefix="sys")
AC_CHECK_HEADER(alsa/asoundlib.h, alsa_header_prefix="alsa")
ac_ldflags_save="$LDFLAGS"
LDFLAGS="$all_libraries $LDFLAGS"
LIBASOUND=""
if test "x$alsa_header_prefix" != "xNONE"; then
dnl Alsa library exists?
AC_CHECK_LIB(asound,snd_seq_create_simple_port,[
AC_TRY_RUN([
#include <$alsa_header_prefix/asoundlib.h>
int main() { return SND_LIB_MINOR
!= 5 && SND_LIB_MINOR != 9
&& SND_LIB_MINOR != 0; }
] ,[
have_alsa="yes"
LIBASOUND="-lasound"
AC_DEFINE(HAVE_ALSA, 1,
[Define if you
have libasound (required for alsa support)])
], [ have_alsa="no" ], [ have_alsa="no"
])
], [
have_alsa="no"
])
dnl Alsa library version
alsa_version="none"
AC_MSG_CHECKING(for Alsa version)
alsa_tmpfile=`mktemp
/tmp/tse3-conftest-alsaversion.XXXXXX`
AC_TRY_RUN([
#include <$alsa_header_prefix/asoundlib.h>
#include <stdio.h>
int main()
{
FILE *temp =
fopen("$alsa_tmpfile", "w");
fprintf(temp, "%d.%d",
SND_LIB_MAJOR, SND_LIB_MINOR);
fclose(temp);
return 0;
}
], alsa_version="determining...",
alsa_version="none", AC_MSG_WARN(Using Alsa whilst cross compiling.
Presuming 0.9.x) && cat "0.9" > $alsa_tmpfile)
alsa_version=`cat $alsa_tmpfile`
rm $alsa_tmpfile
AC_MSG_RESULT($alsa_version)
if test "$alsa_version" = "0.5"; then
AC_DEFINE(TSE3_WITH_ALSA_0_5_X,1,[Define
if you have Alsa 0.5.x])
fi
if test "$alsa_version" = "0.9"; then
AC_DEFINE(TSE3_WITH_ALSA_0_9_X,1,[Define
if you have Alsa 0.9.x])
fi
if test
"$alsa_version" = "1.0"; then
AC_DEFINE(TSE3_WITH_ALSA_1_0_X,1,[Define
if you have Alsa 1.0.x])
fi
fi
AC_SUBST(LIBASOUND)
LDFLAGS="$ac_ldflags_save"
])
AC_CHECK_LIBASOUND
AM_CONDITIONAL(HAVE_ALSA, test "$have_alsa" = "yes")
AC_MSG_CHECKING(whether ALSA is available)
if test "$have_alsa" = "yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# 2. Check whether ALSA is wanted
AC_MSG_CHECKING(whether ALSA support is wanted)
AC_ARG_WITH(alsa,
[
--with-alsa
whether to support the ALSA library],
[if test "$withval" = yes; then
AC_MSG_RESULT(yes)
with_alsa="yes"
else
AC_MSG_RESULT(no)
with_alsa="no"
fi], [AC_MSG_RESULT(yes); with_alsa="yes"])
if test "$with_alsa" = "yes" -a "$have_alsa" = "yes"; then
AC_SUBST(TSE3_WITH_ALSA)
AC_DEFINE(TSE3_WITH_ALSA,1,[Define if ALSA library support is
required])
TSE3_ALSA_VERSION=$alsa_version
AC_SUBST(TSE3_ALSA_VERSION)
TSE3_ALSA_PREFIX=$alsa_header_prefix
AC_SUBST(TSE3_ALSA_PREFIX)
AC_SUBST(TSE3_WITH_ALSA_0_5_X)
AC_SUBST(TSE3_WITH_ALSA_0_9_X)
AC_SUBST(TSE3_WITH_ALSA_1_0_X)
else
TSE3_ALSA_VERSION=none
AC_SUBST(TSE3_ALSA_VERSION)
fi
AM_CONDITIONAL(TSE3_WITH_ALSA, test "$with_alsa" = "yes" -a
"$have_alsa" = "yes")
AM_CONDITIONAL(TSE3_WITH_ALSA_0_5_X, test "$with_alsa" = "yes" -a
"$have_alsa" = "yes" -a "$alsa_version" = "0.5")
AM_CONDITIONAL(TSE3_WITH_ALSA_0_9_X, test "$with_alsa" = "yes" -a
"$have_alsa" = "yes" -a "$alsa_version" = "0.9")
AM_CONDITIONAL(TSE3_WITH_ALSA_1_0_X,
test "$with_alsa" = "yes" -a
"$have_alsa" = "yes" -a "$alsa_version" = "1.0")
#
----------------------------------------------------------------------------
/***fin code***/
Il s'agit en fait simplement de
rajouter une mention à ALSA
version 1.0
quand il est fait référence aux
précédentes versions d'alsa (lignes 191, 226-227-228,
266, 274)
Sauvegarder et quitter.
Dans la pratique un simple ./configure suffit pour qu'alsa 1.0 soit
pris en compte mais il en faut plus pour que le rpm soit correctement
reconstruit:
Effectuer dans l'ordre les commandes suivantes:
$aclocal
$autoconf
$autoheader (pour
modifier config.h.in)
$automake (pour
modifier Makefile.in)
Le code est maintenant modifié, on peut refaire le paquetage
bz2:
$ cd $HOME/rpm/SOURCES
$ tar -cjf
tse3-0.2.7.tar.bz2 tse3-0.2.7
$ rm -rf tse3-0.2.7
Maintenant, il sagit de reconstruire les paquetages rpm:
cd $HOME/rpm/SPECS
rpm -ba tse3.spec
Si tout se passe bien, le nouveau src.rpm se trouve dans SPMS, et
rpm/RPMS/i586/ contient
libtse3_0-0.2.7-4mdk.i586.rpm, libtse3_0-devel-0.2.7-4mdk.i586.rpm et
tse3-0.2.7-4mdk.i586.rpm
Sous root desinstaller les ancients paquetages avec urpme et installer
les nouveaux:
urpmi
libtse3_0-0.2.7-4mdk.i586.rpm
libtse3_0-devel-0.2.7-4mdk.i586.rpm tse3-0.2.7-4mdk.i586.rpm
***fin mandrake 10.0 specifique*****
et enfin installer noteedit et fluidsynth:
urpmi noteedit fluidsynth
*********fin de root*************
noteedit utilise la bibliothèque tse3 pour jouer les partitions,
vu que nous n'avons pas de carte midi, il faut rediriger le port midi
que noteedit utilise vers le synthetiseur (fluidsynth).
donc lancer fluidsynth:
fluidsynth
/chemin/vers/les/soundfonts.sf2
fluidsynth s'enregistre auprès d'alsa et sera visible dans le
menu de noteedit
configuration->configurer noteedit->son
selectionner le synthetiseur comme output.
créer une chanson appuyer sur play et voilà
Si on veut pouvoir router plusieurs évènements midi on
peut utiliser le module snd-virmidi
avec aconnect
Charger le module snd-virmidi pour pouvoir router les
évènements midi d'une application midi
quelconque (comme noteedit par ex) vers un synthetiseur (comme
fluidsynth) qui pallier l'absence de carte midi.
$modprobe snd-virmidi
dans /etc/modules.conf (pour mdk 9.2, je possède une compatible
sb
ensoniq es1371):
alias sound-slot-0 snd-ens1371
above snd-ens1371 snd-pcm-oss
################
# ALSA portion
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-8 snd-seq-oss
# Configure card 1 (second card) as a virtual MIDI card
alias sound-slot-1 snd-card-1
alias snd-card-1 snd-virmidi
###########################
Les fichiers tse3 en rpms (unofficials) sont disponibles içi.
Liens vers des sites ayant trait à la musique sous linux:
http://www.linuxinfor.com/english/MIDI/index.html
http://TSE3.sourceforge.net/
http://rnvs.informatik.tu-chemnitz.de/~jan/noteedit/noteedit.html
http://linux-sound.org/
http://www.djcj.org/LAU/jack/