1 The super minimal SID manual
197 |199 | This manual has taken information on wikipedia and from this html page 200 | which reproduce the original datasheet1. 201 |
202 | 203 |204 | For better performance, it is suggested to use an arduino uno as a 205 | I2C-connected SID emulator. 206 |
207 |1.1 Let's Start
211 |213 | The 6581 Sound Interface Device (SID) is a single-chip, 3-voice electronic music synthesizer/sound effects generator compatible with the 65XX and similar microprocessor families 214 |
215 | 216 |217 | The SID has been part of the C/64 success. 218 |
219 | 220 |221 | This arduino emulation library divert Voice2 to another pin, to enable a 222 | "Stero" effect somewhat. 223 | Connect pin9 and pin 10 to two piezo speaker, and the other side to 224 | the ground. 225 |
226 | 227 |228 | The 6581 consists of three synthesizer “voices” which can be used 229 | independently or in conjunction to create complex sounds. 230 | Each voice consists of a Tone Oscillator/Waveform Generator, an 231 | Envelope Generator and an Amplitude Modulator. 232 | The Envelope Generator is controlled via an ADSR (Attack Decay Sustain 233 | Release) configuration. 234 |
235 | 236 |237 | When a mechanical musical instrument produces sound, the Loudness of 238 | the sound produced changes over time in a way that varies from 239 | instrument to instrument. When a pipe organ's key is pressed, for 240 | example, it plays a note at constant volume; the sound dies quickly 241 | when the key is released. 242 | By contrast, the sound of a guitar is 243 | loudest immediately after a string is plucked, and quickly fades. 244 |
245 | 246 |247 | A synthesizer's ADSR envelope is a way to tailor the timbre for the 248 | synth, sometimes to make it sound more like a mechanical instrument. 249 | A quick attack with little decay helps it sound more like an organ; a 250 | longer decay and zero sustain makes it sound more like a guitar. While 251 | envelopes are most often applied to volume, they are also commonly 252 | used to control other sound elements, such as filter frequencies or 253 | oscillator pitches. 254 |
255 | 256 |257 | Today modern synthesizers use samples to reproduce sound with a strong 258 | accuracy. 259 | But in 1982, ADSR was a state-of-the-art for a music chip. 260 |
261 | 262 |263 | For more information look at http://en.wikiaudio.org/ADSR_envelope 264 |
265 | 266 |267 | The suggested setup is to have an arduino as a SID, driven via I2C (see examples) 268 | The I2C protocol in the example is very easy: send two bytes, one for 269 | the register and the second for the value to store inside. 270 |
271 | 272 | 273 |
275 |
2 How to convert midi files and play them on Stereo Sid
283 |285 | MIDI file are a very old standard which fit more or less in the Sid. 286 | MIDI specification is 127 note wide, whereas SID has 94 possibilites. 287 | MIDI support a bit more notes. 288 | Stereo Sid provide you a midi2Sid function to remap a 8bit Midi note 289 | to a 16bit SID register spec. 290 | The function will emit a silence for all notes the SID cannot play. 291 | SID playable MIDI range is 25-118. 292 | To convert it we used the 440hz (A4) center (midi 81, 0x1CD6 on SID). 293 |
294 |2.1 Setup
297 |299 | Because SID can generate only 3 voices at a time, you should edit 300 | your midi with some program like AriaMaestosa 301 | (http://ariamaestosa.sourceforge.net/) to be sure it fits nicely in 302 | your SID, i.e. does not use more then three instruments. 303 | If you do this step before dumping and exporting, the resulting file 304 | fill be easier to play. 305 |
306 |2.2 Compile midicsv
310 |312 | Download and compile midicsv from 313 | http://www.fourmilab.ch/webtools/midicsv/ 314 | Midicsv is a very good tool and will save your day 315 |
316 |2.3 Simple approach
320 |
322 | A simple approach is to extract 3 tracks from a midi and generate three
323 | simple C source arrays to push in a player sketch.
324 | Midicsv dump the single note like
325 | Track, Time, Note_on_c, Channel, Note, Velocity
326 | Read midicsv manual for more information.
327 |
330 | With this command 331 |
332 |./midicsv doremifasolasido.mid | egrep ^2 | egrep Note_on_c |cut -d , -f 5,2 335 |336 |
338 | you can extract a list of { duration, note } for track 2. 339 | We track down only the note start for every track (it is a 340 | over-simplification). 341 | The key idea is to have three "queue" with a pointer to the current 342 | note and a global time counter. 343 | after pushing 3 notes, we increment the clock and play the next note 344 | when is the right time. 345 |
346 | 347 |348 | The empire_player.ino demo will show you this in practice. 349 |
350 |3 Drums: SID Configuration
358 |360 | Take a look at 361 | http://www.lyonlabs.org/commodore/stereo-sid/qlink/half-moon-lake-patches-v1.txt 362 | for more ADSR patterns 363 |
364 |3.1 Viola/Strings
368 |370 |
371 | Waveform: Sawtooth 372 | Attack: 9 373 | Decay: 0 374 | Sustain: 12 375 | Release: 8 376 | Release Point: 0 377 |
378 |3.2 Pipe Organ
383 |385 | Waveform: Pulse 386 | Pulse Width: 2000 Reg 2/3 (12 bit però) 387 | PWout = (PWnReg/40.95) % 388 | Attack: 3 389 | Decay: 6 390 | Sustain: 6 391 | Release: 3 392 | Release Point 3 393 |
394 |