Group Abstract Group Abstract

Message Boards Message Boards

0
|
26.3K Views
|
28 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Play any sound, i.e: piano type sound, at any desired frequency?

Posted 9 years ago

Hi all, Please kindly let me explain further on this: All the software I have seen in the web for playing sounds seems to be always restricted to the musical ratios (musical notes) defined by any of the existing musical scales. However, I need to make a chord with any number of string-type sounds, so that I could assign any arbitrary frequency to each of them, frequencies choosen at will (not related to any existing musical scale).

Could someone tell me if there are any mathematica commands I could use, or any other way to do so.

enter image description here

Many thanks in advance for your help, indeed Best regards,

28 Replies

Yes I included an attachment in the 6th post above. However, so much time has passed since I posted this, by this time, I found FLStudio and Harmor which allows me to use any music scale, you can see that at:
https://www.youtube.com/watch?v=f2CoqkRNdgo
and the theoretical basis for my scale at:
https://www.youtube.com/watch?v=gbK_V_7ivDA

Posted 3 years ago

Thanks a lot for your reply and information.

POSTED BY: k Lu
Posted 3 years ago

Is the txt file there? I can not see it.

POSTED BY: k Lu

Note: Never use blank spaces for your filenames. Never¡

It would be great if mathematica could improve the time response for the PLAY command when using functions.

I know that by previously using the table command the time response is reduced, however I didn't find the way to use that in this dynamic case, I just have to directly use large piecewise functions within the play command.

I am attaching again the SYNTHESIZER code with some minor changes, just copy the contents, paste and run.

Attachments:

In this synthesizer the harmonics for simulating musical-instrument timbre are calculated using interpolating functions and the avalilabe harmonics-data of current musical notes. The manipulate routine could be improved using AudioGenerator

We do agree, calculating the harmonics this way for the guitar timbre is a crude approximation, however, if you have in mind experimenting with some particular frequencies, then you should find the real harmonics by using a real musical instrument and a spectrum analyzer.

I made the database of up to 21 harmonics for all the equal-temperament notes, however, I thought it was far enough to use 12 harmonics in this synthesizer.

I think, at this point, I must made the following remark: Even considering those delays in the Mathematica Play command, no other software allows you to do things like this, I think all this a great.

Mathematica is a truly powerful tool of liberation.

As promised, I am attaching an image of the console (Manipulate output) and the source code (.txt file) of the new project: 'FREE MUSIC, FREE SOUNDS' SYNTHESIZER

Just copy an paste the code of the .txt file into mathematica, and run.

Please also kindly read the text included at the top of the code and share any ideas, harmonics database, and comments on this project. Remember, this is a new open project.!

Best regards, https://domingogomezmorin.wordpress.com

enter image description here

Attachments:
POSTED BY: Sam Carrettie

No, it is just that I was trying to paste the code directly into the screen (I didn't notice there is a button for uploading files but just for images), so I previously converted it to a .txt file. Later I realized the button was there.

By the way, the number of sound buttons of this app could be increased and they could be arranged as piano keys icons, or guitar string icons. I hope to see people contributing to this open project, mainly on improving the time response of the PLAY command.

I suggest that you send Wolfram a suggestion that AudioGenerator should accept instrument names ("Piano") as well as standard waveforms ("Sawtooth"). I'm pretty sure that this is possible -- hard for us, but perhaps not so much for the developers.

If they can do this, then Wolfram Language would have a shot at replacing General MIDI as a more flexible and general music generator.

The more people who suggest this, the more likely it will happen.

Could you please share the code?

POSTED BY: Vitaliy Kaurov

Ok, I'll try to send it to wolfram demonstrations project.

In the mean time, if you are willing to check the code and make some suggestions to improve this project, please kindly let me know your email address and I will send to you the whole code.

enter image description here

My webpage is: https://domingogomezmorin.wordpress.com

Posted 9 years ago
POSTED BY: David Keith

this is getting quite interesting...

It seems, you need to previously convert the sound into an audio file, that's the meaning of the command AudioPitchShift

According to the documentation, you can use any ratio. There are ways of adjusting the pitch by multiples of semitones, but you don't need to do this.

This 'technique' is a bit of a hack. What we really want to do is to use AudioGenerator with a suitable envelope (model). The documentation lists several models that are built-in. One promising one is to use a Time Series. You could create a function that would duplicate the harmonics and decays of any arbitrary sound. This is non-trivial, of course.

As I said, this is on my list of things to do.

Many thanks George, interesting, I'll try this one. I am desperately looking to achieve this, because it also deals with a math research I am working on. It seems to be a choice, let's see...

p.d. By the way, pretty nice your wolfram demonstration on linear equations system

POSTED BY: Frank Kampas

Hi Frank, It seems I didn´t explain my point as I should. I didn´t ask for sine-type waves.
I am looking for arbitrary chords using string-type sounds (piano, violin, guitar) at any frequency. That is, chords that do not follow the ratios of the musical notes of any existing musical scale. The frequencies of the sounds must be choosen at will directly using Herzt units (not musical notes).

So to do so, I would need either the wave equation for simulating the string-type sound along with the Play Command, or any existing mathematica program code (or commands). Got it? Many thanks in advanced for any help on this matter. I have been struggling on this for some time and I am frankly frustrated, I am not quite sure if mathematica has any synthesizer code that could help, or if there is any other synthesizers out there that could do the job.

The mathematica command SoundNote does not do the job, it only works with the frequencies of musical notes, not with any frequencies chosen at will

Posted 9 years ago

Often these complex instrument sounds consist of the fundamental and a set of harmonics at amplitudes related to that of the fundamental. So one approach to simulating such sounds is to determine these additional components, either through available writings or by Fourier analysis of examples. Then you could write a function which accepts a fundamental frequency and outputs a sum of notes representing the full set of components. The fundamental could then be any frequency, not just those of standard notes.

POSTED BY: David Keith

I suspect that you'll have to add the harmonics yourself to reproduce a given sound, if you want it at any frequency.

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard