<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[ChipMusic.org - learn to code midi files with a midi compiler]]></title>
		<link>https://chipmusic.org/forums/topic/13082/learn-to-code-midi-files-with-a-midi-compiler/</link>
		<description><![CDATA[The most recent posts in learn to code midi files with a midi compiler.]]></description>
		<lastBuildDate>Sat, 18 Jan 2014 10:38:33 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: learn to code midi files with a midi compiler]]></title>
			<link>https://chipmusic.org/forums/post/198387/#p198387</link>
			<description><![CDATA[<b><i>Aly James says:</i></b><p>yay! this is awesome <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />haven&#039;t tested it yet but does it loads midi files and perform operation based on the content?<br />for example I would need to take every midi notes in the midi file, analyze each note (0 -127) one by one.<br />Previously setting the PPQ to something like 960,<br />The goal is to write a square wave on the volume for every note, the square wave correspond to the note frequency + (some slight detuning)...</p><p>For every new note encountered I calculate the frequency in Hz to find the period and deduct the closer PPQ wait time<br />then for every note, while note on, I will add CC#7 (volume) 127, PPQ/2 wait time corresponding the period, 0 and so on until note off.</p><p>For a 440Hz note, this should adds 880 CC informations per second ( 440 times&nbsp; value =127 and 440 times value =0).<br />Knowing that MIDI baud rate is 31250 and a MIDI CC is 3 bytes long + start and stop bit for every bytes,<br />this gives us 26 bits serially sent for every CCs and a max possibility of 1200 CCs per seconds (31250/26)<br />then to write a square waves on the volume CC a max frequency of 600 Hz (as their is 2 states per period and 2 MIDI CC messages are needed).<br />I think that baud rate limitation do not apply if you use MIDI internally in a DAW...</p><p>At 120 BPM a quarter note is equal to 2Hz, if PPQ is 960 this gives us 960 Hz max resolution for writing a square wave on the volume CC ((2Hz * 960)/2 states of the square wave).<br />If you slightly vary the CC modulation frequency from the actual note this will give you a kind of pulse width modulation especially if the sound source is a square wave too.<br />This is a technique I have used to make timer modulation on the Sega PSG square wave and the technique used for a long time on Atari ST (known as &quot;SID&quot; sound) because these chips had no pulse width control built in...<br />I have implemented this technique in my SPSG VST too.<br />Your program might do the job to convert any midi file or if it can&#039;t, as is, at least I can make a list of midi file per note that I can later import <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>looking forward to your answer.</p><p>Here are possible frequencies for BPM 120 and PPQ 1920.<br />BPM= 120<br />PPQ = 1920<br />(Square waves takes 2 PPQ waits per cycle)<br />---------------------------------------------------------------------<br />wait value (PPQ) &gt;&gt; frequency of modulation (Hz)<br />wait 1 PPQ = 960 <br />wait 2 PPQ = 480<br />wait 3 PPQ = 320<br />wait 4 PPQ = 240<br />wait 5 PPQ = 192<br />wait 6 PPQ = 160<br />wait 7 PPQ = 137<br />wait 8 PPQ = 120<br />wait 9 PPQ = 107<br />wait 10 PPQ = 96<br />wait 11 PPQ = 87.3<br />wait 12 PPQ = 80<br />wait 13 PPQ = 73.8<br />wait 14 PPQ = 68.6<br />wait 15 PPQ = 64<br />wait 16 PPQ = 60<br />wait 17 PPQ = 56.5<br />wait 18 PPQ = 53.3<br />wait 19 PPQ = 50.5<br />wait 20 PPQ = 48<br />wait 21 PPQ = 45.7<br />wait 22 PPQ = 43.6<br />wait 23 PPQ = 41.7<br />wait 24 PPQ = 40<br />wait 25 PPQ = 38.4<br />wait 26 PPQ = 36.9<br />wait 27 PPQ = 35.6<br />wait 28 PPQ = 34.3<br />wait 29 PPQ = 33.1<br />wait 30 PPQ = 32<br />wait 31 PPQ = 31<br />wait 32 PPQ = 30<br />and so on...</p>]]></description>
			<pubDate>Sat, 18 Jan 2014 10:38:33 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/198387/#p198387</guid>
		</item>
		<item>
			<title><![CDATA[Re: learn to code midi files with a midi compiler]]></title>
			<link>https://chipmusic.org/forums/post/196649/#p196649</link>
			<description><![CDATA[<b><i>sandneil says:</i></b><p>thanks =-))</p><p>added both kinds of aftertouch now too... ill probably never use this stuff but w/e, majority of the gm spec is in there now i think</p>]]></description>
			<pubDate>Wed, 01 Jan 2014 03:03:11 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/196649/#p196649</guid>
		</item>
		<item>
			<title><![CDATA[Re: learn to code midi files with a midi compiler]]></title>
			<link>https://chipmusic.org/forums/post/196647/#p196647</link>
			<description><![CDATA[<b><i>PROTODOME says:</i></b><p>Pretty cool.</p>]]></description>
			<pubDate>Wed, 01 Jan 2014 02:49:04 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/196647/#p196647</guid>
		</item>
		<item>
			<title><![CDATA[Re: learn to code midi files with a midi compiler]]></title>
			<link>https://chipmusic.org/forums/post/196644/#p196644</link>
			<description><![CDATA[<b><i>sandneil says:</i></b><p>sysex is now in!! no idea if it works though</p>]]></description>
			<pubDate>Wed, 01 Jan 2014 02:24:16 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/196644/#p196644</guid>
		</item>
		<item>
			<title><![CDATA[Re: learn to code midi files with a midi compiler]]></title>
			<link>https://chipmusic.org/forums/post/196641/#p196641</link>
			<description><![CDATA[<b><i>herr_prof says:</i></b><p>Just asking in theory.. Have no practical need for them but the whole concept has my wheels turning!</p>]]></description>
			<pubDate>Wed, 01 Jan 2014 01:51:53 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/196641/#p196641</guid>
		</item>
		<item>
			<title><![CDATA[Re: learn to code midi files with a midi compiler]]></title>
			<link>https://chipmusic.org/forums/post/196640/#p196640</link>
			<description><![CDATA[<b><i>sandneil says:</i></b><p>if you want them i can add them right now, only thing is i have no way to test them bcause i dont think i have any hardware that uses sysex, but i can give it a shot</p>]]></description>
			<pubDate>Wed, 01 Jan 2014 01:41:32 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/196640/#p196640</guid>
		</item>
		<item>
			<title><![CDATA[Re: learn to code midi files with a midi compiler]]></title>
			<link>https://chipmusic.org/forums/post/196639/#p196639</link>
			<description><![CDATA[<b><i>herr_prof says:</i></b><p>Whoa! Interesting! Any plans to add sysex commands?</p>]]></description>
			<pubDate>Wed, 01 Jan 2014 01:19:12 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/196639/#p196639</guid>
		</item>
		<item>
			<title><![CDATA[learn to code midi files with a midi compiler]]></title>
			<link>https://chipmusic.org/forums/post/196631/#p196631</link>
			<description><![CDATA[<b><i>sandneil says:</i></b><p>happy new years 2k14 ok</p><p>i made this midi compiler<br />its like a programming language for midi files<br />and it uses the ~industry standard~ Tcl programming language so if you learn how to use it youll literally be more employable</p><p><a href="http://8bitcollective.biz/$/software/midiasm/manual.html" target="_blank">http://8bitcollective.biz/$/software/mi &#133; anual.html</a></p><p>idk theres a lot of stuff like supercollider and max but in the end i think they are really focused on synthesis andwe&#039;ve had powerfull tools for synthesizing new sounds for ages </p><p>so this is just pure midi and its all about ---algorithmic composition--- aka computer aided composition or what not. </p><p>like in 10 lines you can make a program that plays every note on every instrumet...or whatever, you know its pretty hacker</p><p>i dont think its hard to use and its kind of unique in what it is i think although i didnt spend much time lookin</p><p>anyway i love hyping up my stuff and none of you are gonna care LOL but anyway happy new year have a great one :-)</p><p>xxx</p>]]></description>
			<pubDate>Tue, 31 Dec 2013 23:52:32 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/196631/#p196631</guid>
		</item>
	</channel>
</rss>
