Is it possible to pass a variable name, as a parameter to a function, so it can be created within this function ?
Something like this:
func_uppercase abcdefgh var_name
where the 1st parameter is the string I want to convert and the 2nd is the desired variable name...
$2=`echo "$1" |... (2 Replies)
Hi,
I am trying to sum up numbered columns and in order to tidy up the program I have wrote a function to do the adding of some numbers. I have a problem though with passing a variable to the function in the UNIX bash shell. The function only gives the first number in the variable list and does... (4 Replies)
Suppose I have a unix variable called RGNM which is holding a value. Now I want to call a plsql function in my script. THis plsql function takes one IN parameter. I want to pass my UNIX VARIABLE Value to the plsql function. Can i just give it by giving $RGNM in the function after calling sqlplus... (1 Reply)
I would like to know how to pass a variable inside a variable to a function.
sample code below
--------------
for x in 1 9
do
check_null $C$x ##call function to check if the value is null
if
then
echo "line number:$var_cnt,... (2 Replies)
following on from below link
https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569
i will be using file reading in while loop say for example
while read line123
do
echo "line read is $line123"
insert_funct $line123
done< mysqldump.sql... (6 Replies)
Hello All,
I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and
put the variables in " ". Is there another way I can do this? Thank you in advance.
readtasklist() {
while read -r mod ver... (1 Reply)
I have the below script which creates a directory or simply terminates without throwing error (exit 1) incase the directory exists.
bash-4.1$ vi mdir.sh
#!/bin/bash -e
shopt -s expand_aliases
alias mkdir=mkdir_s
mkdir_s(){
if ]; then
echo " directory EXISTS "
return
else
echo "... (3 Replies)
I want to make a config file which contain all the paths.
i want to read the config file line by line and pass as an argument on my below function.
Replace all the path with reading config path line by line and pass in respective functions.
how can i achieve that?
Kindly guide.
... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
LEARN ABOUT DEBIAN
numm.one-bit-instrument
one-bit-instrument(7) Numm Tutorials one-bit-instrument(7)NAME
one bit instrument - how to make a gnarly synth with numm-run
SYNOPSIS
numm-run FILE
DESCRIPTION
In this tutorial we will learn how to live-code a one-bit synthesizer controlled by mouse position. It is intended as a gentle introduc-
tion to development with numm-run.
To get started, create a text file with the following method stubs:
def audio_out(a):
pass
def video_out(a):
pass
Save the file as onebit.py, and then launch it with numm-run:
numm-run onebit.py
You should see a blank window appear. We will now make some sound and light by changing the value of a in the audio_out and video_out
functions:
def audio_out(a):
a[::100] = 2**15
def video_out(a):
a.flat[::100] = 255
Save the file, and you should see and hear the sketch update. This is using numpy's array-indexing to turn every hundredth audio sample
and pixel-color on. The audio sample rate is by default 44100Hz, so it produces a series of clicks that will be perceived as a 441Hz tone.
We can turn this into an instrument by connecting mouse motion to frequency:
period = 100
def audio_out(a):
a[::period] = 2**15
def video_out(a):
a.flat[::period] = 255
def mouse_in(type,px,py,button):
global period
period = px*1000
Finally, let's use the keyboard to record and jump to notes. The first time you press a key, it records the period, and subsequant depres-
sions play the saved period:
period = 100
record = {}
def audio_out(a):
a[::period] = 2**15
def video_out(a):
a.flat[::period] = 255
def mouse_in(type,px,py,button):
global period
period = px*1000
def keyboard_in(type,key):
global period
if record.has_key(key):
period = record[key]
elif record.has_key(key):
record[] = period
SEE ALSO numm-run(1), numm.getting-started(7), numm.spectral-analysis(7)numm February 2012 one-bit-instrument(7)