Author Topic: Atmegadrum source code  (Read 2783 times)

Atmegadrum source code

« on: January 01, 2015, 11:16:30 PM »
Open quickbuttons

charliesays

Posts: 7

Offline
  • *
  • Newbie
    • View Profile
Hi there,
loving the synth, it's really amazing! Just wondered if you would know why, when I'm uploading the Atmegadrum 1_1 source code, it says the sketch is too big? I'm using Arduino 1.0.6
Any advice would be great.
Thanks!

Re: Atmegadrum source code

« Reply #1 on: January 02, 2015, 02:02:29 PM »
Open quickbuttons

paulsoulsby

Posts: 171

Offline
  • Administrator
  • *****
  • Full Member
    • View Profile
Hi,
The first Atmegatron software was written with 1.0.5.  I think Arduino must have added something when they realised 1.0.6.  The code was already on the edge with 1.0.5, so I think that tipped it over the edge.
If you want to use a 1.1, you can still get 1.0.5 of the Arduino sofware here:  http://arduino.cc/en/Main/OldSoftwareReleases

1.3 should be fine with 1.0.6.  I'd definitely recommend using 1.3.

Re: Atmegadrum source code

« Reply #2 on: January 04, 2015, 12:51:17 PM »
Open quickbuttons

charliesays

Posts: 7

Offline
  • *
  • Newbie
    • View Profile
Thanks - I'm using 1.3 of Atmegatron but trying to load 1.1 of AtmegaDrum - I'll try the earlier Arduino and see if that helps.

Re: Atmegadrum source code

« Reply #3 on: January 05, 2015, 11:25:54 AM »
Open quickbuttons

paulsoulsby

Posts: 171

Offline
  • Administrator
  • *****
  • Full Member
    • View Profile
Oops - misread the question!  Yes, the Atmegadrum will def run with Arduino 1.0.5.  I should shave a few samples off the drum sounds and make sure it runs with 1.0.6.  It's only out by about 12 bytes (i.e. 12 samples).  I'll update the downloads page later today.

Re: Atmegadrum source code

« Reply #4 on: January 05, 2015, 12:11:44 PM »
Open quickbuttons

charliesays

Posts: 7

Offline
  • *
  • Newbie
    • View Profile
No problem and thanks - downloaded 1.0.5 and it's uploaded the Atmegadrum fine, now to go make some 8-bit beats!  :D

Re: Atmegadrum source code

« Reply #5 on: September 17, 2015, 10:23:26 PM »
Open quickbuttons

ploom2

Posts: 21

Offline
  • *
  • Newbie
    • View Profile
hi
i got things downloading today :)

question 1 for atmegadrum.
whats the best approach in putting in my own samples?
file size?
bit rate ?
and how do i get them converted into the text string (i'm on a mac)

and any other magic numbers to change in the source code to adapt things to my samples (like those numbers in seq_patstore[16] ?

i'm not a coder...idiot proof answers would be great for me.
thanks.

Re: Atmegadrum source code

« Reply #6 on: September 18, 2015, 10:39:29 AM »
Open quickbuttons

paulsoulsby

Posts: 171

Offline
  • Administrator
  • *****
  • Full Member
    • View Profile
Hi,
The first step is to save the files in 8-bit.  You can do this in Audacity.  http://audacityteam.org/
Open file, trim it (the samples need to be VERY short to fit into memory!)
File->Export..., set format = "other uncompressed files".  Options:  header = microsoft wav, encoding = unsigned 8-bit PCM.

The next stage is to convert the wav into a list of numbers.  If you have access to a windows machine this is easy, just install this code generator app:  http://soulsbysynths.com/wp-content/uploads/2013/12/Atmegadrum-Wavetable-Builder.zip

Unfortunately I don't have any solution for doing this on a Mac.  There may be software out there already that can do this, but I don't know of any off-hand.

I may well convert the app to Mac in the future.  This isn't a straightforward thing to do though I'm afraid.
You can get this for Mac, which allows PC apps to run: https://www.codeweavers.com/products/

Re: Atmegadrum source code

« Reply #7 on: September 18, 2015, 06:38:16 PM »
Open quickbuttons

ploom2

Posts: 21

Offline
  • *
  • Newbie
    • View Profile
thanks , yeh i'm digging into pc emulation to run an old nord editor too.

so would i only need to update the long strings of the samples and not tweak any other info ?
I'll try to dig into it this weekend. the drum machine is fun.

Re: Atmegadrum source code

« Reply #8 on: September 19, 2015, 09:05:05 AM »
Open quickbuttons

paulsoulsby

Posts: 171

Offline
  • Administrator
  • *****
  • Full Member
    • View Profile
The app generates all the code and saves as wavestore.ino.  Then put the wavestore.ino file into your Arduino sketch folder, replacing old file. Then upload to Atmegatron.

You need to have something in all 16 sounds, and the total of all sounds must be less than 20kb.  The app will show you this total.

If you want a long sound, just load in a couple of samples of silence into some of the other sounds.

Re: Atmegadrum source code

« Reply #9 on: September 19, 2015, 07:33:28 PM »
Open quickbuttons

ploom2

Posts: 21

Offline
  • *
  • Newbie
    • View Profile
thanks

i noticed it can stutter / slow down little but generally it works fine.

Re: Atmegadrum source code

« Reply #10 on: September 23, 2015, 11:31:49 PM »
Open quickbuttons

ploom2

Posts: 21

Offline
  • *
  • Newbie
    • View Profile
hi
i was wondering , if i update wavs 1 to 16 does the editor automatically load them up ?
just bought a cheap laptop to run pc things :)

Re: Atmegadrum source code

« Reply #11 on: September 26, 2015, 10:29:24 AM »
Open quickbuttons

paulsoulsby

Posts: 171

Offline
  • Administrator
  • *****
  • Full Member
    • View Profile
Hi,
Apologies for the delay.  I realised that all the Atmegadrum downloads were a little out of date and needed updating.
If you go to the Atmegatron downloads page you see a new Atmegadrum sketch (v1.2.1) and Atmegadrum wavetable builder (v1.1)
Please download these and install the wavetable builder.

To use the wavetable builder: 
1)  Select a drum sample to replace (bottom left)
2)  Click Import wav... and select the file you want to import.  (Remember, use Audacity to convert them to 8bit 8kHz).
3)  Use the slider under the waveform to shorten the wav.  It will auto-find a zero crossing (so no clicks).
4)  Once you've done this for all sounds, make sure that the total samples is less than 19500 samples.  If not, crop ends off samples using slider until it is.
5)  Click Save Wavetable... and overwrite Wavetable.ino in Atmegadrum Arduino sketch folder.  Do this with Arduino software closed.
6)  Then open sketch and upload to Atmegatron in usual way!
 8)

Re: Atmegadrum source code

« Reply #12 on: September 26, 2015, 06:01:45 PM »
Open quickbuttons

ploom2

Posts: 21

Offline
  • *
  • Newbie
    • View Profile
thanks