TinySynth !
Ahle2
Posts: 1,179
Here is a minimalistic synth written in just 35 rows of assembler.
TinySynth - Archive [Date 2012.04.27 Time 22.24].zip
It features:
* 1 Oscillator
* Pulse width modulation
* Very rough low pass filter
* Portamento/slide
* Logaritmic attack and decay
* 500 kHz sample rate for "aliasing free" sound generation
* A massive 164 bytes of code + data for the actual synth (not counting spin code)
* No multiplications or lookup tables (yes you heard me!!)
It was really not meant to be released or even usable as a synth. I just thought that it might be of interest to someone else.
This is just me experimenting with "new" techniques that might be implemented into Retronitus later.
/Johannes
TinySynth - Archive [Date 2012.04.27 Time 22.24].zip
It features:
* 1 Oscillator
* Pulse width modulation
* Very rough low pass filter
* Portamento/slide
* Logaritmic attack and decay
* 500 kHz sample rate for "aliasing free" sound generation
* A massive 164 bytes of code + data for the actual synth (not counting spin code)
* No multiplications or lookup tables (yes you heard me!!)
It was really not meant to be released or even usable as a synth. I just thought that it might be of interest to someone else.
This is just me experimenting with "new" techniques that might be implemented into Retronitus later.
/Johannes
Comments
How on earth did you manage such great 8bit synth sound from so little memory?!?
OBC
The prop still has such a lot of capabilities still being uncovered by such imaginative people
Of course they are. Chipophone is an Atmega based synth, which accepts midi type input and produces square waves, triangle waves or noise. I think Linus having all his knowledge and Propeller code base can replace Atmega with Propeller in some minutes.
This "minimalistic synth" is awesome production.
Video:https://skydrive.live.com/redir.aspx?cid=6d7787b33d967b1a&resid=6D7787B33D967B1A!289&parid=6D7787B33D967B1A!141
(soon available for $14.95, comes with 128k spi flash)
Johannes, pm mej din adress s
You are the king of audio around here! :thumb:
Here is the pseudo code for the sound generation part Some notes:
* The logaritmic behaviour comes from "the divided delta feedback approach"
* It's only possible to handle power of two rise/fall times with shifting
Thanks for the kind words, but to be honest this isn't revolutionary in any sence of the word!
SIDcog and Retronitus are the real achievements of course.
Lol... SVEN!!!
It works brilliantly. Volume is fine with headphones (?32 ohm) and a 1k/0.01uF lowpass filter and no amplifier needed for headphones.
Touch the music icon and your synth plays - see photo.
Now to combine this with a picture of a keyboard so you can play the synth...
I see your notes are midi so they could come in from a real keyboard too.
This synth is really fun!
I tweaked your synth a bit. Now it can be played with a stylus. I found some pictures of proper retro slider pots and switches from an online synth and then added a bit of woodgrain round the outside. Slider pots, switches and red LEDs. Has to look retro! Then just plug all the bitmaps together with your code and you can play it.
Spin synth code ended up about the same size as your demo code - remove the automatic tune playing code and replace with code that reads the slider pots and the keyboard and plays the notes.
Hmm - small problem. My wife is a music teacher and she says it needs a polyphonic keyboard so she can play "chopsticks" with two styluses! Maybe need to add Rayman's capacitive screen? Or a MIDI keyboard. The MIDI should be easy - just add an optocoupler on the RS232 port.
Thanks for this code. Maybe we can add more features from some of your more sophisticated synths?
"Propeller land, where the impossible comes to die"
The company I work for has a current campaign "Rethink Possible" - this forum does a much better job at that than my company does!!
{Of course, under my breath, I'm cursing you guys since this is YET ONE MORE project I need to try.}
Very nice work as always, I can't wait to get this running!
This is THE chip which returned programming joy back to me. Back from these '80s. There is a place for creativity with a Proprller, for something like "this is hard/impossible, so I have to do it". Like these old home computers from 80's when the manual says - four color are possible to display on the screen - then they displayed a colorful photos with it using weird timing and other programmer's black magic. Or simple atari Pokey chip from which someone maked a software synthesizer.
Today I made my first VGA driver with Propeller - it was a real fun to see this good old Atari ST font back on my screen. This - "It works" - and that I can control every aspect of my display. Pixel clock. Line number. Sync time. All I can play with, experiment with and see, if it works and how it works. This is real fun. Not these protected library code I have to call on PC. A hundred line of code to initialize a library. Then no way to tell it, how I want to display my content. I can only call "swap buffer". This of course works, but there is no fun with it. If it takes a 10 miliseconds to swap these buffers, you cannot do anything. Nothing. You can only go, buy a faster cpu. A faster gpu. Buy, Replace. Wait for a new hardware...
One word: Awesome!
That is amazing work @Dr_A!
OBC
@Pik33 Yep. Me too. Just this last weekend, I've been working on TV drivers and color again. Always fun. Eric Ball has put up some underutilized signal code that I'm just now getting to jam on a little. Love the control, because it allows a person to explore what really is possible, instead of what is supplied or stated. Great fun!
Changes from the first version includes noise generation and asymmetric filter.
The noise generator is an "or-modulation" of the phase accumulator and the modulation value. This makes it possible to generate everything from bells to white noise.
The asymetric filter makes it possible to generate saw waves and all kinds of hybrid waveforms. (half triangle, half saw for instance)
(Still no multiplications or lookup tables used)
/Johannes
I'll need to add some more slider pots. I'm working on a simple sequencer with a nice music font. If we wrote this in music, the bomb drop could be a slide trombone (portamento), and the explosion could be percussion.
Have you got a link to the latest code by any chance? This is going to be fun!
I didn't find Retronitus in the OBEX; where might it be accessed?
I'm rather new to this music area, so may not realize how much that's usable this way.
Goal is a rather simple keyboard and a way to synthesize sounds. I've listened to a number of videos and enjoy many of the sounds created. Including the one by Akesson (sp?) which I thought impressive.
Have a look at the first post for the new version!
"bomb drop plus explosion" should be possible to do with a few timed calls to TinySynth methods.
Should I do polyfonic version of TinySynth? I will, of course, have to rename it since it will not be tiny anymore!
@HShanko
Retronitus is the ultimate solution for anyone interested in making old school music and sound FX for games.
The sad thing is that I kind of lost momentum because the sequencer/sound editor I'm developing just bugs me out. (fun intended)
It's not in the OBEX, because it's not done yet!
I have personally not been thinkering with MIDI on the prop yet, but I do have a lot of MIDI equipped synths in my "home studio".
One of my Propeller projects will include a MIDI port, so it's just a matter of time before I will be able to answer your questions.
Until then talk to "Ariba", "AntoineDoinel" or "average joe" and I'm sure you will get all your answers.
(One thing I do know is that "real" MIDI is a lot easier to handle than MIDI over USB)
How could you do polyphony? Do you have to work out the decay values of several notes and add them together?
Gotta run for now but let me know if you need more help.
I downloaded from OBEX the MidiIn. On BST I couldn't compile; got error. Found that, for some reason, BST wouldn't display the first line, which was where the error was. Found it by looking at it with another app and saw 4 strange characters on the first line. Also, BST cursor entry is one line below where the actual edit point is. Temporarily working around that.
Once repaired the first line it compiles. Now without a MIDI interface (yet) or cables, I can go no further.
I searched the source for what pin MIDI should connect to the Prop; I'll have to look for that info further. I was hoping to hear something on the PropBOE. Nada.
I realized I do have a MIDI device; a Korg M1; yes, old; even listed on Wikipedia !!! I'll have to see if that is working. The M1 top surface has been used to store some papers and boxes for some years now. Out of sight and out of mind.
Looking at the M1 manuals I note it does have MIDI; 3 DIN for THRU, OUT and IN. Old MIDI, not USB MIDI. Time to order parts for that MIDI to single-ended circuit and working with MidiIn
Yes. The MidiIn zip file has three files; MidiIn.spin, MIDI in for Propeller.htm, and midi.jpg. The last two show the circuit.
I just realized that MidiIn does not do any synthesis. That is up to other code it appears; like for the PropB3 'Hammond' organ code.. I couldn't find the code to PropB3.
I've printed out both the MidiIn driver and TinySynth. That lets me be anywhere and check out the sources. I don't care to read on-screen; not with bifocals or small type, or bad color text, etc.
It's a bummer that BST doesn't allow printing; at least I don't see it.
My iMac with Parallels/Windows is really slow; minutes to make some keyboard or mouse selections. HD just grinds away and doesn't let me have my turn at inputting. So have to use other ways of printing, thus losing formatting as PropTool provides.