http://192.168.1.222:9001/p/bitsandsounds-notes

How to clone our repository?
*git clone relearn@192.168.1.222:git/bits-and-sound.git

--> To retrieve the files from the remote repository
git pull

--> How to add files to our Git depository
- make sure you are in the correct folder (the git folder of  bits-and-sounds) --> use cd for that
- tag the files you want to add to the common git folder (so everyone can get them!!)
git add blablabla.jpg bliblabloe.jpg 
- to confirm your tags - you need to be committed!
git commit
Type in a clear message describing the changes and addition you make to the repository
- add your files to our common git folder (so everyone can download them!)
git push blablabla.jpg bliblabloe.jpg
Only the files you have added/tagged will go there

If you want to play with sound files catch those from your system
 /usr/share/sounds/

Alvin Lucier
I'm sitting in a room

===========================================

update to gimp 2.8 from ubuntu

1. Uninstall Gimp from your system:
sudo apt-get autoremove gimp gimp-plugin-registry

2. Add the following PPA:
sudo add-apt-repository ppa:otto-kesselgulasch/gimp
sudo apt-get update

3. Install Gimp:
sudo apt-get install gimp

===========================================

touch.data -> make an empty data file
open it in GHex
enter some color value to create a pixel, for exemple FF 00 00 FF FF 00 00 00 00
save this
open it with Gimp (in your terminal "Gimp filename.data"
you just wrote the small belgian flag of the world

open Audacity
import the file, filename.data (raw)
select encodage : U-Law, in Mono
Select Transport "play a loop" (or shift space bar)
listen to your track ! 

pull && push  > download new data and add yours

=========
>>> range(0,10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

>>> for number in range(0, 10): 
    print("/t " * number + "yes")
        
    >>> for number in range(0,10):
...     print("/t"* number+"here")
... 
here
/there
/t/there
/t/t/there
/t/t/t/there
/t/t/t/t/there
/t/t/t/t/t/there
/t/t/t/t/t/t/there
/t/t/t/t/t/t/t/there
/t/t/t/t/t/t/t/t/there

>>> for number in range(0,10):
...     print("\t"* number+"here")
... 
here
        here
                here
                        here
                                here
                                        here
                                                here
                                                        here
                                                                here
                                                                        here

for item in ['chicken', 'egg', 'omelette']:
    print(item)
    
    >>> for item in ['time','space','breathe']:
...     print(item)
...     print(item)
...     print(item)
... 
time
time
time
space
space
space
breathe
breathe
breathe
>>> enum(['time','space','breathe'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'enum' is not defined
>>> enumerate(['time','space','breathe'])
<enumerate object at 0x7f8f5a501960>
>>> list(enumerate(['time','space','breathe']))
[(0, 'time'), (1, 'space'), (2, 'breathe')]
>>> for item in enumerate(['time','space','breathe']):
...     print(item)
... 
(0, 'time')
(1, 'space')
(2, 'breathe')
>>> for number, item in enumerate(['time','space','breathe']):
...     print(" " * number + item)
... 
time
 space
  breathe
>>> i=0
>>> for item in ['time','space','breathe']:
...     print("    " * i + item)
...     i = i + 1
... 
time
    space
        breathe
>>> for item in ['time','space','breathe']:
...     print("    " * i + item)
...     i = i + 5
... 
            time
                                space
                                                    breathe
>>> 

 >>> for value in [1,2,3]:
...     print(value)
... 
1
2
3

>>> i=0
>>> for value in ['sky','pie','fly']:
...     print("    "*i+value)
...     i = i + 5
... 
sky
                    pie
                                        fly

>>> for value in ['sky','pie','fly']:
...     print("    "*i+value+ "\n")
...     i = i + 3
...     n = i
... 
                                                            sky

                                                                        pie

                                                                                    fly

>>> range (10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

===============================================

for mac osx keyboard: 
    " [ " = Maj + alt(right) + (
   "~" = alt(right) Space
       
=================================================
 
    GIF :
        Take all the images of a file to create a gif
        
path convert *.jpg (format) filename.gif (your generated gif)
Exemple :
        /Bureau/bits-and-sound/monday-morning-glitches$ convert *.jpg animate2.gif

===========================================
 ---> for making a gradient , do in python::
for value in range(255):
    print('0 0 ' + str(value))
 --- > copy the numbers in a text file   
 
---> add the PPM header (from wikipedia), so the file knows you are making a ppm raw image
P3
# The P3 means colors are in ASCII, then 3 columns and 2 rows,
# then 255 for max color, then RGB triplets
3 2
255

change the 3 and 2 values ---> for the size of your image

_____________________gradient.py________________________________
print('P3')
print('51 5')
print('255')

for value in range(255):
    print('0 255 ' + str(value)) 

____________________In the terminal_______________________________

python gradient.py 
python gradient.py > gradient.ppm
gimp gradient.ppm

_______________________ Write *REAL* bytes and not ascii ___________

import struct
out = open("image.data", "wb")
for x in range(100):
    out.write(struct.pack('B', x))
    out.write(struct.pack('B', 0))
    out.write(struct.pack('B', 0))
        
 ===================================================   
for i in $(seq 1 50); do cat damier.ppm >> /tmp/damier.wav; done

___________________________________________________________

for value in range(255):
    print('0' + " " + str(value) + " " + str(value))
    print(str(value)+ " " + '0' + " " + str(value))
    print(str(value)+ " " + '0' + " " + '255')
    print('23 00 255')

for value in range(255):
    print('0' + " " + str(value) + " " + str(value))
    print(str(value)+ " " + '0' + " " + str(value))
    print('0' + " " + '0' + " " + '40')
    print('12 200 55')

for value in range(255):
    print('0' + " " + str(value) + " " + str(value))
    print(str(value)+ " " + '0' + " " + str(value))
    print(str(value)+ " " + '0' + " " + '255')
    print('23 00 255')

for value in range(255):
    print('0' + " " + str(value) + " " + str(value))
    print(str(value)+ " " + '0' + " " + str(value))
    print('0' + " " + '0' + " " + '220')
    print('12 200 55')

*for value in range(255):      
    print (str(value)+' 0 ' + str(value))       
    print ('0 ' + str(value) + ' ' + str(value))      
    print ('0 ' + str(value) + ' ' + str(value))      
    print ('0 ' + str(value) + ' ' + str(value))      
    print (str(value) + ' ' + str(value) + ' 0 ')             
for value in range(255):      
    print (str(value)+' 0 ' + str(value))       
    print ('0 ' + str(value) + ' ' + str(value))      
    print ('0 ' + str(value) + ' ' + str(value))      
    print ('0 ' + str(value) + ' ' + str(value))      
    print (str(255 - value) + ' ' + str(value) + ' 0')      
    print (str(255 - value) + ' ' + str(value) + ' 0')      
    print ('0 0 0')                   
for value in range(255):      
    print ('0 ' + str(value) + ' ' + str(value))      
    print (str(255 - value) + ' ' + str(value) + ' 0')      
    print (str(255 - value) + ' ' + str(value) + ' 0')      
    print ('0 0 0')       
for value in range(255):    
    print ('0 ' + str(value) + ' ' + str(value))      
    print (str(255 - value) + ' ' + str(value) + ' 0')      
    print (str(25 - value) + ' ' + str(value) + ' 0')      
    print ('0 100 0')      
    print (str(25 - value) + ' 0 ' + str(value))      
    print ('0 100 200')      
    print ('0 100 200')     
    print (str(value)+' 0 ' + str(value)) 

# Alex
import math

for y in range(50):
    for x in range(50):
        val = int(((1 + math.cos(y * x)) / 2) * 255)
        print(val)
        print(val)
        print(val)        
        
for value in range(255):
    print("0 2 " + str(value))
    print("12 0" + " " + str(value))
    print('0 0 210')
    print('12 222 55')
for value in range (255):
    print("0 4 " + str(value))
    print("14 0" + " " + str(value))
    print('0 0 240')
    print('12 222 55')
    
=====================================================
prendre une image .ppm
l'ouvrir avec audacity
modifier le son en rajoutant plusieurs pistes etc
l'enregistrer en .raw --->   exporter > autres formats non compressés >  options > .raw + U law 
ouvrir avec gimp

======================================================

Do effects on the sound you have made wit Sox
play name_of_your_file.wav pitch -1000 lowpass 1000 
wooohoooooo!!

=======================================================

Play a non-wave file with sox.
sox --ignore-length --rate 8000 -b 8 -u -t raw

=======================================================

"sound is basically air being more or less compressed in our ears"

for the spreadsheet music:
https://pypi.python.org/pypi/sheetmusic
    sudo apt-get install python-pip

    sudo apt-get install python-lxml
or (longer) 
    sudo apt-get install python-dev libxml2-dev libxslt1-dev

    sudo pip install sheetmusic
 
    sudo apt-get install gnumeric-plugins-extra

export LANG=C

Select Gnumeric plugins

* sheetmusic
* Python loader

Sheetmusic bugs

* sheetmusic-installer doesn't work on French or Spanish terminals
* The documentation should say that you need to enable plugins.
* The documentation should say something about sound fonts.
* The sound font is hard-coded

Get sound fonts from the server.

scp relearn@192.168.1.222:*.sf2 .
sudo mkdir -p /usr/share/soundfonts
sudo cp Unison.sf2 /usr/share/soundfonts/Unison.sf2

OR

cp FluidR3_GM2-2.sf2 /usr/share/soundfonts/Unison.sf2

http://es.wikipedia.org/wiki/Sistema_de_notaci%C3%B3n_musical_anglosaj%C3%B3n

--> Opem Gnumeric
To run spreadsheet functions with multiple output cells, hit control + enter rather than just "nter".

--> open your python console
import sheetmusic
sheetmusic.init()
sheetmusic.play('B2:C2')
--> change tempo
sheetmusic.play('J1:M33', 'A', 4, 4, 200)

THE JOHN -SILENCE- CAGE DEPT. (aka virtualboxers)
we with no sound would like to play with morton feldman's music.
Gyorgi Ligeti
Steve Reich
Margaret Leng Tan

super formula 
=concatenate(if(roundup(mod(A2/256*49,7))<2,"A",if(roundup(mod(A2/256*49,7))<3,"B",if(roundup(mod(A2/256*49,7))<4,"C",if(roundup(mod(A2/256*49,7))<5,"D",if(roundup(mod(A2/256*49,7))<6,"E",if(roundup(mod(A2/256*49,7))<7,"F","G")))))),if(roundup(A2/256*49/7)=0,1,roundup(A2/256*49/7)))

======================================================================

Install PD on linux
http://puredata.info/docs/faq/debian

osc~ / phasor~
dac~
metro 1000
random 500
copy paste = ctrl+D
add = bang (put different numbers to control it with the keyboard) + message box to define the number

to install Pd on Virtual Machines
sudo apt-get install gem
then check Gem is there :
cd/usr/lib/pd/extra 
In PD 
media>preferences>startup...
new...
copy the path of GEM folder
apply
RESTART PD 
then be zexy
sudo apt-get install pd-zexy
In PD 
media>preferences>startup...
new...
copy the path of zexy folder
apply

Install 'unauthorized:
    sudo apt-get pd-unauthorized
In PD 
For [playlist] make [unauthorized/playlist], and the object run!

Same for [shell]:
    sudo apt-get pd-ggee
In PD:
    [ggee/shell]
    
 
PD manual (GEM)
http://en.flossmanuals.net/pure-data/video-gem-tutorials/introduction/

# inspired by <https://gitorious.org/0xa/shiftop/source/e83960f9ecc033bd9820498ed2863da7f0e0fa5e:shiftop#L28-29>
cat /dev/urandom| mplayer -vo x11 -sws 4 -zoom -vf dsize=720:720 -demuxer rawvideo -rawvideo w=16:h=16:y8:fps=30 -
arecord | mplayer -vo x11 -sws 4 -zoom -vf dsize=720:720 -demuxer rawvideo -rawvideo w=16:h=16:y8:fps=30 -


# big larsen
arecord | aplay -


# hip hop to rgb
cat rap.wav | mplayer -vo x11 -sws 4 -zoom -vf dsize=720:720 -demuxer rawvideo -rawvideo w=16:h=16:format=rgb24:fps=30 -



sketch on Arduino o read analog in & serial

=====================================================================================================
Digital Drawdio --> connecting pencil drawings to all kinds of programmes and networks by dy-wen
==============================================================================

Arduino takes the resistive qualities of the black crayons and it can send it as serial data to 
- pure data
- the terminal
- python
- the network
- chatbots?
- somewhere in space??

Setting up the Arduino in physical space
==================================
- take a 800KOhm resistor and make a voltage divider with the A0 as Arduino input (change the resistor value if necessary)
- put a pin in the graphite of the pencil & connect it to the Arduino with a aligator clip (this is one leg of your variable resistor in your voltage divider)
- connect a aligator clip to the drawing (onto the graphite) -> it is your ground 


--> start drawing between the ground and further on the paper


Arduino & Pure Data-extended
==========================
- on Arduino, upload the StandardFirmata_slower sketch
- to connect with the Arduino in Pure Data --> put the Pduino_arduino_test.pd patch in the folder where your music patch is
- open it and follow these instructions


- Instructions to connect the Arduino data to your Pure Data Patch with Pduino 
------------------------------------------------------------------------------------------------------------
- Choose the right serial port, for the usb to connect to the Arduino (little blocks in the top left of this patch) 
- Open the connections to the Arduino (analog --> 14 & 15) in the top right box (configure mode for each pin) 
- you should see values changing at the bottom left - there are two send objects: s arduino_analo0 & s arduino_analog1 
- put two receive patches in your own pd patch to receive these data (r arduino_analo0 & r arduino_analog1) 

arduino & the terminal::
============================
Put a sketch on your Arduino that sends serial data to the serial monitor

In a terminal -> run:
stty -F /dev/ttyACM0 9600
stty -F /dev/ttyACM0 raw
cat < /dev/ttyACM0


(potentially interesting: https://github.com/todbot/arduino-serial/)


Arduino & Python
========================
http://playground.arduino.cc/interfacing/python
Arduino and Python

Talking to Arduino over a serial interface is pretty trivial in Python. On Unix-like systems you can read and write to the serial device as if it were a file, but there is also a wrapper library called pySerial that works well across all operating systems.

After installing pySerial, reading data from Arduino is straightforward:

>>> import serial
>>> ser = serial.Serial('/dev/ttyNameOfYourSerialForArduino', 9600)
>>> while True:
...     print ser.readline()





git branches
==================
to avoid merge problems

git checkout -b tom
git commit .
# ...
git push origin tom


Wanna talk on IRC : join #bitsandsounds
with Konversation


