Message Boards Message Boards

Making microtonal music, and alter audio and images?

Posted 2 years ago

I would like to share some idea (s) with you out there in the big Wide World.

I need some help with making microtonal music and using Mathematica to alter/modify audio and images.

For example:

I wish to take an audio object, to multiply it's samples by a number, to convert these to another base and to reverse the digits, then listen to what effects that it has on the sound

I did this with Mathematica, but I am unsure how to implement the function to change the base.

If anyone wants to discuss the matter, then I would like to listen, and to talk to them and make new contacts/connections.

Also, is anyone into microtonality and alternative turnings?

Please advise,

Regards,

Mr. S R U.

11 Replies

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

Please show your own Wolfram Language code trials first to make your question and ideas clear to other members. The rules explain several ways to include a well formatted code.

POSTED BY: Moderation Team

Check the functions IntegerDigits and RealDigits for changing base. Example:

In[315]:= IntegerDigits[131, 3]

(* Out[315]= {1, 1, 2, 1, 2} *)
POSTED BY: Daniel Lichtblau

Are we allowed to swap E-Mails and communicate outside of the Mathematica forum?

Is this within the rules?

If not, the we won't do so, as I do not want to break the rules.

Do you feel comfortable with this suggestion?

Please advise,

Regards,

S R U.

Apparently it is against the Wolfram Mathematica Forum's rules to request personal contact information with other Wolfram Mathematica forum members, but I am however allowed to give/volunteer mine.

So, here is my E-Mail, and if anyone wants to contact me personally to discuss these concept(s), then please feel free to do so.

Here is the E-Mail:

polyverse2002@yahoo.com.au

Kind regards,

Mr. Sarn Richard Ursell.

The Cytospur Variant on Audio digit reversal:

piano = AudioData[Audio[SoundNote["C", 5, 1]]][[
  1]];(*This is using Mathematica's built-in audio samples*)

base7 =
Reverse[IntegerDigits[Round[Abs[512 #]], 7]] & /@
  piano;(*This converts each sample to base 7 as a list of \


flatList =
ToExpression /@
  Flatten[base7];(*This creates a flatten list of the previous list \
of lists*)

removeDC = # - Mean[#] &@
  flatList;(*This removes the DC offset in the signal*)

normalize = #/
    Max[Abs[#]] &@
  removeDC;(*This normalizes the signal to between-1 and+1*)

output =
Audio[GaussianFilter[final, 8],
  SampleRate ->
  44100]

The Sarn Ursell variant on reverse audio digits:

CharlieChaplinSpeach =
AudioData[
  Import["F:\\Mr. SRU-Hobbies and Interests 2006-2021\\Find Sounds \
Samples, And Wavs To Use\\Find Sounds\\Charlie Chaplin Speach.wav"]][[1]]

CharlieChaplinSpeachMultiplied = CharlieChaplinSpeach*1000000

CharlieChaplinSpeachMultipliedAbs = Abs[CharlieChaplinSpeachMultiplied]

CharlieChaplinSpeachMultipliedAbsRound =
Round[CharlieChaplinSpeachMultipliedAbs]

CharlieChaplinSpeachMultipliedAbsRoundAnotherBase =
BaseForm[CharlieChaplinSpeachMultipliedAbsRound, 6]

CharlieChaplinSpeachMultipliedAbsRoundAnotherBaseReverseDigits =
IntegerReverse[CharlieChaplinSpeachMultipliedAbsRoundAnotherBase]


Export["Charlie Chaplin Speach with Digit's Reversed",
  CharlieChaplinSpeachMultipliedAbsRoundAnotherBaseReverseDigits ,
  "wav"]

I am dealing with Audio Data now, and yet...the program still will not run, it would appear that Mathematica does not like using IntegerReverse on audio data, and I attach a *.jpeg of the error message that I got when I tried to run the program...

Please advise me, and instruct and also to suggest things to me.

Please read, enjoy and advise,

Regards,

Your friend,

Mr. Sarn Richard Ursell.

How is IntegerReverse defined?

POSTED BY: Daniel Lichtblau

Well, -if you mean it's function, I can say that it reverses the sequence of numbers in an ordered list.

Thus, something like:

{3, 2, 0, 4 , 1} would become:

{1, 4, 0, 2, 3}.

Of course, I wish to apply this to Charlie Chaplin's Speech.

Suppose (as a pretty arbitrary example) you had a very short audio file, made up of three samples.

Here (arbitrarily speaking), -I might have something ;like:

{1345, 9060, 156}...

...as sample depths of the sample, out of a possible range between:

-32768--->32768,

OK?

Now, to apply the IntegerReverse function on these gives us:

{5431, 609, 651}.

In most circumstances digitized audio files would have thousands of sample/elements, and I wish to apply this concept of reversing the audio-file's digits to many audio-files..

As I said...-Naturally I wish to do this to all manner of samples, samples of speech, violins, pianos, cymbals, you get this idea?

I also wish to experiment with different multipliers and bases, really obscure ones like 5, 7, 17, 23, 31 etc...

So do you understand my idea now?

Feel free to E-Mail me if you wish to talk about this privately.

Please advise,

Regards,

Mr. Sarn Richard Ursell.

I mean that the actual code for IntegerReverse is missing from the post. It is not possible to diagnose an issue when a crucial component is absent.

POSTED BY: Daniel Lichtblau

I am not sure as to exactly what you mean by this.

i was under the impression that Mathematica was the code.

Please realize that I am a beginner, and this is why I joined the forum in the fist instance so that I could learn.

There are algorithms in C and JAVA etc...that I do know of online which reverse the digits of a number...

Do you so desire that I give reference to these?

Is that what you mean?

After some thought I realized that I have to expand upon this line of code...

Again, please realize that I am a beginner with a disability.

Thanks for your reply,

Kind regards,

Mr. Sarn Richard Ursell.

Posted 2 years ago

Daniel,

Apparently IntegerReverse is a built-in. I did not know that!

POSTED BY: Rohit Namjoshi

My gosh, I didn't know that either (I hope it was not something I implemented!) My apologies all around.

I guess the next likely culprit for causing trouble is the use of BaseForm. Maybe remove that and see if the behavior of the code improves.

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

Group Abstract Group Abstract