# Linksammlung Seminar Programmierung II (PHOÖ)
Rainer Stropek, [rainer@software-architects.at](mailto:rainer@software-architects.at)
Ihr seid alle herzlich zu [Teach2Code](https://www.meetup.com/de-DE/teach2code/) eingeladen!
## Anwesenheitsliste
* [Termin 25.03.2023](https://forms.microsoft.com/e/WVhrsK6rNU)
* [Termin 15.04.2023](https://forms.microsoft.com/e/8LuR0M6u1T)
* [Termin 06.05.2023](https://forms.microsoft.com/e/Ab0yFvShJb)
* [Termin 27.05.2023](https://forms.microsoft.com/e/N8V8yYmw7G)
* [Termin 17.06.2023](https://forms.microsoft.com/e/JtETXRRCCf)
## Seminararbeit und Hausübungen
* [Anforderungen an Seminararbeit](https://softwarearchitects1com-my.sharepoint.com/:b:/g/personal/rainer_software-architects_at/EZSRvnIxyR5NoRC6rrfJZi4BS4LcSK2ZpUcRh5DVH5MrGg?e=7RSEQe) ([alternativer Link](https://cddataexchange.blob.core.windows.net/data-exchange/Anforderungen-Seminararbeit%20II.pdf))
* Ansehen von mindestens drei Episoden von [The Coding Train](https://thecodingtrain.com/tracks/code-programming-with-p5-js)
* [Sierpinski](https://youtu.be/bIfNwgUVjV8) ([Lösung](https://stackblitz.com/edit/sierpinski?file=index.ts))
## Unterlagen
* [Rainer Stropek: Programmieren lernen mit p5js und Stackblitz](https://slides.com/rainerstropek/teaching-to-code-with-p5js/fullscreen)
* [Startercode 06.05.2023](https://stackblitz.com/edit/p5-starter-phooe-wfg1cp?file=index.ts)
* [CoderDojo Übungsbuch](https://linz.coderdojo.net/uebungsanleitungen/programmieren/uebungsbuch-1/)
* [Bouncing ball (27.05.)](https://stackblitz.com/edit/p5-phooe-drawing-starter?file=index.ts)
* [Zugehörige ChatGPT Unterhaltung](https://chat.openai.com/share/6fd229de-2a54-4ebd-b51a-93a9d4a30631)
* [Raumschiff-Beispiel (17.06.2023)](https://stackblitz.com/edit/p5-starter-2qcay9)
* Übungen
* [Stuchbabensalat](https://stackblitz.com/edit/stuchbabensalat)
* [Sun and Clouds](https://stackblitz.com/edit/sun-and-clouds)
* [SVG Clock](https://stackblitz.com/edit/svg-clock-set)
* [Classes](https://stackblitz.com/edit/intro-to-classes)
## Aufzeichnungen
* 27.05.2023
* [Teil 1](https://softwarearchitects1com-my.sharepoint.com/:v:/g/personal/rainer_software-architects_at/EfU5jeTlX9BMocdkqWeUWEwBBSXEJL8ATN8UHJ4kJ2Jszg?e=5G6fHU)
* [Teil 2](https://softwarearchitects1com-my.sharepoint.com/:v:/g/personal/rainer_software-architects_at/EZD5zy7lf-VFmmsr9DDssIkBeKPmI4dUjZr3jAy-h69y9A?e=7YtX1z)
## Werkzeugsammlung
* [Stackblitz](https://stackblitz.com)
* [imgbb - Hosting von Bildern](https://imgbb.com/)
* [SVG to PNG](https://cloudconvert.com/svg-to-png)
* [Zoomit](https://learn.microsoft.com/en-us/sysinternals/downloads/zoomit)
* [Bildschirmtastatur aufrufen](https://support.microsoft.com/de-de/windows/verwenden-der-bildschirmtastatur-zur-eingabe-ecbb5e08-5b4e-d8c8-f794-81dbf896267a#:~:text=Tablet%2DModus%20befindet.-,So%20%C3%B6ffnen%20Sie%20die%20Bildschirmtastatur,den%20Umschalter%20unter%20Bildschirmtastatur%20verwenden.)
* [HTML Color Names](https://htmlcolorcodes.com/color-names/)
* [Sonic Pi](https://sonic-pi.net/)
## Sonic Pi - Weihnachtslied
```pythonuse_bpm 110
define :play_note do |note, duration, vol = 1|
play note, sustain: 0.9 * duration, release: 0.1 * duration, amp: vol
sleep duration
end
define :play_melody do |melody, durations, vol = 1|
melody.zip(durations).each do |n, d|
play_note(n, d, vol)
end
end
define :play_pattern_1 do |notes, synth = :piano, vol = 1|
in_thread do
4.times do |index|
2.times do
play_note(notes[index][0], 1, vol)
play_note(notes[index][0], 0.5, vol)
play_note(notes[index][0], 0.5, vol)
play_note(notes[index][1], 1, vol)
play_note(notes[index][1], 0.5, vol)
play_note(notes[index][1], 0.5, vol)
end
end
end
end
define :play_pattern_2 do |notes, synth = :base_foundation, vol = 1|
in_thread do
4.times do |index|
16.times do
play_note(notes[index], 0.5, vol)
end
end
end
end
# SNAP
define :snap do |sample = :perc_snap, vol = 1|
live_loop :snap do
sleep 1
sample sample
sleep 1
sleep 1
sample sample
sleep 1
end
end
# DRUMS
define :drums do |sample = :drum_cymbal_pedal, vol = 1|
live_loop :drums do
8.times do
sample sample
sleep 0.5
end
end
end
# MELODY
define :melody do |synth = :fm, vol = 1|
use_synth synth
melody_notes = [:e4,:e4,:d4,:a3, :e4,:e4,:fs4,:d4,:b3, :e4,:e4,:fs4,:d4,:b3, :cs4,:d4,:cs4,:b3,
:fs4,:e4,:b3, :fs4,:g4,:fs4,:e4,:d4, :cs4,:d4,:b3,:cs4,:d4, :cs4,:a3]
melody_durations = [2,0.5,1,0.5, 0.5,0.5,0.5,1.5,1, 0.5,0.5,0.5,2,0.5, 0.5,0.5,0.5,2.5,
2,1.5,0.5, 0.5,0.5,0.5,2,0.5, 0.5,1,0.5,1,1, 0.5,3.5]
live_loop :melody do
play_melody(melody_notes, melody_durations, vol)
end
end
snap(:perc_snap2, 1)
drums(:drum_cymbal_pedal, 0.5)
# SOPRANO
play_pattern_1([[:g4,:fs4],[:g4,:fs4],[:a4,:g4],[:fs4,:e4]], :piano, 1)
# MEZZO
play_pattern_1([[:e4,:d4],[:e4,:d4],[:fs4,:e4],[:d4,:cs4]], :piano, 1)
# ALTO
play_pattern_1([[:d4,:a3],[:b3,:fs3],[:d4,:e4],[:a3,:a3]], :piano, 1)
# TENOR
play_pattern_2([:fs3,:fs3,:g3,:e3], :piano, 1)
# BASS
play_pattern_2([:d3,:b2,:g2,:a2], :piano, 1)
# MELODY
melody(:fm, 1)
```