Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Development Corner / Re: Questions about period and frequency
« Last post by Saga Musix on May 01, 2021, 09:54:34 »
I'd just use vectors in a modern codebase. Currently OpenMPT uses raw pointers for historical reasons, but this will probably change in the future.
One thing that's slightly more complicated with vectors is handling 8-bit and 16-bit data: You cannot simply cast a vector<int8> to vector<int16>, so you'd either have to cast the vector data each time you access it (which doesn't cost anything performance-wise but it can lead to mistakes if not done properly), or maybe for a more modern approach, use a std::variant<std::vector<int8>, std::vector<int16>> to be able to distinguish between 16-bit and 8-bit data.
22
Development Corner / Re: Questions about period and frequency
« Last post by wow25 on May 01, 2021, 03:25:51 »
Ah I was so close, it seems so obvious in retrospect. Thank you very much! Coincidentally, I recently learned about a couple kinds of interpolation in university, so I've already implemented it (linear at least)! On a related note, do you have a recommended way of storing sample data? I tried to use pointers and std::vectors, but had some weird issues. At the moment, I'm using the FastTracker 2 approach, which is just pointers to arrays, but I've heard that's unsafe.

Thank you as always!
23
Free Music Downloads / Re: [Synthpop Ballad] Epilogue (it/ogg/flac)
« Last post by Saga Musix on April 30, 2021, 22:50:32 »
I'll count that as a success...? ;D
24
Development Corner / Re: Questions about period and frequency
« Last post by Saga Musix on April 30, 2021, 07:42:10 »
Quote
C-1 is said to have a period of 856, which implies a frequency of 4181.7 Hz.
That sounds correct. I think it's just your interpretation of what frequency means in this context is a bit off. A frequency of 4181 Hz doesn't mean that the whole sample repeats 4181 times a second. The result of this formula is a sample rate, i.e. it's the frequency at which the sample position is incremented - it means that 4181 sampling points will play per second. So if your sample is 4181 samples long, its duration will be exactly one second (if it was 8362 points long, it would take two seconds to play, and so on).
What OpenMPT does is first translate the period into frequency (the same way you do), and then converts this frequency into a ratio of this sample mix rate and the output mix rate, and uses this to determine how fast to increment the sample. Let's choose more simple numbers for the sake of an example: Suppose your output mix rate is 48000 Hz (that would be a very common value, alternatively "CD quality" 44100 Hz), and period to frequency conversion gave you a sample rate of 4800 Hz (somewhere between D-1 and D#1). The ratio between those two numbers is 4800/48000 = 0.1, i.e. for every increment in the mixer's output, you advance the offset at which you read from your sample data at 0.1.
Small example:
Code: [Select]
time  |  offset
0     |  0
1     |  0.1
2     |  0.2
3     |  0.3
...
9     | 0.9
10    | 1.0
11    | 1.1
...
after one second...
47999 | 4799.9
48000 | 4800.0
48001 | 4800.1
....
Now the next thing you might be asking yourself is "how do I read sample data at offset 0.5", and the answer is "it depends". An old-skool MOD player will simply truncate the result, i.e. round down. A more sophisticated player will interpolate the output if the offset is fractional, for which it will use at least the previous and next sample point (linear interpolation) or even more surrounding sample points (e.g. sinc interpolation). But you shouldn't care about that for now, one step at a time. :)
25
Development Corner / Questions about period and frequency
« Last post by wow25 on April 30, 2021, 06:08:41 »
Hi! I've recently been working on making a simple mod player, and for the most part everything has been going well. However, translating the period of a note into its frequency has been giving me some clearly incorrect results. I've been using this page as my main reference: https://ftp.modland.com/pub/documents/format_documentation/Protracker%20effects%20(MODFIL12.TXT)%20(.mod).txt

It claims that the formula to find frequency is (7159090.0 / (2 * period)). But for most amiga period values, this produces a very high frequency. For example: C-1 is said to have a period of 856, which implies a frequency of 4181.7 Hz.

Since I'm not very good at reading other's code, I haven't been able to figure it out from other sources, like libopenmpt. My current guess is that my player interprets frequency differently (it's not derived from a mod player). If it helps, my code assumes a 2Hz frequency should try to play any sample (regardless of size) twice a second, which admittedly seems a bit off.
26
Free Music Downloads / Re: [Synthpop Ballad] Epilogue (it/ogg/flac)
« Last post by Exhale on April 30, 2021, 03:36:33 »
i cried at the end
27
Free Music Downloads / Re: {psy-trance} Grapple Hook (ogg)
« Last post by Exhale on April 30, 2021, 00:32:23 »
As I understand from the 2nd part of the post that you still intend to work on this, I would suggest to have a much stronger kick. Doesn't have to be the stereotypical psy kick, but the current one seems a bit weak, just a short click.
Is it intentional that the song was exported at 32 kHz sample rate?
Certainly :) and thanks for the feedback, it definately needed more ring for the parts where the kick only hits a few times, and I have taken your input to heart, the kick has a bit more punch (I layered it with a kick of my own design on bigroomkixsynth)
as for the 32000 - I tend to make my tunes at this htz because I use 32bit almost exclusively since most of my vsts have been long downloaded in 32bit, and for some reason, even with this decent laptop I have I have to take the htz down sometimes to avoid the clicks if I dont want to have the latency and period too high on wasapi which as far as I know is the industry standard to try and keep those low - normally I export at a higher htz for a final, but I havent gotten to the final yet, I am still mixing and mastering and playing around here...
also the quality is 96kbit because I needed it under 5meg for discord so I could ask my friend's their opinions...
I will go 44100 this time specifically for here though.
https://drive.google.com/file/d/1VXS_ZYqo1yyIMqmORw9Kk_MB5ubdBpBM/view?usp=sharing
28
Free Music Downloads / Re: {psy-trance} Grapple Hook (ogg)
« Last post by Saga Musix on April 29, 2021, 20:43:37 »
As I understand from the 2nd part of the post that you still intend to work on this, I would suggest to have a much stronger kick. Doesn't have to be the stereotypical psy kick, but the current one seems a bit weak, just a short click.
Is it intentional that the song was exported at 32 kHz sample rate?
29
Free Music Downloads / [Synthpop] Gleaming (it/ogg/flac)
« Last post by Saga Musix on April 29, 2021, 20:29:02 »
A wistful synthpop track made for the tracked music compo at Revision Online 2021, where it ranked 5th. Let's hope this will be last Revision to be an online party...

Download
30
Free Music Downloads / [Electronic] Powerkick (it/ogg/flac)
« Last post by Saga Musix on April 29, 2021, 20:26:57 »
A rare track that wasn't entered into compo at a demoparty. :D This was initially a One Hour Compo entry made about a year ago, but I decided to turn it into a full track at the end of 2020. Certainly not the usual synthpop or trance stuff you might be used from me. ;)

Download
Pages: 1 2 [3] 4 5 ... 10