What are you coding?

Soldato
Joined
1 Feb 2006
Posts
3,470
Hi,
Are you working on anything good?
I have not had much work lately so have been doing some learning projects.
Path Tracer <C++, Vulkan>:
Found a nice YouTube series https://www.youtube.com/playlist?list=PLlrATfBNZ98edc5GshdBtREv5asFW3yXl
Have extended the code to add:
triangles, textures, specular and model loading.

Music Player <C#, WinUI>:
Started as a “Just loop through a folder” MP3 player but ended up adding stuff just for fun:



Am currently working on hooking up a Midi sampler and sound fonts so I can play while an mp3 is also playing.
 
Last edited:
Man of Honour
Joined
13 Oct 2006
Posts
91,971
In a fit of how hard can it be I decided to modify a basic 12V UPS which lacked any kind of monitoring features/USB interface to be able to control it via USB using an ATTiny85 (Arduino would have been much better) only to find the ATTiny85 doesn't have a properly working USB serial interface and having to make it appear to the system as a game controller and then use raw input to grab the controller status in the background and sending the data like voltage and temperature, etc. via button states...

JBGMgzt.png


zUNYdcr.png


Still a work in progress as inferring battery status in this manner has a lot of issues with the voltage drooping under load, etc. without being plugged into the onboard battery management system itself it is largely guess work.

Coding in C++ but sticking pretty much to old school C approaches, no frameworks, because I hate C++/C# - also the first proper foray into doing it with C as historically I've used Visual Basic for any kind of frontend stuff, so lots of fun and games finding out the problems with low level win32... not to mention interfaces like raw input just make me face palm repeatedly at how stupid they are.

I'm also working on various game mods, mostly a mod for Quake 2 RTX - though I'm not doing much seriously with it at the moment:

 
Last edited:
Soldato
Joined
6 Feb 2004
Posts
20,662
Location
England
I'm a incompetent buffoon who dabbles with foobar2000 (audio player) component development. I'd put the quality of my C++ somewhere between terrible and appalling. But my stuff generally works for the most part. :p
 
Soldato
OP
Joined
1 Feb 2006
Posts
3,470
I'm a incompetent buffoon who dabbles with foobar2000 (audio player) component development. I'd put the quality of my C++ somewhere between terrible and appalling. But my stuff generally works for the most part. :p
My C++ is more C with classes than C++. I mainly use C# now. I just got the midi working, downloaded 40 different sound fonts to try out, it works much better than I expected. Really happy with the Piano UI control I created, although It does crash sometimes on first load, think I’m loading the textures wrong or something.
 
Soldato
OP
Joined
1 Feb 2006
Posts
3,470
I even avoid classes when coding for myself - pretty much do everything with structs and enum.
I do mostly, only use C/C++ for 3D stuff as the UI is not important, although, Win UI works with C++ so might re-do my Ray Tracer and use Win UI instead of Dear GUI + Vulkan.
 
Soldato
Joined
20 Dec 2004
Posts
16,018
Been slowly plodding through a refactor of my 3D navigation plugin for Unreal. All working again now after the restructure, and now in a state I can build out a testing suite and add some ML features.

It actually one of the first C++ projects I did years ago and damn, I am getting seriously sidetracked tidying things up :p
 
Last edited:
Soldato
Joined
13 Jan 2003
Posts
23,802
Learning swift and swiftui.

Coding up a programme to analyse fretboard. This will display the deviation of string fret position. Instead of taking 176 separate measurement, i hope I can take 7 measurements in parallel (so called polychromatic).
 
Soldato
OP
Joined
1 Feb 2006
Posts
3,470
Learning swift and swiftui.

Coding up a programme to analyse fretboard. This will display the deviation of string fret position. Instead of taking 176 separate measurement, i hope I can take 7 measurements in parallel (so called polychromatic).
Sounds Interesting. I have got a bit hooked on working on a music code and am now trying to work out if I can use FFT’s to pull out notes from the sound wav and midi.
 
Soldato
Joined
13 Jan 2003
Posts
23,802
Yup i’ve done quite a bit with FFTS and phase correlation for 2D.

The short answer is yes - there’s quite a few transcription apps that do that. The more advanced even use music theory and scribe notation.

The fun with a picked guitar string is there’s a travelling wave caused by plucking the string and the standing wave. There’s also the mass of the string etc.
 
Last edited:
Soldato
OP
Joined
1 Feb 2006
Posts
3,470
Yup i’ve done quite a bit with FFTS and phase correlation for 2D.

The short answer is yes - there’s quite a few transcription apps that do that. The more advanced even use music theory and scribe notation.

The fun with a picked guitar string is there’s a travelling wave caused by plucking the string and the standing wave. There’s also the mass of the string etc.
I'm new to this, just plotting FftSharp.FFT.Magnitude so far, not sure how to work out the frequency yet but it looks like it works when playing notes on the keyboard which is nice.
 
Soldato
Joined
13 Jan 2003
Posts
23,802
I'm new to this, just plotting FftSharp.FFT.Magnitude so far, not sure how to work out the frequency yet but it looks like it works when playing notes on the keyboard which is nice.
As your fft “bin” will be a frequency range. Note you will have some effects such as spectrum leakage so using a hanning window will help reduce that. There’s a number of types of windows depending on the purpose which can give different results.

So you will have sample rate, and frequency. So based on sample rate, you will have a maximum frequency of 1/2 sample rate.
 
Man of Honour
Joined
13 Oct 2006
Posts
91,971
It actually one of the first C++ projects I did years ago and damn, I am getting seriously sidetracked tidying things up :p

C/C++ is terrible for learning new techniques as you gain more experience - there is almost always several ways to do something some of which are functionality efficient and neat but others end up as optimisations for the sake of optimisation and you end up actually spending a lot of time refactoring code to that style without actually gaining anything meaningful i.e. over use of function pointers vs just having a switch case with functions hard coded.
 
Soldato
Joined
20 Dec 2004
Posts
16,018
C/C++ is terrible for learning new techniques as you gain more experience - there is almost always several ways to do something some of which are functionality efficient and neat but others end up as optimisations for the sake of optimisation and you end up actually spending a lot of time refactoring code to that style without actually gaining anything meaningful i.e. over use of function pointers vs just having a switch case with functions hard coded.
To be fair it's mostly just sloppy coding, and changing to adhere to Unreal's naming properly and getting every single warning and error cleared our, before I start building out the test suites.

Needed a major refactor to isolate the main data structures to make testing easier, but that's all done now. Only chipping away at it very slowly as work is ridiculous atm....will get there
 
Soldato
Joined
13 Jan 2003
Posts
23,802
C/C++ is terrible for learning new techniques as you gain more experience - there is almost always several ways to do something some of which are functionality efficient and neat but others end up as optimisations for the sake of optimisation and you end up actually spending a lot of time refactoring code to that style without actually gaining anything meaningful i.e. over use of function pointers vs just having a switch case with functions hard coded.

C/C++ give you all the tools to hang yourself and anyone maintaining it to boot :D

My coding journey:
* BBC Basic in primary school
* 6502 Assembler on the BBC, BBC Master and Electron whilst at school
* Bought my first C++ compiler just as I was about to get into uni todo a BSc Software Engineering
* Turbo Pascal in Uni, 68000 embedded assembler
* C, FORTRAN77 and FORTRAN90 in uni too
* ARM Assembler in Uni too for fun in a RISC PC.. Wrote some game code..
* Job Oracle Pro*C/SQLPLus etc, C/C++ and Java
* Objective C/C++ at home on the mac
* BlackFin assembler/C - home project (stereo vision for drones in 2007-8)
* PIC assembler - home projects (astronomy cameras)
* STM C/assembler for home project ADC board.
* Now Swift + Swift UI for some coding on the mac

In the end I came to the conclusion - it's the design and build architecture vs requirements that's really what you should learn. Languages come and go. One of the things we did In our degree was meta-methodologies which is the study of methodologies (Yourdon, Ward Mellor, SSADM, and others in addition to coding with object orientation etc).
 
Man of Honour
Joined
13 Oct 2006
Posts
91,971
My coding journey:

Started with Quick BASIC can't remember if it was QB45 originally but spent most time with QB45 when my dad got a 286 PC from work. Then BBC BASIC, did a bit of ARM asm - had a book I think by Martin someone which was really good. Had a A3010 at home.

Studied Visual BASIC, Fortran, Pascal and COBOL85 but none of my courses touched on C/C++ I mostly learned C from diving into Quake series game modding. (I don't remember a single thing about Fortran or Pascal).
 
Last edited:
Soldato
Joined
13 Jan 2003
Posts
23,802
For the Swift and SwiftUI I'm going to use these resources:
* https://www.youtube.com/watch?v=8Xg7E9shq0U - as a basic understanding of the syntax of the language, using workspaces as an interpreter.
* https://cs193p.sites.stanford.edu/2023 - work through these lectures
I'm very familiar with most of the concepts, annoyingly every language has its perspective on those. For example SwiftUI views are a good example in point. Essentially there's a lot of YouTube videos out there that describe them in random terms. The reality is they should be stateless, although they have some constructive capabilities and it confuses people that they allow ForEvery and List etc in there - thinking it's a dynamic functional code base, it's a global struct but has some capabilities to adjust it's static definition but it's not functional. Thus it still holds true to the MVP pattern of the view being stateless.

@Rroff - At uni I shared my final year house with Berty (Tom Cooper) who wrote and sold a number of games on the arch. Xymox who wrote the music for many of tom's games was on the campus too.

I remember two things from Fortran - you must initialise the GINO library with the correct precision you want (this cause many to fail their numerical computation exam) and not using Fortran or COBOL saves keyboard spacebars. It had some neat things like implied loops but in the whole it's bypassed by things like python numpty and Matlab.

I had this book https://archive.org/details/arm-arc...complete-programming-course-se-covers-risc-os and my dad bought me the RiscOS Programmers Reference Guide (a set of books that documented all the SWIs etc). I even wrote to ARM to report a concurrency bug with their code generation from their C++ compiler and got a nice thank you letter from the guy that wrote it agreeing it was a bug.
Always wanted a Hydra board - allowing multiple StrongARMs but that was so close to the end of the Archimedes that I left it as a RiscPC.
 
Back
Top Bottom