<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Arduino Archive - Christian Streng</title>
	<atom:link href="https://www.christianstreng.de/tag/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.christianstreng.de/tag/arduino/</link>
	<description>Regisseur, Musiker, Fiction Producer und Autor aus Berlin</description>
	<lastBuildDate>Thu, 21 Jan 2021 08:32:00 +0000</lastBuildDate>
	<language>de-DE</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.christianstreng.de/wp-content/uploads/2017/06/cropped-cyber_corporation-32x32.png</url>
	<title>Arduino Archive - Christian Streng</title>
	<link>https://www.christianstreng.de/tag/arduino/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">131545007</site>	<item>
		<title>Arduino MIDI Filter mit LED</title>
		<link>https://www.christianstreng.de/arduino-midi-filter-mit-led/</link>
					<comments>https://www.christianstreng.de/arduino-midi-filter-mit-led/#comments</comments>
		
		<dc:creator><![CDATA[christian]]></dc:creator>
		<pubDate>Tue, 18 Feb 2020 16:04:31 +0000</pubDate>
				<category><![CDATA[DIY Musikinstrumente]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Junkyard Equipment]]></category>
		<category><![CDATA[Midi]]></category>
		<guid isPermaLink="false">https://www.christianstreng.de/?p=1833</guid>

					<description><![CDATA[<p>Ein kleines Update zum Arduino Midi Filter mit Midi Clock. Die eingebaute LED des Arduino leuchtet jetzt auf, solange ein Notensignal an den MIDI OUT geschickt wird. Der folgende Sketch ist die neue Firmware für den Arduino (Arduino-Midi-Library ist Voraussetzung):</p>
<p>Der Beitrag <a href="https://www.christianstreng.de/arduino-midi-filter-mit-led/">Arduino MIDI Filter mit LED</a> erschien zuerst auf <a href="https://www.christianstreng.de">Christian Streng</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Ein kleines Update zum <a href="https://www.christianstreng.de/arduino-midi-filter-mit-midi-clock/">Arduino Midi Filter mit Midi Clock</a>. Die eingebaute LED des Arduino leuchtet jetzt auf, solange ein Notensignal an den MIDI OUT geschickt wird. Der folgende Sketch ist die neue Firmware für  den Arduino (<a rel="noreferrer noopener" href="https://github.com/FortySevenEffects/arduino_midi_library" target="_blank">Arduino-Midi-Library</a> ist Voraussetzung):</p>



<pre class="wp-block-code"><code>// Arduino Midi Filter
// Version 1.2 by Christian Streng
// Midi Out is on Channel 1.
// www.christianstreng.de/arduino-midi-filter

#include &lt;MIDI.h&gt;

MIDI_CREATE_DEFAULT_INSTANCE();

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  MIDI.begin(MIDI_CHANNEL_OMNI);
  MIDI.turnThruOff();
  MIDI.setHandleNoteOn(MyHandleNoteOn);
  MIDI.setHandleNoteOff(MyHandleNoteOff);
  MIDI.setHandleControlChange(MyHandleControlChange);
  MIDI.setHandleProgramChange(MyHandleProgramChange);
  MIDI.setHandlePitchBend(MyHandlePitchBend);
  MIDI.setHandleClock(MyHandleClock);
}

void loop() { 
  MIDI.read(); 
}

void MyHandleNoteOn(byte channel, byte number, byte velocity) { 
    MIDI.sendNoteOn(number, velocity, 1);
    digitalWrite(LED_BUILTIN, HIGH);
}

void MyHandleNoteOff(byte channel, byte number, byte velocity) { 
    MIDI.sendNoteOff(number, velocity, 1);
    digitalWrite(LED_BUILTIN, LOW);
}

void MyHandleControlChange(byte channel, byte number, byte value) { 
    MIDI.sendControlChange(number, value, 1);
}

void MyHandleProgramChange(byte channel, byte program) { 
    MIDI.sendProgramChange(program, 1);
}

void MyHandlePitchBend(byte channel, int value) { 
    MIDI.sendPitchBend(value, 1);
}

void MyHandleClock(byte tempo) { 
    MIDI.sendRealTime(tempo);
}</code></pre>



<p></p>
<p>Der Beitrag <a href="https://www.christianstreng.de/arduino-midi-filter-mit-led/">Arduino MIDI Filter mit LED</a> erschien zuerst auf <a href="https://www.christianstreng.de">Christian Streng</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.christianstreng.de/arduino-midi-filter-mit-led/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1833</post-id>	</item>
		<item>
		<title>Digital Theremin</title>
		<link>https://www.christianstreng.de/digital-theremin/</link>
					<comments>https://www.christianstreng.de/digital-theremin/#respond</comments>
		
		<dc:creator><![CDATA[christian]]></dc:creator>
		<pubDate>Wed, 12 Dec 2018 12:37:02 +0000</pubDate>
				<category><![CDATA[DIY Musikinstrumente]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Junkyard Equipment]]></category>
		<guid isPermaLink="false">https://www.christianstreng.de/?p=1780</guid>

					<description><![CDATA[<p>Das digitale Theremin sitzt auf einem Shield für den Arduino Uno, das einfach aufgesteckt wird. Es enthält ein analoges Low-Pass-Filter zur Verbesserung des Klangs und einen Regler für die Lautstärke. Über einen optischen Sensor wird die Tonhöhe gesteuert. Der Ton wird über einen Line-Ausgang im Miniklinkenformat wiedergegeben. Weiterhin gibt es einen Schalter für einen Reset der Software, eine Status-LED sowie eine schaltbare Notbeleuchtung für sehr dunkle Umgebungen. Die Software bindet die Bibliothek Mozzi ein, die einen sehr schönen Sinuston für&#8230;</p>
<p>Der Beitrag <a href="https://www.christianstreng.de/digital-theremin/">Digital Theremin</a> erschien zuerst auf <a href="https://www.christianstreng.de">Christian Streng</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Das digitale Theremin sitzt auf einem Shield für den <a aria-label="Das digitale Theremin sitzt auf einem Shield für den Arduino Uno. Es enthält ein analoges Low-Pass-Filter zur Verbesserung des Klangs und einen Regler für die Lautstärke. Über einen optischen Sensor wird die Tonhöhe gesteuert. Weiterhin gibt es einen Schalter für einen Reset der Software, eine Status-LED sowie eine per Schalter aktivierbare Notbeleuchtung für sehr dunkle Umgebungen. (opens in a new tab)" rel="noreferrer noopener" href="https://www.arduino.cc/" target="_blank">Arduino Uno</a>, das einfach aufgesteckt wird. Es enthält ein analoges Low-Pass-Filter zur Verbesserung des Klangs und einen Regler für die Lautstärke. Über einen optischen Sensor wird die Tonhöhe gesteuert. Der Ton wird über einen Line-Ausgang im Miniklinkenformat wiedergegeben. Weiterhin gibt es einen Schalter für einen Reset der Software, eine Status-LED sowie eine schaltbare  Notbeleuchtung für sehr dunkle Umgebungen.</p>



<p>Die Software bindet die Bibliothek <a aria-label="Die Software basiert auf der Mozzi Bibliothek, die einen sehr schönen Sinuston für den analogen Ausgang des Arduino berechnet, der eigentlich nur Pulswellen erzeugen kann. (opens in a new tab)" href="https://sensorium.github.io/Mozzi/" target="_blank" rel="noreferrer noopener">Mozzi</a> ein, die einen sehr schönen Sinuston für den analogen Ausgang des Arduino berechnet, der ansonsten nur Pulswellen erzeugen kann.</p>



<p>Die Daten des Sensors und des Lautstärkepotis werden über die serielle Schnittstelle auch an den Computer gesendet, die dann z.B. über den seriellen Monitor in der <a aria-label="Die Daten des Sensors und des Lautstärkepotis werden über die serielle Schnittstelle auch an den Computer übergeben, die dann z.B. über den seriellen Monitor in der Arduino IDE (opens in a new tab)" href="https://www.arduino.cc/en/Main/Software" target="_blank" rel="noreferrer noopener">Arduino IDE</a> ausgelesen werden können.<br></p>



<p><strong>Code:</strong></p>



<pre class="wp-block-code"><code>// Digital Theremin
// Version 1.0 by Christian Streng
// www.christianstreng.de/digital-theremin

#include &lt;MozziGuts.h>
#include &lt;Oscil.h> // oscillator template
#include &lt;tables/sin2048_int8.h> // sine table for oscillator

const char KNOB_PIN = 0; // set the input for the knob to analog pin 0
const char LDR_PIN = 1; // set the input for the LDR to analog pin 1

// use: Oscil &lt;table_size, update_rate> oscilName (wavetable), look in .h file of table #included above
Oscil &lt;SIN2048_NUM_CELLS, AUDIO_RATE> aSin(SIN2048_DATA);

byte volume;

int pin_switch = 2;    // the number of the input pin
int pin_LED = 7;      // the number of the output pin

// variables to hold the new and old switch states
boolean oldSwitchState = LOW;
boolean newSwitchState = LOW;

boolean LEDstatus = LOW;

void setup(){
  Serial.begin(115200); // set up the Serial output so we can look at the analog levels
  startMozzi(); // :))

  pinMode(pin_LED, OUTPUT);  
  digitalWrite(pin_LED,HIGH); 
  pinMode(pin_switch, INPUT_PULLUP);
}

void updateControl(){
  // read the potentiometer
  int knob_value = mozziAnalogRead(KNOB_PIN); // value is 0-1023

  // map it to an 8 bit volume range for efficient calculations in updateAudio
  volume = knob_value >> 2;  // 10 bits (0->1023) shifted right by 2 bits to give 8 bits (0->255)

  // print the value to the Serial monitor for debugging
  Serial.print("volume = ");
  Serial.print((int)volume);
  Serial.print("\t"); // prints a tab

  // read the light dependent resistor
  int light_level = mozziAnalogRead(LDR_PIN); // value is 0-1023

  // print the value to the Serial monitor for debugging
  Serial.print("light level = ");
  Serial.print(light_level);
  Serial.print("\t"); // prints a tab

  // set the frequency
  aSin.setFreq(light_level);

  Serial.println(); // next line
}

int updateAudio(){
  // cast char output from aSin.next() to int to make room for multiplication
  return ((int)aSin.next() * volume) >> 8; // shift back into range after multiplying by 8 bit value
}

void loop(){
  audioHook(); // required here

    newSwitchState = digitalRead(pin_switch);

        if ( newSwitchState != oldSwitchState ) 
        {
           // has the button switch been closed?
           if ( newSwitchState == HIGH )
           {
           if ( LEDstatus == LOW ) { digitalWrite(pin_LED, HIGH);  LEDstatus = HIGH; }
           else { digitalWrite(pin_LED, LOW);   LEDstatus = LOW;  }
           }
           oldSwitchState = newSwitchState;
        }  
    }</code></pre>
<p>Der Beitrag <a href="https://www.christianstreng.de/digital-theremin/">Digital Theremin</a> erschien zuerst auf <a href="https://www.christianstreng.de">Christian Streng</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.christianstreng.de/digital-theremin/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1780</post-id>	</item>
		<item>
		<title>Arduino Midi Filter mit Midi Clock</title>
		<link>https://www.christianstreng.de/arduino-midi-filter-mit-midi-clock/</link>
					<comments>https://www.christianstreng.de/arduino-midi-filter-mit-midi-clock/#comments</comments>
		
		<dc:creator><![CDATA[christian]]></dc:creator>
		<pubDate>Sat, 07 Apr 2018 19:48:32 +0000</pubDate>
				<category><![CDATA[DIY Musikinstrumente]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Junkyard Equipment]]></category>
		<category><![CDATA[Midi]]></category>
		<guid isPermaLink="false">https://www.christianstreng.de/?p=1685</guid>

					<description><![CDATA[<p>Der neue Sketch ergänzt das Arduino Midi Filter mit der Weitergabe der Midi Clock zur Temposynchronisation (Arduino-Midi-Library ist Voraussetzung): Update: Arduino MIDI Filter mit LED</p>
<p>Der Beitrag <a href="https://www.christianstreng.de/arduino-midi-filter-mit-midi-clock/">Arduino Midi Filter mit Midi Clock</a> erschien zuerst auf <a href="https://www.christianstreng.de">Christian Streng</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Der neue Sketch ergänzt das <a href="https://www.christianstreng.de/arduino-midi-filter/">Arduino Midi Filter</a> mit der Weitergabe der Midi Clock zur Temposynchronisation (<a href="https://github.com/FortySevenEffects/arduino_midi_library" target="_blank" rel="noopener noreferrer">Arduino-Midi-Library</a> ist Voraussetzung):</p>


<pre class="wp-block-code"><code>#include &lt;MIDI.h>

// Arduino Midi Filter
// Version 1.1 by Christian Streng
// Midi Out is on Channel 1.
// www.christianstreng.de/arduino-midi-filter

MIDI_CREATE_DEFAULT_INSTANCE();

void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI);
MIDI.turnThruOff();
MIDI.setHandleNoteOn(MyHandleNoteOn);
MIDI.setHandleNoteOff(MyHandleNoteOff);
MIDI.setHandleControlChange(MyHandleControlChange);
MIDI.setHandleProgramChange(MyHandleProgramChange);
MIDI.setHandlePitchBend(MyHandlePitchBend);
MIDI.setHandleClock(MyHandleClock);
}

void loop() {
MIDI.read();
}

void MyHandleNoteOn(byte channel, byte number, byte velocity) {
MIDI.sendNoteOn(number, velocity, 1);
}
void MyHandleNoteOff(byte channel, byte number, byte velocity) {
MIDI.sendNoteOff(number, velocity, 1);
}
void MyHandleControlChange(byte channel, byte number, byte value) {
MIDI.sendControlChange(number, value, 1);
}
void MyHandleProgramChange(byte channel, byte program) {
MIDI.sendProgramChange(program, 1);
}
void MyHandlePitchBend(byte channel, int value) {
MIDI.sendPitchBend(value, 1);
}
void MyHandleClock(byte tempo) {
MIDI.sendRealTime(tempo);
}</code></pre>



<p><a href="https://www.christianstreng.de/arduino-midi-filter-mit-led/">Update: Arduino MIDI Filter mit LED</a></p>
<p>Der Beitrag <a href="https://www.christianstreng.de/arduino-midi-filter-mit-midi-clock/">Arduino Midi Filter mit Midi Clock</a> erschien zuerst auf <a href="https://www.christianstreng.de">Christian Streng</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.christianstreng.de/arduino-midi-filter-mit-midi-clock/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1685</post-id>	</item>
		<item>
		<title>Arduino Midi Filter</title>
		<link>https://www.christianstreng.de/arduino-midi-filter/</link>
					<comments>https://www.christianstreng.de/arduino-midi-filter/#comments</comments>
		
		<dc:creator><![CDATA[christian]]></dc:creator>
		<pubDate>Tue, 03 Apr 2018 16:21:21 +0000</pubDate>
				<category><![CDATA[DIY Musikinstrumente]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Junkyard Equipment]]></category>
		<category><![CDATA[Midi]]></category>
		<guid isPermaLink="false">https://www.christianstreng.de/arduino-midi-filter/</guid>

					<description><![CDATA[<p>Manche Midi-Controller schicken über ihren Midi-Ausgang unglaublich viel Datenmüll, der oftmals dazu führt, dass sich zwei Geräte nicht verstehen. Mein uraltes Kawai Datacat Mini-Keyboard kann z.B. keinen Ploytec PL2 steuern. Deshalb habe ich einen Arduino Uno dazwischengeschaltet, der nur Noten- (inklusive Velocity), ControlChange-, ProgramChange- und PitchBend-Befehle weiterleiten soll. Voraussetzungen für das Gelingen sind ein Arduino Uno, die Arduino-Midi-Library, ein Midi-Shield bzw. selbst gebaute Midi In und Out für den Arduino sowie folgender Sketch, den ich zusammenprogrammiert habe: Mit diesem Sketch&#8230;</p>
<p>Der Beitrag <a href="https://www.christianstreng.de/arduino-midi-filter/">Arduino Midi Filter</a> erschien zuerst auf <a href="https://www.christianstreng.de">Christian Streng</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Manche Midi-Controller schicken über ihren Midi-Ausgang unglaublich viel Datenmüll, der oftmals dazu führt, dass sich zwei Geräte nicht verstehen. Mein uraltes Kawai Datacat Mini-Keyboard kann z.B. keinen <a href="http://www.ploytec.com/pl2/">Ploytec PL2</a> steuern. Deshalb habe ich einen Arduino Uno dazwischengeschaltet, der nur Noten- (inklusive Velocity), ControlChange-, ProgramChange- und PitchBend-Befehle weiterleiten soll.</p>



<p>Voraussetzungen für das Gelingen sind ein <a href="http://www.arduino.cc" target="_blank" rel="noopener noreferrer">Arduino Uno</a>, die <a href="https://github.com/FortySevenEffects/arduino_midi_library" target="_blank" rel="noopener noreferrer">Arduino-Midi-Library</a>, ein Midi-Shield bzw. <a href="http://www.notesandvolts.com/2015/02/midi-and-arduino-build-midi-input.html">selbst gebaute Midi In und Out</a> für den Arduino sowie folgender Sketch, den ich zusammenprogrammiert habe:</p>



<pre class="wp-block-code"><code>#include &lt;MIDI.h&gt;

// Arduino Midi Filter
// Version 1.0 by Christian Streng
// Midi Out is on Channel 1.
// www.christianstreng.de/arduino-midi-filter

MIDI_CREATE_DEFAULT_INSTANCE();

void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI);
MIDI.turnThruOff();
MIDI.setHandleNoteOn(MyHandleNoteOn);
MIDI.setHandleNoteOff(MyHandleNoteOff);
MIDI.setHandleControlChange(MyHandleControlChange);
MIDI.setHandleProgramChange(MyHandleProgramChange);
MIDI.setHandlePitchBend(MyHandlePitchBend);
}

void loop() {
MIDI.read();
}

void MyHandleNoteOn(byte channel, byte number, byte velocity) {
MIDI.sendNoteOn(number, velocity, 1);
}
void MyHandleNoteOff(byte channel, byte number, byte velocity) {
MIDI.sendNoteOff(number, velocity, 1);
}
void MyHandleControlChange(byte channel, byte number, byte value) {
MIDI.sendControlChange(number, value, 1);
}
void MyHandleProgramChange(byte channel, byte program) {
MIDI.sendProgramChange(program, 1);
}
void MyHandlePitchBend(byte channel, int value) {
MIDI.sendPitchBend(value, 1);
}</code></pre>



<p>Mit diesem Sketch sendet der Arduino nur auf Kanal 1 (Standardkanal z.B. für den <a href="https://meeblip.com/products/meeblip-triode-synthesizer">Meeblip Triode</a>). Der Sketch lässt sich aber auch leicht an eigene Bedürfnisse anpassen. Die Implementierung der Midi Clock fehlt.</p>



<p><a href="https://www.christianstreng.de/arduino-midi-filter-mit-midi-clock/">UPDATE 1</a>: Meine <a href="https://www.christianstreng.de/arduino-midi-filter-mit-midi-clock/">erste Aktualisierung</a> des Programmcodes ermöglicht das Weitergeben der Daten der Midi Clock.</p>



<p><a href="https://www.christianstreng.de/arduino-midi-filter-mit-led/">UPDATE 2</a>: Diese <a href="https://www.christianstreng.de/arduino-midi-filter-mit-led/">zweite Aktualisierung</a> des Programmcodes lässt eine LED bei Notenweitergabe zur Kontrolle leuchten.</p>
<p>Der Beitrag <a href="https://www.christianstreng.de/arduino-midi-filter/">Arduino Midi Filter</a> erschien zuerst auf <a href="https://www.christianstreng.de">Christian Streng</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.christianstreng.de/arduino-midi-filter/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1671</post-id>	</item>
	</channel>
</rss>
