<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[ChipMusic.org - Arduino Drum Machine]]></title>
	<link rel="self" href="https://chipmusic.org:80/forums/feed/atom/topic/9297/"/>
	<updated>2012-12-05T14:55:12Z</updated>
	<generator>PunBB</generator>
	<id>https://chipmusic.org/forums/topic/9297/arduino-drum-machine/</id>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/145138/#p145138"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>Downstate wrote:</cite><blockquote><p>sorry man, wasnt trying to be a dick....</p></blockquote></div><p>No man I&#039;ve been up and down about school a lot. It was just you kinda reinforced the thought. And i go to the art institute for audio production. The facilities are very nice and my teachers are really passionate. But yeah. I&#039;m thinking this is more of a hobby than a career. I wasnt being sarcastic at all haha sorry if it came off that way! I really do bump the mixtape.</p>]]></content>
			<author>
				<name><![CDATA[squidula]]></name>
				<uri>https://chipmusic.org/squidula</uri>
			</author>
			<updated>2012-12-05T14:55:12Z</updated>
			<id>https://chipmusic.org/forums/post/145138/#p145138</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144873/#p144873"/>
			<content type="html"><![CDATA[<p>I thought about being an undergrad in a music tech program, but now I&#039;ve decided to just go in as an electrical engineering major.&nbsp; I think it will be for the best!</p>]]></content>
			<author>
				<name><![CDATA[Theta_Frost]]></name>
				<uri>https://chipmusic.org/Theta_Frost</uri>
			</author>
			<updated>2012-12-03T22:50:42Z</updated>
			<id>https://chipmusic.org/forums/post/144873/#p144873</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144814/#p144814"/>
			<content type="html"><![CDATA[<p>haha</p>]]></content>
			<author>
				<name><![CDATA[Downstate]]></name>
				<uri>https://chipmusic.org/Downstate</uri>
			</author>
			<updated>2012-12-03T09:44:01Z</updated>
			<id>https://chipmusic.org/forums/post/144814/#p144814</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144810/#p144810"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>Downstate wrote:</cite><blockquote><p>my punctuation. jesus. and im an english teacher? seriously</p></blockquote></div><div class="quotebox"><cite>Downstate wrote:</cite><blockquote><p>education is the biggest rip off business going</p></blockquote></div><p><img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[ashimoke]]></name>
				<uri>https://chipmusic.org/ashimoke</uri>
			</author>
			<updated>2012-12-03T07:44:40Z</updated>
			<id>https://chipmusic.org/forums/post/144810/#p144810</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144802/#p144802"/>
			<content type="html"><![CDATA[<p>my punctuation. jesus. and im an english teacher ? seriously</p>]]></content>
			<author>
				<name><![CDATA[Downstate]]></name>
				<uri>https://chipmusic.org/Downstate</uri>
			</author>
			<updated>2012-12-03T05:14:27Z</updated>
			<id>https://chipmusic.org/forums/post/144802/#p144802</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144801/#p144801"/>
			<content type="html"><![CDATA[<p>sorry man, wasnt trying to be a dick.........but education is the biggest rip off business going. especially in niche sectors, atleast know with the internet and nerd forums like this the information is as you say available for free to all if you can be motivated to search, you can pretty much work out how to get anything accomplished.</p>]]></content>
			<author>
				<name><![CDATA[Downstate]]></name>
				<uri>https://chipmusic.org/Downstate</uri>
			</author>
			<updated>2012-12-03T05:13:39Z</updated>
			<id>https://chipmusic.org/forums/post/144801/#p144801</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144797/#p144797"/>
			<content type="html"><![CDATA[<p>There are very few schools in one&#039;s area that care more about actually teaching/satisfying their students&#039; intellectual needs. Most of &#039;em just wanna get by with the money they can earn.</p><p>Good luck on this project and on your future education.</p>]]></content>
			<author>
				<name><![CDATA[Jansaw]]></name>
				<uri>https://chipmusic.org/Jansaw</uri>
			</author>
			<updated>2012-12-03T04:42:19Z</updated>
			<id>https://chipmusic.org/forums/post/144797/#p144797</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144796/#p144796"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>Downstate wrote:</cite><blockquote><p>might be a silly question, but arent you supposed to learn how to do this in midi class ?</p></blockquote></div><p>This post really has done a number on me. After I read this, I seriously had to take a step back to think of what I&#039;ve learned at this school for audio production. All I&#039;ve really learned is to find the resources myself to crunch last minute projects for classes that weren&#039;t actually taught to the class. I&#039;m paying an awfully large amount to attend this school, and I am reading from 7 or 8 instructables, tutorials, blogs, etc. that are on the internet for free. I will most likely switch majors in the near future. Thanks Downstate. I bump your mixtape a lot.</p>]]></content>
			<author>
				<name><![CDATA[squidula]]></name>
				<uri>https://chipmusic.org/squidula</uri>
			</author>
			<updated>2012-12-03T04:30:20Z</updated>
			<id>https://chipmusic.org/forums/post/144796/#p144796</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144470/#p144470"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>little-scale wrote:</cite><blockquote><p>Downstate, somewhat ironically, the questions that the original poster is asking are very well documented on the net and don&#039;t need to be asked on a chip forum!</p></blockquote></div><p>yeah, but that would require using google.</p>]]></content>
			<author>
				<name><![CDATA[nickmaynard]]></name>
				<uri>https://chipmusic.org/nickmaynard</uri>
			</author>
			<updated>2012-11-30T08:22:14Z</updated>
			<id>https://chipmusic.org/forums/post/144470/#p144470</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144455/#p144455"/>
			<content type="html"><![CDATA[<p>Downstate, somewhat ironically, the questions that the original poster is asking are very well documented on the net and don&#039;t need to be asked on a chip forum!</p>]]></content>
			<author>
				<name><![CDATA[little-scale]]></name>
				<uri>https://chipmusic.org/little-scale</uri>
			</author>
			<updated>2012-11-30T05:56:47Z</updated>
			<id>https://chipmusic.org/forums/post/144455/#p144455</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144453/#p144453"/>
			<content type="html"><![CDATA[<p>might be a silly question, but arent you supposed to learn how to do this in midi class ? I&#039;d quit midi class and just become LS&#039;s understudy</p>]]></content>
			<author>
				<name><![CDATA[Downstate]]></name>
				<uri>https://chipmusic.org/Downstate</uri>
			</author>
			<updated>2012-11-30T05:47:20Z</updated>
			<id>https://chipmusic.org/forums/post/144453/#p144453</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144367/#p144367"/>
			<content type="html"><![CDATA[<p>Yikes hahah thanks so much guys. This really helps. When I get all the parts in the mail (today or tomorrow), I will definitely use this thread as a reference. I will most definitely be returning with more questions too hah. I will document my work the best I can so I can show you guys the final product when its done. Should be fun!</p>]]></content>
			<author>
				<name><![CDATA[squidula]]></name>
				<uri>https://chipmusic.org/squidula</uri>
			</author>
			<updated>2012-11-29T15:37:50Z</updated>
			<id>https://chipmusic.org/forums/post/144367/#p144367</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144211/#p144211"/>
			<content type="html"><![CDATA[<p>And finally if you connect eight buttons to pins 2 - 8 like in the diagram shown above (i.e. pin 2,3,4,5,6,7,8 --&gt; switch || switch --&gt; ground):</p><p><a class="postimg" href="http://milkcrate.com.au/blah/Screen%20Shot%202012-11-28%20at%208.58.02%20PM.png" title="http://milkcrate.com.au/blah/Screen%20Shot%202012-11-28%20at%208.58.02%20PM.png" id="forum_image_28258128"><img src="http://milkcrate.com.au/blah/Screen%20Shot%202012-11-28%20at%208.58.02%20PM.png" /></a></p><br /><p>Then the following code should give you some ideas. </p><p>I haven&#039;t tried out any of these. YMMV. </p><div class="codebox"><pre><code>byte MIDI_pitch[] = {60,62,63,65,67,69,71,72}; // value of MIDI pitch to associate with button
byte MIDI_velocity[] = {127,127,127,127,127,127,127,127}; // value of MIDI velocity to associate with button
byte MIDI_channel[] = {0,0,0,0,0,0,0,0}; // value of MIDI channel to associate with button

byte previous[8]; // place to store previous data byte for comparison
byte current;  // place to store current data byte for comparison

void setup() { // let&#039;s begin..
  Serial.begin(57600); // open serial port
  pinMode(2, INPUT); // set pin mode of button to input
  digitalWrite(2, HIGH); // activate internal Arduino resistor
  pinMode(3, INPUT); // set pin mode of button to input
  digitalWrite(2, HIGH); // activate internal Arduino resistor
  pinMode(4, INPUT); // set pin mode of button to input
  digitalWrite(2, HIGH); // activate internal Arduino resistor
  pinMode(5, INPUT); // set pin mode of button to input
  digitalWrite(2, HIGH); // activate internal Arduino resistor
  pinMode(6, INPUT); // set pin mode of button to input
  digitalWrite(2, HIGH); // activate internal Arduino resistor
  pinMode(7, INPUT); // set pin mode of button to input
  digitalWrite(2, HIGH); // activate internal Arduino resistor
  pinMode(8, INPUT); // set pin mode of button to input
  digitalWrite(2, HIGH); // activate internal Arduino resistor
  pinMode(9, INPUT); // set pin mode of button to input
  digitalWrite(2, HIGH); // activate internal Arduino resistor
} // end of the beginning

void loop() { // let&#039;s loop...
  for(int i = 0; i &lt; 8; i++) {
  current = digitalRead(i+2); // read the current state of the button
  
  if(current != previous[i]) { // compare the current state of the button to previous state 
    previous[i] = current; // if it&#039;s change, store the current for future comparison
    Serial.write(0x90 + MIDI_channel[i]); // send MIDI status byte for note on event
    Serial.write(MIDI_pitch[i]); // send MIDI data byte for pitch component
    Serial.write((1 - current) * MIDI_velocity[i]); // send MIDI data byte for velocity component
  } // end if
  
  delay(10); // debounce
  }
} // end loop</code></pre></div>]]></content>
			<author>
				<name><![CDATA[little-scale]]></name>
				<uri>https://chipmusic.org/little-scale</uri>
			</author>
			<updated>2012-11-28T10:36:22Z</updated>
			<id>https://chipmusic.org/forums/post/144211/#p144211</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144199/#p144199"/>
			<content type="html"><![CDATA[<p>little-scale did it again</p>]]></content>
			<author>
				<name><![CDATA[ashimoke]]></name>
				<uri>https://chipmusic.org/ashimoke</uri>
			</author>
			<updated>2012-11-28T08:18:41Z</updated>
			<id>https://chipmusic.org/forums/post/144199/#p144199</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Arduino Drum Machine]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/144143/#p144143"/>
			<content type="html"><![CDATA[<p>Also might be worth your time: <br /><a href="http://little-scale.blogspot.com.au/2007/11/pots-and-switches-to-midi-data.html" target="_blank">http://little-scale.blogspot.com.au/200 &#133; -data.html</a><br /><a href="http://little-scale.blogspot.com.au/2007/11/more-pots-and-switches-to-midi-data.html" target="_blank">http://little-scale.blogspot.com.au/200 &#133; -data.html</a></p>]]></content>
			<author>
				<name><![CDATA[little-scale]]></name>
				<uri>https://chipmusic.org/little-scale</uri>
			</author>
			<updated>2012-11-28T02:56:12Z</updated>
			<id>https://chipmusic.org/forums/post/144143/#p144143</id>
		</entry>
</feed>
