Commit 45cc9353 authored by Arnaud Blanchard's avatar Arnaud Blanchard

interfaces for low basic apps

parent 8158551b
#!/usr/bin/env bash #Use your $PATH to find bash
# Basic Libraries And Applications for Robotics (BLAAR)
# Copyright ETIS — ENSEA, University of Cergy-Pontoise, CNRS (2011 - 2017)
# Author: Arnaud Blanchard
#
# This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
# You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
# As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
set -o errexit #Exit on first error
set -o nounset #Error if a variable is used but not defined
set -o pipefail #Error if a pipe fail
source blaar.sh
blaar_init_options "Graph the frequency spectrum from the microphone or a sound file(-f)"
blaar_add_option device_option D "" "device_name" "device to use for the microphone"
blaar_add_option filename f "" "filename" "file to load the sound from"
blaar_add_option size s "" "integer" "number of itmes per sample" "4096"
blaar_add_option samplerate S "" "integer" "Samplerate of the sound acquisition" "44100"
blaar_add_option max M "" "real" "maximal intensity to display"
blaar_add_option xmax X "" "real" "maximal values on absisca to display"
blaar_parse_args "$@"
[ $filename ] && file_option="--file=$filename" || file_option=""
[ $max ] && max_option="--max=$max" || max_option=""
[ $xmax ] && xmax_option="--xmax=$xmax" || xmax_option=""
i_sound.sh -s$size -o:sound$$ $file_option $device_option |
blaar_module.sh fftw f_fftw_spectrum --output=.spectrum$$ |
o_gnuplot --label-max=$(calc "$samplerate/2") --text="xlabel 'Frequencies (Hz)'" $max_option $xmax_option
#specify the output names allows you to erase them later
#remove the used blc_channels
blc_channels --unlink /sound$$
blc_channels --unlink /spectrum$$
#!/usr/bin/env bash #Use your $PATH to find bash
# Basic Libraries And Applications for Robotics (BLAAR)
# Copyright ETIS — ENSEA, University of Cergy-Pontoise, CNRS (2011 - 2017)
# Author: Arnaud Blanchard
#
# This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
# You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
# As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
set -o errexit #Exit on first error
set -o nounset #Error if a variable is used but not defined
set -o pipefail #Error if a pipe fail
source blaar.sh
blaar_init_options "Acquire the sound from microphone or sound file (-f filename)"
blaar_add_option device D "" "device_name" "device to use for the microphone"
blaar_add_option filename f "" "filename" "file to load the sound from"
blaar_add_option output o "" "blc_channel|-" "output blc_channel name on terminal (-)"
blaar_add_option size s "" "integer" "number of itmes per sample" "4096"
blaar_add_option samplerate S "" "integer" "Samplerate of the sound acquisition" "44100"
blaar_parse_args "$@"
[ $filename ] && file_option="--file=$filename" || file_option=""
[ $output ] && output_option="--output=$output"|| output_option=""
if [ $filename ]; then
echo "File input" >&2
[ $device ] && { echo "You cannot have file (-f) and microphone (-D) at the same time"; exit 1; }
blaar_module.sh sndfile i_sndfile --file=$filename --size=$size --samplerate=$samplerate $output_option
elif [ $(uname) = "Darwin" ]; then #microphone
echo "Darwin microphone" >&2
[ $device ] && echo "On Darwin you cannot precise microphone (-D)"
blaar_module.sh coreaudio i_coreaudio --size=$size --samplerate=$samplerate $output_option
elif [ $(uname) = "Linux" ]; then
echo "Linux microphone" >&2
[ ! $device ] && device=default
blaar_module.sh asound i_asound --device=$device --size=$size --samplerate=$samplerate $output_option
else
echo "$0 does not work on '$(uname)' platform"
exit 1;
fi
#!/usr/bin/env bash #Use your $PATH to find bash
# Basic Libraries And Applications for Robotics (BLAAR)
# Copyright ETIS — ENSEA, University of Cergy-Pontoise, CNRS (2011 - 2017)
# Author: Arnaud Blanchard
#
# This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
# You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
# As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
set -o errexit #Exit on first error
set -o nounset #Error if a variable is used but not defined
set -o pipefail #Error if a pipe fail
source blaar.sh
blaar_init_options "Acquire the frequency spectrum from the microphone or a sound file(-f)"
blaar_add_option device_option D "" "device_name" "device to use for the microphone"
blaar_add_option filename f "" "filename" "file to load the sound from"
blaar_add_option size s "" "integer" "number of items per sample" "4096"
blaar_add_option samplerate S "" "integer" "Samplerate of the sound acquisition" "44100"
blaar_parse_args "$@"
if [ $filename ]; then
blaar_module.sh sndfile i_sndfile --file=$filename -o:sound$$
else
i_microphone -o:sound$$
fi | blaar_module.sh fftw f_fftw_spectrum -o
blc_channels --unlink /sound$$
#!/usr/bin/env bash #Use your $PATH to find bash
# Basic Libraries And Applications for Robotics (BLAAR)
# Copyright ETIS — ENSEA, University of Cergy-Pontoise, CNRS (2011 - 2017)
# Author: Arnaud Blanchard
#
# This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
# You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
# As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
set -o errexit #Exit on first error
set -o nounset #Error if a variable is used but not defined
set -o pipefail #Error if a pipe fail
if [ $(uname) = "Darwin" ]; then
blaar_module coreaudio o_coreaudio "$@"
elif [ $(uname) = "Linux" ]; then
blaar_module asound o_asound "$@"
else
echo "$0 does not work on '$(uname)' platform"
fi
......@@ -12,6 +12,12 @@ set -o errexit #Exit on first error
set -o nounset #Error if a variable is used but nont defined
set -o pipefail #Error if a pipe fail
if [ $# -ne 1 ]
then
echo "You need a project directory as argument."
echo "Usage : xcode_project <project_directory>"
exit 1
fi
#We go to the project directory and get the directory name then we go back to seach for the baar directory
cd $1
......@@ -25,12 +31,7 @@ blaar_dir="$PWD"
blaar_build_dir="${blaar_dir}_build"
if [ $# -ne 1 ]
then
echo "You need a project directory as argument."
echo "Usage : xcode_project <project_directory>"
exit 1
fi
developer_tools/create_project.sh $project_dir $blaar_build_dir xcode
open $build_dir/cmake_files_xcode/$project_name/$project_name.xcodeproj
developer_tools/create_project.sh $1 $blaar_build_dir xcode
open $blaar_build_dir/cmake_files_xcode/$project_name/$project_name.xcodeproj
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment