Synthesizer
-
Very cool
-
I am waiting for someone to make a bad apple demo with fuze
-
@ITzTravelInTime I am currently trying to add switches and settings to the top. Which means redrawing the keyboard each time. You can visually see fuze drawing each box. I'd say the entire keyboard takes a couple milliseconds to draw so I am unsure if something like bad Apple demo is possible at a decent speed. (It's no doubt machine coded)
I have made ui's on android using 2d shapes and it's the same way. I might have to use images and sprites instead. One more trick to try first.
-
@sys64738 Can't you draw the content on an offscreen bitmap first?
-
@Nisse5 I have no idea. Feel free to point me in the right direction so I can study how to do it though
-
you can do this very easily using
setdrawtarget
so create an image to store your keyboard
setdrawtarget(mynewimage)
draw your stuff
then setdrawtarget(framebuffer)then to draw your keyboard
drawimage(mynewimage) -
@MikeDX Hi Mike playing around with this. Got it working and it's rock solid now thanks. But the behaviour seems different than the help shows it.
Pseudo explanation but if I do as help implies it works
Setdrawtarget (imagename)
Box
Circle
TriangleIt draws the box to the image but circle and triangle directly to screen.
I'm using loops in my program to draw keys but essentially had to do it like this.
Setdrawtarget (imagename)
Box
Setdrawtarget (imagename)
Circle
Setdrawtarget (imagename)
Triangle -
I'm going to test this. setdrawtarget shouldn't change ever (maybe update?) unless called manually.
i use it a lot in pacman for the different layers, but admittedly I don't use 2d drawing primitives much
-
Seemed to be using update in my loop that was making it change target Mike.
Update on the project. Now have all the black keys working and a 2d array that holds all the note and modulation values. You can cycle through each parameter with the dpad and change the parameters. Will work on sequencer next.
-
Very nice. 👍 Great job.
-
@sys64738 ooh what's YOUR friend code?
-
@Ancientspark not sure yet, I will share the project and friend code when I finish it
-
@sys64738 Kitty didn't like that last part. Did you see it hitting itself? :P
-
@Discostew yeah he face Palmed. At least he let me program that day instead of standing on the switch.
Small update.
Making good progress today. Have the 16 sequencer buttons drawn. Playing just a test note each step as the sequencer plays and lights up each step. Also made the sequencer buttons selectable by touch.
Amazing how much better you get just by iterating.
I looked at the 60 or so lines of if statements that works out the keyboard press locations and went ugh. Did it in about 4 lines for the sequencer. So might have to redo the keyboard code soon.Next up is expanding the 2d array to hold 16 patches instead of 1 and getting the sequencer to play through it.
-
Awesome work!
-
Phew the 2d array has been expanded, and the sequencer is semi operational! I've modelled it after the sequencer in korgs monologue synth but have already added some things it can't do.
you select a sequencer step (when its red its currently selected) and press a note on the keyboard and records that note as well as every other setting like wavetype, modulator frequency into the corresponding column in the 2d array, so this means it can not only record a note in each step but an entirely different sound (this is how the sidchip on c64 did so much with only 3 voices) which is currently mostly working but I need to sort out a few niggles.
So when you select another step you will notice the last one you set is green, when the sequencer is playing it only plays the green blocks, the white blocks can be considered rests (though they can and do hold data and notes) you can toggle blocks on and off as you see fit, even while the sequencer is playing. This allows some progressive melodies in live performances.
Heres a video showing the basics of the sequencer
next up I need to work on a step recorder, so it just automatically fills in the notes to the sequencer blocks as you play, also need to fix some minor issues and niggles. Hopefully in the next video I'll show how it can play through 16 different patches.
-
@sys64738 Really nice progress on your project! I'm playing around with doing a sequencer as well, but my approach is very different to yours. I very much enjoy seeing multiple solution to the same task.
-
@Nisse5 I've used trackers back in the day. Aswell as a few of the modern cubase type things but hardware synths is my passion. Be interested to see how you do it.
I'll try a more hands on classic synth after this one that plays 3 voices easily at once more in line with the vibrato stuff you were doing. Probably take me a few more weeks to get this one finished. As I want the 16 block sequencer to work individually for all 16 channels at which point it's going to need the ability to load and save songs.
-
I have fixed most the niggles in the sequencer, added some simple modifiers to when your adjusting some parameters with the dpad so it doesn't take forever to get to speed 500! anymore, no step recording yet but I did finish the patch per step. In the video I have quickly edited in 16 patches using the dpad before recording. if you select block 6 to make it red, it will also switch to patch 6 which you can then play on the keyboard, the last note you play will be recorded into the sequencer along with a snapshot of the patch. Have also been inspired by Nisse5 to display the patches in code format in case you want to use one in another project.
So even if you don't want to use the sequencer to automate music you can use it to select 16 different patches.
Which leads to the problem of, hey I made a really cool patch on block 1 but when I select block 2 it's gone? So next I will implement a "patch lock" if you toggle on patch lock it will keep the current patch no matter what block you select and it will also record the patch to the new block, this way you can use all one patch, copy patches, use a mixture of new patches and copied patches.
I think I will leave it with the single voice and sequencer for version 1.0 and share that soonish, so people can play with it while I learn 3d arrays and filesystem stuff
-
Patch Lock is completed, I got a bit sidetracked and added random patch button, I feature I love on one of my hardware synths. It made mostly garbage sounds so I've added some code to so that it mostly will make a nice sounding a patch but still has a lesser chance of going a bit more wild on the parameters, it's made a couple of real nice sounds for me, I had to take a photo of the displayed patch code for later use! I also added another feature from real synths, they generally have a pitch wheel or ribbon to the left of the keyboard, so I've added that in.
Here is the video, it's actually quite fun to mess around with.
Which leads to some bad news and some good news, as I get more and more complicated the code the arrays are not seeming to cope and trying to find workarounds to bugs that make no sense seems time not well spent. the newly added randomizer, which you would never want to press while the sequencer was running, would you? would you!? well it crashes the synth. Timer for the sequencer just seems to bug out the arrays when it's running. On the other hand the pitchbender would be a blast to use while the sequencer is playing, imagine how much fun that would be but nope, array once again no longer recognises itself if the timer is running and crashes if you touch the pitch bender.
I would normally not ever post or publish code that I know can crash, I could disable these features while the sequencer is running to prevent the crashing but I'm hoping this is just a temporary issue with the fuze software, or even something I've done wrong. So the bad news is, I'm going to leave it using a single voice with a single sequencer until the array bug is resolved. The good news is, it's almost finished, if I didn't spend so much time writing these giant posts I'd have finished it already.
I am going to add keyboard tracking (what Nisse5 called Ratios) that increases the modulation frequency inline with the frequency changes from pressing keys, this is a pretty standard thing on real synthesizers, might make it a toggle , we'll see.
and then I'll add the step recorder, clean up the code and make sure it has lots of commenting and share it with my friend code. Next post here will be the finished program.